3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 14:23:38 +01:00
dft_tools/test/speed/mat_vec_mat.cpp
Olivier Parcollet 0cfb8be29e add one speed test ...
machine dependant, to get an idea...
2014-01-10 15:29:18 +01:00

35 lines
648 B
C++

#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;
}