aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-03-23 10:02:00 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-03-23 10:02:00 +0100
commit9cca79f5ca724ee5c3d5e4c6e9b842fc1f9bd2a2 (patch)
treee29ace638047c3b2b253eebe4a2b1829ae968ccc /bench
parentda3f3586e06543a2f573a1182415072b876ce481 (diff)
update aat action to do a syrk operation, and remove (comment) ata action
Diffstat (limited to 'bench')
-rw-r--r--bench/btl/actions/action_aat_product.hh2
-rw-r--r--bench/btl/actions/basic_actions.hh2
-rwxr-xr-xbench/btl/data/go_mean6
-rw-r--r--bench/btl/libs/C_BLAS/C_BLAS_interface.hh29
-rw-r--r--bench/btl/libs/C_BLAS/main.cpp2
-rw-r--r--bench/btl/libs/STL/STL_interface.hh33
-rw-r--r--bench/btl/libs/eigen3/eigen3_interface.hh9
-rw-r--r--bench/btl/libs/eigen3/main_matmat.cpp2
-rw-r--r--bench/btl/libs/gmm/main.cpp4
-rw-r--r--bench/btl/libs/mtl4/mtl4_interface.hh6
-rw-r--r--bench/btl/libs/ublas/main.cpp4
11 files changed, 53 insertions, 46 deletions
diff --git a/bench/btl/actions/action_aat_product.hh b/bench/btl/actions/action_aat_product.hh
index 92930e219..aa5b35c94 100644
--- a/bench/btl/actions/action_aat_product.hh
+++ b/bench/btl/actions/action_aat_product.hh
@@ -87,7 +87,7 @@ public :
}
double nb_op_base( void ){
- return 2.0*_size*_size*_size;
+ return double(_size)*double(_size)*double(_size);
}
inline void initialize( void ){
diff --git a/bench/btl/actions/basic_actions.hh b/bench/btl/actions/basic_actions.hh
index 62442f01f..a3333ea26 100644
--- a/bench/btl/actions/basic_actions.hh
+++ b/bench/btl/actions/basic_actions.hh
@@ -6,7 +6,7 @@
#include "action_atv_product.hh"
#include "action_matrix_matrix_product.hh"
-#include "action_ata_product.hh"
+// #include "action_ata_product.hh"
#include "action_aat_product.hh"
#include "action_trisolve.hh"
diff --git a/bench/btl/data/go_mean b/bench/btl/data/go_mean
index 37f29fa17..176c3c994 100755
--- a/bench/btl/data/go_mean
+++ b/bench/btl/data/go_mean
@@ -27,7 +27,7 @@ echo '<ul>'\
'<li>' `cat /proc/cpuinfo | grep "model name" | head -n 1`\
' (' `uname -m` ')</li>'\
'<li> compiler: ' `cat compiler_version.txt` '</li>'\
- '<li> eigen2: ' `svn info $EIGENDIR | grep Revision` '</li>'\
+ '<li> eigen3: ' `hg identify -i $EIGENDIR` '</li>'\
'</ul>' \
'</p>' >> $webpagefilename
@@ -37,11 +37,10 @@ source mk_mean_script.sh matrix_vector $1 11 50 300 1000 $mode $prefix
source mk_mean_script.sh atv $1 11 50 300 1000 $mode $prefix
source mk_mean_script.sh matrix_matrix $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh aat $1 11 100 300 1000 $mode $prefix
-source mk_mean_script.sh ata $1 11 100 300 1000 $mode $prefix
+# source mk_mean_script.sh ata $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh trisolve_vector $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh trisolve_matrix $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh cholesky $1 11 100 300 1000 $mode $prefix
-source mk_mean_script.sh complete_lu_decomp $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh partial_lu_decomp $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh tridiagonalization $1 11 100 300 1000 $mode $prefix
source mk_mean_script.sh hessenberg $1 11 100 300 1000 $mode $prefix
@@ -49,6 +48,7 @@ source mk_mean_script.sh symv $1 11 50 300 1000 $mode $prefix
source mk_mean_script.sh syr2 $1 11 50 300 1000 $mode $prefix
source mk_mean_script.sh ger $1 11 50 300 1000 $mode $prefix
source mk_mean_script.sh rot $1 11 2500 100000 250000 $mode $prefix
+source mk_mean_script.sh complete_lu_decomp $1 11 100 300 1000 $mode $prefix
fi
diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
index 5701b7b1e..d23d04807 100644
--- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
+++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
@@ -108,12 +108,13 @@ public :
cblas_dgemm(CblasColMajor,CblasTrans,CblasTrans,N,N,N,1.0,A,N,B,N,0.0,X,N);
}
- static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
- cblas_dgemm(CblasColMajor,CblasTrans,CblasNoTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
- }
+// static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
+// cblas_dgemm(CblasColMajor,CblasTrans,CblasNoTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+// }
static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){
- cblas_dgemm(CblasColMajor,CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+ //cblas_dgemm(CblasColMajor,CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+ cblas_dsyrk(CblasColMajor, CblasLower, CblasTrans, N, N, 1.0, A, N, 0.0, X, N);
}
static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N){
@@ -212,19 +213,21 @@ public :
#endif
}
- static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
- #ifdef PUREBLAS
- sgemm_(&trans,&notrans,&N,&N,&N,&fone,A,&N,A,&N,&fzero,X,&N);
- #else
- cblas_sgemm(CblasColMajor,CblasTrans,CblasNoTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
- #endif
- }
+// static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){
+// #ifdef PUREBLAS
+// sgemm_(&trans,&notrans,&N,&N,&N,&fone,A,&N,A,&N,&fzero,X,&N);
+// #else
+// cblas_sgemm(CblasColMajor,CblasTrans,CblasNoTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+// #endif
+// }
static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){
#ifdef PUREBLAS
- sgemm_(&notrans,&trans,&N,&N,&N,&fone,A,&N,A,&N,&fzero,X,&N);
+ // sgemm_(&notrans,&trans,&N,&N,&N,&fone,A,&N,A,&N,&fzero,X,&N);
+ ssyrk_(&lower,&notrans,&N,&N,&fone,A,&N,&fzero,X,&N);
#else
- cblas_sgemm(CblasColMajor,CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+// cblas_sgemm(CblasColMajor,CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N);
+ cblas_ssyrk(CblasColMajor, CblasLower, CblasNoTrans, N, N, 1.0, A, N, 0.0, X, N);
#endif
}
diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp
index 99f512f9b..d7af129f7 100644
--- a/bench/btl/libs/C_BLAS/main.cpp
+++ b/bench/btl/libs/C_BLAS/main.cpp
@@ -48,7 +48,7 @@ int main()
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);
+// bench<Action_ata_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_aat_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_trisolve<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
diff --git a/bench/btl/libs/STL/STL_interface.hh b/bench/btl/libs/STL/STL_interface.hh
index 0b73382f3..93e76bd55 100644
--- a/bench/btl/libs/STL/STL_interface.hh
+++ b/bench/btl/libs/STL/STL_interface.hh
@@ -78,18 +78,18 @@ public :
cible[i][j]=source[i][j];
}
- static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N)
- {
- real somme;
- for (int j=0;j<N;j++){
- for (int i=0;i<N;i++){
- somme=0.0;
- for (int k=0;k<N;k++)
- somme += A[i][k]*A[j][k];
- X[j][i]=somme;
- }
- }
- }
+// static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N)
+// {
+// real somme;
+// for (int j=0;j<N;j++){
+// for (int i=0;i<N;i++){
+// somme=0.0;
+// for (int k=0;k<N;k++)
+// somme += A[i][k]*A[j][k];
+// X[j][i]=somme;
+// }
+// }
+// }
static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N)
{
@@ -97,10 +97,13 @@ public :
for (int j=0;j<N;j++){
for (int i=0;i<N;i++){
somme=0.0;
- for (int k=0;k<N;k++){
- somme+=A[k][i]*A[k][j];
+ if(i>=j)
+ {
+ for (int k=0;k<N;k++){
+ somme+=A[k][i]*A[k][j];
+ }
+ X[j][i]=somme;
}
- X[j][i]=somme;
}
}
}
diff --git a/bench/btl/libs/eigen3/eigen3_interface.hh b/bench/btl/libs/eigen3/eigen3_interface.hh
index bd5eb4b6b..2fca393e9 100644
--- a/bench/btl/libs/eigen3/eigen3_interface.hh
+++ b/bench/btl/libs/eigen3/eigen3_interface.hh
@@ -92,12 +92,13 @@ public :
X.noalias() = A.transpose()*B.transpose();
}
- static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
- X.noalias() = A.transpose()*A;
- }
+// static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
+// X.noalias() = A.transpose()*A;
+// }
static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){
- X.noalias() = A*A.transpose();
+ X.template triangularView<Lower>().setZero();
+ X.template selfadjointView<Lower>().rankUpdate(A);
}
static inline void matrix_vector_product(const gene_matrix & A, const gene_vector & B, gene_vector & X, int N){
diff --git a/bench/btl/libs/eigen3/main_matmat.cpp b/bench/btl/libs/eigen3/main_matmat.cpp
index 052810a16..926fa2b01 100644
--- a/bench/btl/libs/eigen3/main_matmat.cpp
+++ b/bench/btl/libs/eigen3/main_matmat.cpp
@@ -25,7 +25,7 @@ BTL_MAIN;
int main()
{
bench<Action_matrix_matrix_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
- bench<Action_ata_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+// bench<Action_ata_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_aat_product<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_trmm<eigen3_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
diff --git a/bench/btl/libs/gmm/main.cpp b/bench/btl/libs/gmm/main.cpp
index 7ab22fda3..1f0c051eb 100644
--- a/bench/btl/libs/gmm/main.cpp
+++ b/bench/btl/libs/gmm/main.cpp
@@ -34,8 +34,8 @@ int main()
bench<Action_atv_product<gmm_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
bench<Action_matrix_matrix_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
- bench<Action_ata_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
- bench<Action_aat_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+// bench<Action_ata_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+// bench<Action_aat_product<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_trisolve<gmm_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
//bench<Action_lu_solve<blitz_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT);
diff --git a/bench/btl/libs/mtl4/mtl4_interface.hh b/bench/btl/libs/mtl4/mtl4_interface.hh
index a2f067f73..3795ac61e 100644
--- a/bench/btl/libs/mtl4/mtl4_interface.hh
+++ b/bench/btl/libs/mtl4/mtl4_interface.hh
@@ -92,9 +92,9 @@ public :
X = (trans(A)*trans(B));
}
- static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
- X = (trans(A)*A);
- }
+// static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){
+// X = (trans(A)*A);
+// }
static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){
X = (A*trans(A));
diff --git a/bench/btl/libs/ublas/main.cpp b/bench/btl/libs/ublas/main.cpp
index 22d697225..e2e77ee1f 100644
--- a/bench/btl/libs/ublas/main.cpp
+++ b/bench/btl/libs/ublas/main.cpp
@@ -33,8 +33,8 @@ int main()
bench<Action_atv_product<ublas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT);
bench<Action_matrix_matrix_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
- bench<Action_ata_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
- bench<Action_aat_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+// bench<Action_ata_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+// bench<Action_aat_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_trisolve<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);