aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/btl/libs
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-08-15 10:19:16 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-08-15 10:19:16 +0200
commitd2becb9612c1cd2c8c45e1177b04d5543be8fb9d (patch)
tree7e6f11f2ae52f3e272bacf4704398c4d77cd64dc /bench/btl/libs
parent846e8b49ba15563729ef61b0645c7546d5f62db5 (diff)
add a "rot" benchmark in BTL
Diffstat (limited to 'bench/btl/libs')
-rw-r--r--bench/btl/libs/C_BLAS/C_BLAS_interface.hh8
-rw-r--r--bench/btl/libs/C_BLAS/main.cpp1
-rw-r--r--bench/btl/libs/eigen2/eigen2_interface.hh4
-rw-r--r--bench/btl/libs/eigen2/main_linear.cpp1
4 files changed, 14 insertions, 0 deletions
diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
index 725f35944..f07df1033 100644
--- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
+++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
@@ -179,6 +179,14 @@ public :
#endif
}
+ static inline void rot(gene_vector & A, gene_vector & B, float c, float s, int N){
+ #ifdef PUREBLAS
+ srot_(&N,A,&intone,B,&intone,&c,&s);
+ #else
+ cblas_srot(N,A,1,B,1,c,s);
+ #endif
+ }
+
static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
#ifdef PUREBLAS
sgemv_(&trans,&N,&N,&fone,A,&N,B,&intone,&fzero,X,&intone);
diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp
index 6fd75812c..fdffdc979 100644
--- a/bench/btl/libs/C_BLAS/main.cpp
+++ b/bench/btl/libs/C_BLAS/main.cpp
@@ -45,6 +45,7 @@ int main()
bench<Action_syr2<C_BLAS_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
bench<Action_ger<C_BLAS_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
+ bench<Action_rot<C_BLAS_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
bench<Action_matrix_matrix_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_ata_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh
index 6a1bc5d61..1a5f89834 100644
--- a/bench/btl/libs/eigen2/eigen2_interface.hh
+++ b/bench/btl/libs/eigen2/eigen2_interface.hh
@@ -168,6 +168,10 @@ public :
A.col(j) += X * Y[j];
}
+ static EIGEN_DONT_INLINE void rot(gene_vector & A, gene_vector & B, real c, real s, int N){
+ ei_apply_rotation_in_the_plane(A, B, c, s);
+ }
+
static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
X = (A.transpose()*B).lazy();
}
diff --git a/bench/btl/libs/eigen2/main_linear.cpp b/bench/btl/libs/eigen2/main_linear.cpp
index e79927b0f..e73fe2043 100644
--- a/bench/btl/libs/eigen2/main_linear.cpp
+++ b/bench/btl/libs/eigen2/main_linear.cpp
@@ -27,6 +27,7 @@ int main()
bench<Action_axpy<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
bench<Action_axpby<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
+ bench<Action_rot<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT);
return 0;
}