add a "rot" benchmark in BTL

This commit is contained in:
Gael Guennebaud
2009-08-15 10:19:16 +02:00
parent 846e8b49ba
commit d2becb9612
8 changed files with 134 additions and 1 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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();
}

View File

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