diff options
Diffstat (limited to 'bench/btl/libs')
-rw-r--r-- | bench/btl/libs/BLAS/CMakeLists.txt | 16 | ||||
-rw-r--r-- | bench/btl/libs/BLAS/blas_interface_impl.hh | 6 | ||||
-rw-r--r-- | bench/btl/libs/BLAS/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/STL/STL_interface.hh | 24 | ||||
-rw-r--r-- | bench/btl/libs/blaze/blaze_interface.hh | 17 | ||||
-rw-r--r-- | bench/btl/libs/blaze/main.cpp | 6 | ||||
-rw-r--r-- | bench/btl/libs/blitz/CMakeLists.txt | 6 | ||||
-rw-r--r-- | bench/btl/libs/eigen3/CMakeLists.txt | 10 | ||||
-rw-r--r-- | bench/btl/libs/eigen3/eigen3_interface.hh | 8 | ||||
-rw-r--r-- | bench/btl/libs/eigen3/main_matmat.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/gmm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bench/btl/libs/mtl4/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bench/btl/libs/tensors/CMakeLists.txt | 4 | ||||
-rw-r--r-- | bench/btl/libs/tvmet/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bench/btl/libs/ublas/CMakeLists.txt | 2 | ||||
-rw-r--r-- | bench/btl/libs/ublas/ublas_interface.hh | 2 |
16 files changed, 57 insertions, 54 deletions
diff --git a/bench/btl/libs/BLAS/CMakeLists.txt b/bench/btl/libs/BLAS/CMakeLists.txt index 0272ccad0..f2738f169 100644 --- a/bench/btl/libs/BLAS/CMakeLists.txt +++ b/bench/btl/libs/BLAS/CMakeLists.txt @@ -5,8 +5,8 @@ if (ATLAS_FOUND) if(BUILD_btl_atlas) target_link_libraries(btl_atlas ${ATLAS_LIBRARIES}) set_target_properties(btl_atlas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ATLAS -DHAS_LAPACK=1") - endif(BUILD_btl_atlas) -endif (ATLAS_FOUND) + endif() +endif () find_package(MKL) if (MKL_FOUND) @@ -14,8 +14,8 @@ if (MKL_FOUND) if(BUILD_btl_mkl) target_link_libraries(btl_mkl ${MKL_LIBRARIES}) set_target_properties(btl_mkl PROPERTIES COMPILE_FLAGS "-DCBLASNAME=INTEL_MKL -DHAS_LAPACK=1") - endif(BUILD_btl_mkl) -endif (MKL_FOUND) + endif() +endif () find_package(OPENBLAS) @@ -24,8 +24,8 @@ if (OPENBLAS_FOUND) if(BUILD_btl_openblas) target_link_libraries(btl_openblas ${OPENBLAS_LIBRARIES} ) set_target_properties(btl_openblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=OPENBLAS") - endif(BUILD_btl_openblas) -endif (OPENBLAS_FOUND) + endif() +endif () find_package(ACML) if (ACML_FOUND) @@ -33,8 +33,8 @@ if (ACML_FOUND) if(BUILD_btl_acml) target_link_libraries(btl_acml ${ACML_LIBRARIES} ) set_target_properties(btl_acml PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ACML -DHAS_LAPACK=1") - endif(BUILD_btl_acml) -endif (ACML_FOUND) + endif() +endif () if(Eigen_SOURCE_DIR AND CMAKE_Fortran_COMPILER_WORKS) # we are inside Eigen and blas/lapack interface is compilable diff --git a/bench/btl/libs/BLAS/blas_interface_impl.hh b/bench/btl/libs/BLAS/blas_interface_impl.hh index fc4ba2a1f..9e0a64905 100644 --- a/bench/btl/libs/BLAS/blas_interface_impl.hh +++ b/bench/btl/libs/BLAS/blas_interface_impl.hh @@ -46,9 +46,9 @@ public : BLAS_FUNC(gemm)(¬rans,¬rans,&N,&N,&N,&fone,A,&N,B,&N,&fzero,X,&N); } -// static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){ -// ssyrk_(&lower,&trans,&N,&N,&fone,A,&N,&fzero,X,&N); -// } + static inline void ata_product(gene_matrix & A, gene_matrix & X, int N){ + BLAS_FUNC(syrk)(&lower,&trans,&N,&N,&fone,A,&N,&fzero,X,&N); + } static inline void aat_product(gene_matrix & A, gene_matrix & X, int N){ BLAS_FUNC(syrk)(&lower,¬rans,&N,&N,&fone,A,&N,&fzero,X,&N); diff --git a/bench/btl/libs/BLAS/main.cpp b/bench/btl/libs/BLAS/main.cpp index 564d55ef2..fd991490a 100644 --- a/bench/btl/libs/BLAS/main.cpp +++ b/bench/btl/libs/BLAS/main.cpp @@ -48,7 +48,7 @@ int main() bench<Action_rot<blas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); bench<Action_matrix_matrix_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); -// bench<Action_ata_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); + bench<Action_ata_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_aat_product<blas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_trisolve<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 ef4cc9233..16658c4ba 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) { diff --git a/bench/btl/libs/blaze/blaze_interface.hh b/bench/btl/libs/blaze/blaze_interface.hh index ee1523944..7b418f6da 100644 --- a/bench/btl/libs/blaze/blaze_interface.hh +++ b/bench/btl/libs/blaze/blaze_interface.hh @@ -20,6 +20,7 @@ #include <blaze/Math.h> #include <blaze/Blaze.h> +#include <Eigen/Core> // using namespace blaze; #include <vector> @@ -80,35 +81,35 @@ public : } } - static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){ + static EIGEN_DONT_INLINE void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){ X = (A*B); } - static inline void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){ + static EIGEN_DONT_INLINE void transposed_matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){ X = (trans(A)*trans(B)); } - static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){ + static EIGEN_DONT_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){ + static EIGEN_DONT_INLINE void aat_product(const gene_matrix & A, gene_matrix & X, int N){ X = (A*trans(A)); } - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ + static EIGEN_DONT_INLINE void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ X = (A*B); } - static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ + static EIGEN_DONT_INLINE void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ X = (trans(A)*B); } - static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){ + static EIGEN_DONT_INLINE void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){ Y += coef * X; } - static inline void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){ + static EIGEN_DONT_INLINE void axpby(real a, const gene_vector & X, real b, gene_vector & Y, int N){ Y = a*X + b*Y; } diff --git a/bench/btl/libs/blaze/main.cpp b/bench/btl/libs/blaze/main.cpp index 80e8f4eaa..ccae0cbd5 100644 --- a/bench/btl/libs/blaze/main.cpp +++ b/bench/btl/libs/blaze/main.cpp @@ -30,9 +30,9 @@ int main() bench<Action_matrix_vector_product<blaze_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); bench<Action_atv_product<blaze_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); -// bench<Action_matrix_matrix_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); -// bench<Action_ata_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); -// bench<Action_aat_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); + bench<Action_matrix_matrix_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); + bench<Action_ata_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); + bench<Action_aat_product<blaze_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); return 0; } diff --git a/bench/btl/libs/blitz/CMakeLists.txt b/bench/btl/libs/blitz/CMakeLists.txt index 880ab7338..e203c8152 100644 --- a/bench/btl/libs/blitz/CMakeLists.txt +++ b/bench/btl/libs/blitz/CMakeLists.txt @@ -7,11 +7,11 @@ if (BLITZ_FOUND) btl_add_bench(btl_blitz btl_blitz.cpp) if (BUILD_btl_blitz) target_link_libraries(btl_blitz ${BLITZ_LIBRARIES}) - endif (BUILD_btl_blitz) + endif () btl_add_bench(btl_tiny_blitz btl_tiny_blitz.cpp OFF) if (BUILD_btl_tiny_blitz) target_link_libraries(btl_tiny_blitz ${BLITZ_LIBRARIES}) - endif (BUILD_btl_tiny_blitz) + endif () -endif (BLITZ_FOUND) +endif () diff --git a/bench/btl/libs/eigen3/CMakeLists.txt b/bench/btl/libs/eigen3/CMakeLists.txt index 00cae23d3..06a72b4fb 100644 --- a/bench/btl/libs/eigen3/CMakeLists.txt +++ b/bench/btl/libs/eigen3/CMakeLists.txt @@ -47,9 +47,9 @@ if (EIGEN3_FOUND) # if(BUILD_btl_eigen3_adv) # target_link_libraries(btl_eigen3_adv ${MKL_LIBRARIES}) -# endif(BUILD_btl_eigen3_adv) +# endif() - endif(NOT BTL_NOVEC) + endif() btl_add_bench(btl_tiny_eigen3 btl_tiny_eigen3.cpp OFF) @@ -59,7 +59,7 @@ if (EIGEN3_FOUND) if(BUILD_btl_tiny_eigen3_novec) btl_add_target_property(btl_tiny_eigen3_novec COMPILE_FLAGS "-DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=eigen3_tiny_novec") - endif(BUILD_btl_tiny_eigen3_novec) - endif(NOT BTL_NOVEC) + endif() + endif() -endif (EIGEN3_FOUND) +endif () diff --git a/bench/btl/libs/eigen3/eigen3_interface.hh b/bench/btl/libs/eigen3/eigen3_interface.hh index b821fd721..2e302d072 100644 --- a/bench/btl/libs/eigen3/eigen3_interface.hh +++ b/bench/btl/libs/eigen3/eigen3_interface.hh @@ -92,9 +92,11 @@ 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; + X.template triangularView<Lower>().setZero(); + X.template selfadjointView<Lower>().rankUpdate(A.transpose()); + } static inline void aat_product(const gene_matrix & A, gene_matrix & X, int /*N*/){ X.template triangularView<Lower>().setZero(); diff --git a/bench/btl/libs/eigen3/main_matmat.cpp b/bench/btl/libs/eigen3/main_matmat.cpp index 926fa2b01..052810a16 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/CMakeLists.txt b/bench/btl/libs/gmm/CMakeLists.txt index bc2586243..0bcb04659 100644 --- a/bench/btl/libs/gmm/CMakeLists.txt +++ b/bench/btl/libs/gmm/CMakeLists.txt @@ -3,4 +3,4 @@ find_package(GMM) if (GMM_FOUND) include_directories(${GMM_INCLUDES}) btl_add_bench(btl_gmm main.cpp) -endif (GMM_FOUND) +endif () diff --git a/bench/btl/libs/mtl4/CMakeLists.txt b/bench/btl/libs/mtl4/CMakeLists.txt index 14b47a808..132a501be 100644 --- a/bench/btl/libs/mtl4/CMakeLists.txt +++ b/bench/btl/libs/mtl4/CMakeLists.txt @@ -3,4 +3,4 @@ find_package(MTL4) if (MTL4_FOUND) include_directories(${MTL4_INCLUDE_DIR}) btl_add_bench(btl_mtl4 main.cpp) -endif (MTL4_FOUND) +endif () diff --git a/bench/btl/libs/tensors/CMakeLists.txt b/bench/btl/libs/tensors/CMakeLists.txt index 09d6d8e43..e10a736f5 100644 --- a/bench/btl/libs/tensors/CMakeLists.txt +++ b/bench/btl/libs/tensors/CMakeLists.txt @@ -39,6 +39,6 @@ if (TENSOR_FOUND) btl_add_target_property(btl_tensor_novec_vecmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec") btl_add_target_property(btl_tensor_novec_matmat COMPILE_FLAGS "-fno-exceptions -DEIGEN_DONT_VECTORIZE -DBTL_PREFIX=tensor_novec") - endif(NOT BTL_NOVEC) + endif() -endif (TENSOR_FOUND) +endif () diff --git a/bench/btl/libs/tvmet/CMakeLists.txt b/bench/btl/libs/tvmet/CMakeLists.txt index 25b565b97..e7376972c 100644 --- a/bench/btl/libs/tvmet/CMakeLists.txt +++ b/bench/btl/libs/tvmet/CMakeLists.txt @@ -3,4 +3,4 @@ find_package(Tvmet) if (TVMET_FOUND) include_directories(${TVMET_INCLUDE_DIR}) btl_add_bench(btl_tvmet main.cpp OFF) -endif (TVMET_FOUND) +endif () diff --git a/bench/btl/libs/ublas/CMakeLists.txt b/bench/btl/libs/ublas/CMakeLists.txt index bdb58bea1..5accf5b82 100644 --- a/bench/btl/libs/ublas/CMakeLists.txt +++ b/bench/btl/libs/ublas/CMakeLists.txt @@ -4,4 +4,4 @@ if (Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDES}) btl_add_bench(btl_ublas main.cpp) -endif (Boost_FOUND) +endif () diff --git a/bench/btl/libs/ublas/ublas_interface.hh b/bench/btl/libs/ublas/ublas_interface.hh index 95cad5195..f59b7cf2f 100644 --- a/bench/btl/libs/ublas/ublas_interface.hh +++ b/bench/btl/libs/ublas/ublas_interface.hh @@ -100,7 +100,7 @@ public : Y+=coef*X; } - // alias free assignements + // alias free assignments static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ X.assign(prod(A,B)); |