3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 11:13:46 +01:00

add one speed test ...

machine dependant, to get an idea...
This commit is contained in:
Olivier Parcollet 2014-01-10 15:29:18 +01:00
parent eec9a0662a
commit 0cfb8be29e

View File

@ -0,0 +1,34 @@
#include <triqs/arrays.hpp>
using namespace triqs::arrays;
using namespace triqs;
const int N1= 25; //, N2 = 300;
struct mat_vec {
void operator()() {
matrix<double> a (N1,N1), V(N1, N1), f(N1, N1);
for (int u =0; u<5000; ++u)
for (int j=0; j<N1; ++j)
triqs::arrays::blas::gemv(1.0, a, V(j,range()), 0.0,f(j,range()));
}
};
struct mat_mat {
void operator()() {
matrix<double> a (N1,N1), V(N1, N1), f(N1, N1);
for (int u =0; u<5000; ++u)
triqs::arrays::blas::gemm(1.0, a, V, 0.0,f);
}
};
#include "./speed_tester.hpp"
int main() {
const int l = 200;
speed_tester<mat_mat> (l);
speed_tester<mat_vec> (l);
return 0;
}