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:
parent
eec9a0662a
commit
0cfb8be29e
34
test/speed/mat_vec_mat.cpp
Normal file
34
test/speed/mat_vec_mat.cpp
Normal 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user