mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add a "rot" benchmark in BTL
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user