From 6f71ef8277405d268032f7c3bcaf316c7422c133 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 10 Jul 2008 18:28:50 +0000 Subject: resurrected tvmet, added mt4, intel's MKL and handcoded vectorized backends in the benchmark suite --- bench/btl/libs/ATLAS/ATLAS_LU_solve_interface.hh | 118 ---------- bench/btl/libs/ATLAS/ATLAS_interface.hh | 120 ----------- bench/btl/libs/ATLAS/CMakeLists.txt | 4 - bench/btl/libs/ATLAS/main.cpp | 49 ----- bench/btl/libs/ATLAS/titi.txt | 33 --- bench/btl/libs/C/C_interface.hh | 23 +- bench/btl/libs/C/main.cpp | 2 + bench/btl/libs/C_BLAS/CMakeLists.txt | 22 +- bench/btl/libs/C_BLAS/C_BLAS_interface.hh | 7 +- bench/btl/libs/C_BLAS/main.cpp | 3 + .../INTEL_BLAS/INTEL_BLAS_LU_solve_interface.hh | 127 ----------- bench/btl/libs/INTEL_BLAS/INTEL_BLAS_interface.hh | 95 -------- bench/btl/libs/INTEL_BLAS/config.sh | 2 - bench/btl/libs/INTEL_BLAS/main.cpp | 49 ----- bench/btl/libs/blitz/CMakeLists.txt | 19 +- bench/btl/libs/blitz/btl_blitz.cpp | 51 +++++ bench/btl/libs/blitz/btl_tiny_blitz.cpp | 39 ++++ bench/btl/libs/blitz/main.cpp | 51 ----- bench/btl/libs/blitz/tiny_blitz_interface.hh | 106 +++++++++ bench/btl/libs/eigen2/CMakeLists.txt | 28 ++- bench/btl/libs/eigen2/btl_tiny_eigen2.cpp | 42 ++++ bench/btl/libs/eigen2/main.cpp | 2 +- bench/btl/libs/f77/f77_interface.hh | 34 +-- bench/btl/libs/gmm/CMakeLists.txt | 7 +- bench/btl/libs/hand_vec/CMakeLists.txt | 12 ++ bench/btl/libs/hand_vec/hand_vec_interface.hh | 238 +++++++++++++++++++++ bench/btl/libs/hand_vec/main.cpp | 48 +++++ bench/btl/libs/mtl4/CMakeLists.txt | 6 + bench/btl/libs/mtl4/main.cpp | 4 +- bench/btl/libs/mtl4/mtl4_interface.hh | 4 +- bench/btl/libs/tiny_blitz/CMakeLists.txt | 4 - bench/btl/libs/tiny_blitz/main.cpp | 39 ---- bench/btl/libs/tiny_blitz/tiny_blitz_interface.hh | 106 --------- bench/btl/libs/tvmet/CMakeLists.txt | 7 +- bench/btl/libs/ublas/CMakeLists.txt | 8 +- 35 files changed, 661 insertions(+), 848 deletions(-) delete mode 100644 bench/btl/libs/ATLAS/ATLAS_LU_solve_interface.hh delete mode 100644 bench/btl/libs/ATLAS/ATLAS_interface.hh delete mode 100644 bench/btl/libs/ATLAS/CMakeLists.txt delete mode 100644 bench/btl/libs/ATLAS/main.cpp delete mode 100644 bench/btl/libs/ATLAS/titi.txt delete mode 100644 bench/btl/libs/INTEL_BLAS/INTEL_BLAS_LU_solve_interface.hh delete mode 100644 bench/btl/libs/INTEL_BLAS/INTEL_BLAS_interface.hh delete mode 100755 bench/btl/libs/INTEL_BLAS/config.sh delete mode 100644 bench/btl/libs/INTEL_BLAS/main.cpp create mode 100644 bench/btl/libs/blitz/btl_blitz.cpp create mode 100644 bench/btl/libs/blitz/btl_tiny_blitz.cpp delete mode 100644 bench/btl/libs/blitz/main.cpp create mode 100644 bench/btl/libs/blitz/tiny_blitz_interface.hh create mode 100644 bench/btl/libs/eigen2/btl_tiny_eigen2.cpp create mode 100644 bench/btl/libs/hand_vec/CMakeLists.txt create mode 100755 bench/btl/libs/hand_vec/hand_vec_interface.hh create mode 100644 bench/btl/libs/hand_vec/main.cpp create mode 100644 bench/btl/libs/mtl4/CMakeLists.txt delete mode 100644 bench/btl/libs/tiny_blitz/CMakeLists.txt delete mode 100644 bench/btl/libs/tiny_blitz/main.cpp delete mode 100644 bench/btl/libs/tiny_blitz/tiny_blitz_interface.hh (limited to 'bench/btl/libs') diff --git a/bench/btl/libs/ATLAS/ATLAS_LU_solve_interface.hh b/bench/btl/libs/ATLAS/ATLAS_LU_solve_interface.hh deleted file mode 100644 index 83732b4a2..000000000 --- a/bench/btl/libs/ATLAS/ATLAS_LU_solve_interface.hh +++ /dev/null @@ -1,118 +0,0 @@ -//===================================================== -// File : ATLAS_LU_solve_interface.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:22 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef ATLAS_LU_solve_interface_HH -#define ATLAS_LU_solve_interface_HH -#include "ATLAS_interface.hh" -extern "C" -{ -#include -#include -#include -#include "cblas.h" -#include - -} - -template -class ATLAS_LU_solve_interface : public ATLAS_interface -{ -public : - - typedef typename ATLAS_interface::gene_matrix gene_matrix; - typedef typename ATLAS_interface::gene_vector gene_vector; - - typedef int * Pivot_Vector; - - inline static void new_Pivot_Vector(Pivot_Vector & pivot, int N) - { - - pivot = new int[N]; - - } - - inline static void free_Pivot_Vector(Pivot_Vector & pivot) - { - - delete pivot; - - } - - - inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N) - { - - int error=ATL_dgetrf(CblasColMajor,N,N,LU,N,pivot); - - } - - inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, const gene_vector &B, gene_vector X, int N) - { - - copy_vector(B,X,N); - ATL_dgetrs(CblasColMajor,CblasNoTrans,N,1,LU,N,pivot,X,N); - - } - -}; - -template<> -class ATLAS_LU_solve_interface : public ATLAS_interface -{ -public : - - typedef int * Pivot_Vector; - - inline static void new_Pivot_Vector(Pivot_Vector & pivot, int N) - { - - pivot = new int[N]; - - } - - inline static void free_Pivot_Vector(Pivot_Vector & pivot) - { - - delete pivot; - - } - - - inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N) - { - - int error=ATL_sgetrf(CblasColMajor,N,N,LU,N,pivot); - - } - - inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, const gene_vector &B, gene_vector X, int N) - { - - copy_vector(B,X,N); - ATL_sgetrs(CblasColMajor,CblasNoTrans,N,1,LU,N,pivot,X,N); - - } - -}; - - -#endif - - - diff --git a/bench/btl/libs/ATLAS/ATLAS_interface.hh b/bench/btl/libs/ATLAS/ATLAS_interface.hh deleted file mode 100644 index a0e93854b..000000000 --- a/bench/btl/libs/ATLAS/ATLAS_interface.hh +++ /dev/null @@ -1,120 +0,0 @@ -//===================================================== -// File : ATLAS_interface.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:21 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef ATLAS_PRODUIT_MATRICE_VECTEUR_HH -#define ATLAS_PRODUIT_MATRICE_VECTEUR_HH -#include "f77_interface_base.hh" -#include -extern "C" -{ -#include -#include -#include -#include "cblas.h" - -} - -template -class ATLAS_interface : public f77_interface_base -{ -public : - - typedef typename f77_interface_base::gene_matrix gene_matrix; - typedef typename f77_interface_base::gene_vector gene_vector; - - static inline std::string name( void ) - { - return "ATLAS"; - } - - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) - { - - ATL_dgemv(CblasNoTrans,N,N,1.0,A,N,B,1,0.0,X,1); - - } - - static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) - { - ATL_dgemm(CblasNoTrans,CblasNoTrans,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) - { - ATL_dgemm(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) - { - ATL_dgemm(CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N); - } - - - - static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N) - { - ATL_daxpy(N,coef,X,1,Y,1); - } -}; - -template<> -class ATLAS_interface : public f77_interface_base -{ -public : - - static inline std::string name( void ) - { - return "ATLAS"; - } - - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) - { - - ATL_sgemv(CblasNoTrans,N,N,1.0,A,N,B,1,0.0,X,1); - - } - - static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) - { - ATL_sgemm(CblasNoTrans,CblasNoTrans,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) - { - ATL_sgemm(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) - { - ATL_sgemm(CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N); - } - - - static inline void axpy(float coef, const gene_vector & X, gene_vector & Y, int N) - { - ATL_saxpy(N,coef,X,1,Y,1); - } -}; - - -#endif - - - diff --git a/bench/btl/libs/ATLAS/CMakeLists.txt b/bench/btl/libs/ATLAS/CMakeLists.txt deleted file mode 100644 index e047b4e08..000000000 --- a/bench/btl/libs/ATLAS/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -include_directories(${BLITZ_INCLUDES}) -add_executable(btl_blitz main.cpp) -target_link_libraries(btl_blitz ${BLITZ_LIBRARIES}) diff --git a/bench/btl/libs/ATLAS/main.cpp b/bench/btl/libs/ATLAS/main.cpp deleted file mode 100644 index 2383a7367..000000000 --- a/bench/btl/libs/ATLAS/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===================================================== -// File : main.cpp -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:21 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#include "utilities.h" -#include "ATLAS_interface.hh" -#include "ATLAS_LU_solve_interface.hh" -#include "bench.hh" -#include "action_matrix_vector_product.hh" -#include "action_matrix_matrix_product.hh" -#include "action_axpy.hh" -#include "action_lu_solve.hh" -#include "action_ata_product.hh" -#include "action_aat_product.hh" - - -int main() -{ - bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); - - bench > >(MIN_MV,MAX_MV,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - - // bench > >(MIN_LU,MAX_LU,NB_POINT); - - return 0; -} - - diff --git a/bench/btl/libs/ATLAS/titi.txt b/bench/btl/libs/ATLAS/titi.txt deleted file mode 100644 index 470501f6f..000000000 --- a/bench/btl/libs/ATLAS/titi.txt +++ /dev/null @@ -1,33 +0,0 @@ -Bonjour à tous, - -Une dizaine de candidats Neptune se sont déjà déclarés pour la formation C++ -(sur la base de 2 jours/semaine pendant 1 mois). - -Il faut faire une proposition de date pour la formation. Les vacances scolaires zone C (Paris) -se terminent le 22 avril (au matin) nous pourrions commencer ce jour. - -A priori il me semble que deux jours consécutifs soient préférables. Je propose les mardi et mercredi -de chaque semaine. Sachant qu'il y a 2 jeudi (1er et 8 mai) consécutifs qui sont fériés. - -Dans cette hypothèse les dates de formation seraient : - -Mardi 22 avril (Vincent/Marc) -Mercredi 23 avril (Marc) - -Mardi 29 avril (Marc/Antoine) -Mercredi 30 avril (Antoine) - -Mardi 6 mai (Antoine) -Mercredi 7 mai (Antoine) - -Mardi 13 mai (Laurent) -Mercredi 14 mai (Laurent) - -J'ai mis entre parenthèse les intervenants principaux (on doit choisir le deuxième formateur pour chaque session). - -Qu'en pensez-vous ? - -Je dois toujours présenter un programme, pouvez-vous me donner vos programmes respectifs...? - - -Laurent diff --git a/bench/btl/libs/C/C_interface.hh b/bench/btl/libs/C/C_interface.hh index b688f18fa..d6092517d 100755 --- a/bench/btl/libs/C/C_interface.hh +++ b/bench/btl/libs/C/C_interface.hh @@ -33,12 +33,33 @@ public : static inline std::string name() { return "C"; } static inline void matrix_vector_product(const gene_matrix & A, const gene_vector & B, gene_vector & X, int N) + { +// for (int i=0;i > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MV,MAX_MV,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); diff --git a/bench/btl/libs/C_BLAS/CMakeLists.txt b/bench/btl/libs/C_BLAS/CMakeLists.txt index 9654bf8ad..73e5cc46b 100644 --- a/bench/btl/libs/C_BLAS/CMakeLists.txt +++ b/bench/btl/libs/C_BLAS/CMakeLists.txt @@ -1,4 +1,20 @@ -include_directories(${CBLAS_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77) -btl_add_bench(btl_cblas main.cpp) -target_link_libraries(btl_cblas ${CBLAS_LIBRARIES}) +find_package(CBLAS) +if (CBLAS_FOUND) + include_directories(${CBLAS_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77) + btl_add_bench(btl_cblas main.cpp) + if(BUILD_btl_cblas) + target_link_libraries(btl_cblas ${CBLAS_LIBRARIES}) + set_target_properties(btl_cblas PROPERTIES COMPILE_FLAGS "-DCBLASNAME=ATLAS") + endif(BUILD_btl_cblas) +endif (CBLAS_FOUND) + +find_package(MKL) +if (MKL_FOUND) + include_directories(${MKL_INCLUDES} ${PROJECT_SOURCE_DIR}/libs/f77) + btl_add_bench(btl_mkl main.cpp) + if(BUILD_btl_mkl) + target_link_libraries(btl_mkl ${MKL_LIBRARIES}) + set_target_properties(btl_mkl PROPERTIES COMPILE_FLAGS "-DCBLASNAME=INTEL_MKL") + endif(BUILD_btl_mkl) +endif (MKL_FOUND) diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh index e637c0e5e..eadbf0dd2 100644 --- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh +++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh @@ -27,6 +27,9 @@ extern "C" #include "cblas.h" } +#define MAKE_STRING2(S) #S +#define MAKE_STRING(S) MAKE_STRING2(S) + template class C_BLAS_interface : public f77_interface_base { @@ -37,7 +40,7 @@ public : static inline std::string name( void ) { - return "C_BLAS"; + return MAKE_STRING(CBLASNAME); } static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) @@ -84,7 +87,7 @@ public : static inline std::string name( void ) { - return "C_BLAS"; + return MAKE_STRING(CBLASNAME); } static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp index 97a0c6ca1..bef5d30be 100644 --- a/bench/btl/libs/C_BLAS/main.cpp +++ b/bench/btl/libs/C_BLAS/main.cpp @@ -22,6 +22,7 @@ #include "bench.hh" #include "action_matrix_vector_product.hh" #include "action_matrix_matrix_product.hh" +#include "action_atv_product.hh" #include "action_axpy.hh" #include "action_lu_solve.hh" #include "action_ata_product.hh" @@ -36,6 +37,8 @@ int main() bench > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); diff --git a/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_LU_solve_interface.hh b/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_LU_solve_interface.hh deleted file mode 100644 index 616ab4720..000000000 --- a/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_LU_solve_interface.hh +++ /dev/null @@ -1,127 +0,0 @@ -//===================================================== -// File : INTEL_BLAS_LU_solve_interface.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:29 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef INTEL_BLAS_LU_solve_interface_HH -#define INTEL_BLAS_LU_solve_interface_HH -#include "INTEL_BLAS_interface.hh" -extern "C" -{ -// void dgetrf_(int *M, int *N, double *A, int *LDA, int *IPIV, int *INFO); -// void dgetrs_(char *TRANS, int *N, int *NRHS, double *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO); -// void sgetrf_(int *M, int *N, float *A, int *LDA, int *IPIV, int *INFO); -// void sgetrs_(char *TRANS, int *N, int *NRHS, float *A, int *LDA, int *IPIV, double *B, int *LDB, int *INFO); -#include "mkl_lapack.h" - -} - -template -class INTEL_BLAS_LU_solve_interface : public INTEL_BLAS_interface -{ -public : - - typedef typename INTEL_BLAS_interface::gene_matrix gene_matrix; - typedef typename INTEL_BLAS_interface::gene_vector gene_vector; - - typedef int * Pivot_Vector; - - inline static void new_Pivot_Vector(Pivot_Vector & pivot, int N) - { - - pivot = new int[N]; - - } - - inline static void free_Pivot_Vector(Pivot_Vector & pivot) - { - - delete pivot; - - } - - - inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N) - { - - int info; - DGETRF(&N,&N,LU,&N,pivot,&info); - - } - - inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, const gene_vector &B, gene_vector X, int N) - { - int info; - int one=1; - - char * transpose="N"; - - copy_vector(B,X,N); - DGETRS(transpose,&N,&one,LU,&N,pivot,X,&N,&info); - - } - -}; - -template<> -class INTEL_BLAS_LU_solve_interface : public INTEL_BLAS_interface -{ -public : - - typedef int * Pivot_Vector; - - inline static void new_Pivot_Vector(Pivot_Vector & pivot, int N) - { - - pivot = new int[N]; - - } - - inline static void free_Pivot_Vector(Pivot_Vector & pivot) - { - - delete pivot; - - } - - - inline static void LU_factor(gene_matrix & LU, Pivot_Vector & pivot, int N) - { - - int info; - SGETRF(&N,&N,LU,&N,pivot,&info); - - } - - inline static void LU_solve(const gene_matrix & LU, const Pivot_Vector pivot, const gene_vector &B, gene_vector X, int N) - { - - char * transpose="N"; - int info; - int one=1; - copy_vector(B,X,N); - SGETRS(transpose,&N,&one,LU,&N,pivot,X,&N,&info); - - } - -}; - - -#endif - - - diff --git a/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_interface.hh b/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_interface.hh deleted file mode 100644 index 778aaf8b1..000000000 --- a/bench/btl/libs/INTEL_BLAS/INTEL_BLAS_interface.hh +++ /dev/null @@ -1,95 +0,0 @@ -//===================================================== -// File : INTEL_BLAS_interface.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:29 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef INTEL_BLAS_PRODUIT_MATRICE_VECTEUR_HH -#define INTEL_BLAS_PRODUIT_MATRICE_VECTEUR_HH -#include "f77_interface.hh" -extern "C" -{ -#include "mkl_cblas.h" -} - -template -class INTEL_BLAS_interface : public f77_interface_base -{ -public : - - typedef typename f77_interface_base::gene_matrix gene_matrix; - typedef typename f77_interface_base::gene_vector gene_vector; - - static inline std::string name( void ) { return "INTEL_BLAS"; } - - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) { - cblas_dgemv(CblasColMajor,CblasNoTrans,N,N,1.0,A,N,B,1,0.0,X,1); - } - - static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) { - cblas_dgemm(CblasColMajor,CblasNoTrans,CblasNoTrans,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 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); - } - - static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N) { - cblas_daxpy(N,coef,X,1,Y,1); - } - -}; - -template<> -class INTEL_BLAS_interface : public f77_interface_base -{ -public : - - static inline std::string name() { return "INTEL_BLAS"; } - - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) { - // cblas_sgemv(CblasNoTrans,N,N,1.0,A,N,B,1,0.0,X,1); - cblas_sgemv(CblasColMajor,CblasNoTrans,N,N,1.0,A,N,B,1,0.0,X,1); - - } - - static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) { - cblas_sgemm(CblasColMajor,CblasNoTrans,CblasNoTrans,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_sgemm(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_sgemm(CblasColMajor,CblasNoTrans,CblasTrans,N,N,N,1.0,A,N,A,N,0.0,X,N); - } - - static inline void axpy(float coef, const gene_vector & X, gene_vector & Y, int N) { - cblas_saxpy(N,coef,X,1,Y,1); - } - -}; - - -#endif - - - diff --git a/bench/btl/libs/INTEL_BLAS/config.sh b/bench/btl/libs/INTEL_BLAS/config.sh deleted file mode 100755 index 0ba48fe90..000000000 --- a/bench/btl/libs/INTEL_BLAS/config.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/bash -export LD_LIBRARY_PATH=/opt/intel/mkl/lib/32:${LD_LIBRARY_PATH} diff --git a/bench/btl/libs/INTEL_BLAS/main.cpp b/bench/btl/libs/INTEL_BLAS/main.cpp deleted file mode 100644 index b91d93470..000000000 --- a/bench/btl/libs/INTEL_BLAS/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -//===================================================== -// File : main.cpp -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:29 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#include "utilities.h" -#include "INTEL_BLAS_interface.hh" -#include "INTEL_BLAS_LU_solve_interface.hh" -#include "bench.hh" -#include "action_matrix_vector_product.hh" -#include "action_matrix_matrix_product.hh" -#include "action_axpy.hh" -#include "action_lu_solve.hh" -#include "action_ata_product.hh" -#include "action_aat_product.hh" - -int main() -{ - - bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); - - bench > >(MIN_MV,MAX_MV,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - -// bench > >(MIN_LU,MAX_LU,NB_POINT); - - return 0; -} - - diff --git a/bench/btl/libs/blitz/CMakeLists.txt b/bench/btl/libs/blitz/CMakeLists.txt index 1cb71c36d..880ab7338 100644 --- a/bench/btl/libs/blitz/CMakeLists.txt +++ b/bench/btl/libs/blitz/CMakeLists.txt @@ -1,4 +1,17 @@ -include_directories(${BLITZ_INCLUDES}) -btl_add_bench(btl_blitz main.cpp) -target_link_libraries(btl_blitz ${BLITZ_LIBRARIES}) +find_package(Blitz) + +if (BLITZ_FOUND) + include_directories(${BLITZ_INCLUDES}) + + btl_add_bench(btl_blitz btl_blitz.cpp) + if (BUILD_btl_blitz) + target_link_libraries(btl_blitz ${BLITZ_LIBRARIES}) + endif (BUILD_btl_blitz) + + 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 (BLITZ_FOUND) diff --git a/bench/btl/libs/blitz/btl_blitz.cpp b/bench/btl/libs/blitz/btl_blitz.cpp new file mode 100644 index 000000000..16d2b5951 --- /dev/null +++ b/bench/btl/libs/blitz/btl_blitz.cpp @@ -0,0 +1,51 @@ +//===================================================== +// File : main.cpp +// Author : L. Plagne +// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include "blitz_interface.hh" +#include "blitz_LU_solve_interface.hh" +#include "bench.hh" +#include "action_matrix_vector_product.hh" +#include "action_matrix_matrix_product.hh" +#include "action_axpy.hh" +#include "action_lu_solve.hh" +#include "action_ata_product.hh" +#include "action_aat_product.hh" +#include "action_atv_product.hh" + +BTL_MAIN; + +int main() +{ + + bench > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MV,MAX_MV,NB_POINT); + + bench > >(MIN_MM,MAX_MM,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); + + bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); + + //bench > >(MIN_LU,MAX_LU,NB_POINT); + + return 0; +} + + diff --git a/bench/btl/libs/blitz/btl_tiny_blitz.cpp b/bench/btl/libs/blitz/btl_tiny_blitz.cpp new file mode 100644 index 000000000..eff3c1881 --- /dev/null +++ b/bench/btl/libs/blitz/btl_tiny_blitz.cpp @@ -0,0 +1,39 @@ +//===================================================== +// File : main.cpp +// Author : L. Plagne +// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include "tiny_blitz_interface.hh" +#include "static/bench_static.hh" +#include "action_matrix_vector_product.hh" +#include "action_matrix_matrix_product.hh" +#include "action_axpy.hh" +#include "timers/x86_perf_analyzer.hh" + +BTL_MAIN; + +int main() +{ + bench_static(); + bench_static(); + bench_static(); + + return 0; +} + + diff --git a/bench/btl/libs/blitz/main.cpp b/bench/btl/libs/blitz/main.cpp deleted file mode 100644 index 16d2b5951..000000000 --- a/bench/btl/libs/blitz/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===================================================== -// File : main.cpp -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#include "utilities.h" -#include "blitz_interface.hh" -#include "blitz_LU_solve_interface.hh" -#include "bench.hh" -#include "action_matrix_vector_product.hh" -#include "action_matrix_matrix_product.hh" -#include "action_axpy.hh" -#include "action_lu_solve.hh" -#include "action_ata_product.hh" -#include "action_aat_product.hh" -#include "action_atv_product.hh" - -BTL_MAIN; - -int main() -{ - - bench > >(MIN_MV,MAX_MV,NB_POINT); - bench > >(MIN_MV,MAX_MV,NB_POINT); - - bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); - - bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); - - //bench > >(MIN_LU,MAX_LU,NB_POINT); - - return 0; -} - - diff --git a/bench/btl/libs/blitz/tiny_blitz_interface.hh b/bench/btl/libs/blitz/tiny_blitz_interface.hh new file mode 100644 index 000000000..6b26db72d --- /dev/null +++ b/bench/btl/libs/blitz/tiny_blitz_interface.hh @@ -0,0 +1,106 @@ +//===================================================== +// File : tiny_blitz_interface.hh +// Author : L. Plagne +// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#ifndef TINY_BLITZ_INTERFACE_HH +#define TINY_BLITZ_INTERFACE_HH + +#include "blitz/array.h" +#include "blitz/tiny.h" +#include "blitz/tinymat.h" +#include "blitz/tinyvec.h" +#include + +#include + +BZ_USING_NAMESPACE(blitz) + +template +class tiny_blitz_interface +{ + +public : + + typedef real real_type ; + + typedef std::vector stl_vector; + typedef std::vector stl_matrix; + + typedef TinyVector gene_vector; + typedef TinyMatrix gene_matrix; + + static inline std::string name() { return "tiny_blitz"; } + + static void free_matrix(gene_matrix & A, int N){} + + static void free_vector(gene_vector & B){} + + static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ + for (int j=0; j +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include "eigen2_interface.hh" +#include "static/bench_static.hh" +#include "action_matrix_vector_product.hh" +#include "action_matrix_matrix_product.hh" +#include "action_axpy.hh" +#include "action_lu_solve.hh" +#include "action_ata_product.hh" +#include "action_aat_product.hh" +#include "action_atv_product.hh" + +BTL_MAIN; + +int main() +{ + + bench_static(); + bench_static(); + bench_static(); + bench_static(); + + return 0; +} + + diff --git a/bench/btl/libs/eigen2/main.cpp b/bench/btl/libs/eigen2/main.cpp index dbd6a1764..7f96c8476 100644 --- a/bench/btl/libs/eigen2/main.cpp +++ b/bench/btl/libs/eigen2/main.cpp @@ -33,7 +33,7 @@ int main() bench > >(MIN_MV,MAX_MV,NB_POINT); bench > >(MIN_MV,MAX_MV,NB_POINT); -// bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); + bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); // bench > >(MIN_MM,MAX_MM,NB_POINT); // bench > >(MIN_MM,MAX_MM,NB_POINT); // bench > >(MIN_MM,MAX_MM,NB_POINT); diff --git a/bench/btl/libs/f77/f77_interface.hh b/bench/btl/libs/f77/f77_interface.hh index 0208b42c2..c8c8ee3a1 100644 --- a/bench/btl/libs/f77/f77_interface.hh +++ b/bench/btl/libs/f77/f77_interface.hh @@ -1,14 +1,14 @@ //===================================================== // File : f77_interface.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:24 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef F77_INTERFACE_HH #define F77_INTERFACE_HH #include "f77_interface_base.hh" @@ -55,39 +55,31 @@ public : static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) { - dmxv_(A,&N,B,&N,X); - } static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) { - dmxm_(A,&N,B,&N,X,&N); - } static inline void ata_product(gene_matrix & A, gene_matrix & X, int N) { - data_(A,X,&N); - } static inline void aat_product(gene_matrix & A, gene_matrix & X, int N) { - daat_(A,X,&N); - } - - static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N) + + static inline void axpy(real coef, const gene_vector & X, gene_vector & Y, int N) { int one=1; daxpy_(&N,&coef,X,Y); } - + }; @@ -104,34 +96,26 @@ public : static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) { - smxv_(A,&N,B,&N,X); - } static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) { - smxm_(A,&N,B,&N,X,&N); - } static inline void ata_product(gene_matrix & A, gene_matrix & X, int N) { - sata_(A,X,&N); - } static inline void aat_product(gene_matrix & A, gene_matrix & X, int N) { - saat_(A,X,&N); - } - - static inline void axpy(float coef, const gene_vector & X, gene_vector & Y, int N) + + static inline void axpy(float coef, const gene_vector & X, gene_vector & Y, int N) { saxpy_(&N,&coef,X,Y); } diff --git a/bench/btl/libs/gmm/CMakeLists.txt b/bench/btl/libs/gmm/CMakeLists.txt index 98759e8b6..bc2586243 100644 --- a/bench/btl/libs/gmm/CMakeLists.txt +++ b/bench/btl/libs/gmm/CMakeLists.txt @@ -1,3 +1,6 @@ -include_directories(${GMM_INCLUDES}) -btl_add_bench(btl_gmm main.cpp) +find_package(GMM) +if (GMM_FOUND) + include_directories(${GMM_INCLUDES}) + btl_add_bench(btl_gmm main.cpp) +endif (GMM_FOUND) diff --git a/bench/btl/libs/hand_vec/CMakeLists.txt b/bench/btl/libs/hand_vec/CMakeLists.txt new file mode 100644 index 000000000..afab9140e --- /dev/null +++ b/bench/btl/libs/hand_vec/CMakeLists.txt @@ -0,0 +1,12 @@ +find_package(Eigen2) +if (EIGEN2_FOUND) + + include_directories(${EIGEN2_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/libs/f77) + btl_add_bench(btl_hand_vec main.cpp) + + btl_add_bench(btl_hand_peeling main.cpp) + if (BUILD_btl_hand_peeling) + set_target_properties(btl_hand_peeling PROPERTIES COMPILE_FLAGS "-DPEELING") + endif (BUILD_btl_hand_peeling) + +endif (EIGEN2_FOUND) \ No newline at end of file diff --git a/bench/btl/libs/hand_vec/hand_vec_interface.hh b/bench/btl/libs/hand_vec/hand_vec_interface.hh new file mode 100755 index 000000000..5291aac55 --- /dev/null +++ b/bench/btl/libs/hand_vec/hand_vec_interface.hh @@ -0,0 +1,238 @@ +//===================================================== +// File : hand_vec_interface.hh +// Copyright (C) 2008 Gael Guennebaud +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#ifndef HAND_VEC_INTERFACE_HH +#define HAND_VEC_INTERFACE_HH + +#include +#include "f77_interface.hh" + +using namespace Eigen; + +template +class hand_vec_interface : public f77_interface_base { + +public : + + typedef typename ei_packet_traits::type Packet; + static const int PacketSize = ei_packet_traits::size; + + typedef typename f77_interface_base::stl_matrix stl_matrix; + typedef typename f77_interface_base::stl_vector stl_vector; + typedef typename f77_interface_base::gene_matrix gene_matrix; + typedef typename f77_interface_base::gene_vector gene_vector; + + static void free_matrix(gene_matrix & A, int N){ + ei_aligned_free(A); + } + + static void free_vector(gene_vector & B){ + ei_aligned_free(B); + } + + static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ + int N = A_stl.size(); + A = ei_aligned_malloc(N*N); + for (int j=0;j(N); + for (int i=0;i0) + { + bool aligned = (iN % PacketSize) == 0; + if (aligned) + { + #ifdef PEELING + int ANP = (AN/(8*PacketSize))*8*PacketSize; + for (int j = 0;j0) + { + bool aligned = (iN % PacketSize) == 0; + if (aligned) + { + #ifdef PEELING + int ANP = (AN/(8*PacketSize))*8*PacketSize; + for (int j = 0;j0) + { + Packet pcoef = ei_pset1(coef); + #ifdef PEELING + int ANP = (AN/(8*PacketSize))*8*PacketSize; + for (int j = 0;j +// Copyright (C) EDF R&D, lun sep 30 14:23:23 CEST 2002 +//===================================================== +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +#include "utilities.h" +#include "bench.hh" +#include "hand_vec_interface.hh" +#include "action_matrix_vector_product.hh" +#include "action_atv_product.hh" +#include "action_matrix_matrix_product.hh" +#include "action_axpy.hh" +#include "action_ata_product.hh" +#include "action_aat_product.hh" +//#include "action_lu_solve.hh" +#include "timers/mixed_perf_analyzer.hh" + +BTL_MAIN; + +int main() +{ + + bench > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MV,MAX_MV,NB_POINT); +// bench > >(MIN_MM,MAX_MM,NB_POINT); +// bench > >(MIN_MM,MAX_MM,NB_POINT); +// bench > >(MIN_MM,MAX_MM,NB_POINT); + bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); + + + return 0; +} + + diff --git a/bench/btl/libs/mtl4/CMakeLists.txt b/bench/btl/libs/mtl4/CMakeLists.txt new file mode 100644 index 000000000..14b47a808 --- /dev/null +++ b/bench/btl/libs/mtl4/CMakeLists.txt @@ -0,0 +1,6 @@ + +find_package(MTL4) +if (MTL4_FOUND) + include_directories(${MTL4_INCLUDE_DIR}) + btl_add_bench(btl_mtl4 main.cpp) +endif (MTL4_FOUND) diff --git a/bench/btl/libs/mtl4/main.cpp b/bench/btl/libs/mtl4/main.cpp index 17b200a90..8cf1f6fa9 100644 --- a/bench/btl/libs/mtl4/main.cpp +++ b/bench/btl/libs/mtl4/main.cpp @@ -35,8 +35,8 @@ int main() bench > >(MIN_MV,MAX_MV,NB_POINT); bench > >(MIN_MV,MAX_MV,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); +// bench > >(MIN_MM,MAX_MM,NB_POINT); +// bench > >(MIN_MM,MAX_MM,NB_POINT); return 0; } diff --git a/bench/btl/libs/mtl4/mtl4_interface.hh b/bench/btl/libs/mtl4/mtl4_interface.hh index 73ff565fc..5beb936db 100644 --- a/bench/btl/libs/mtl4/mtl4_interface.hh +++ b/bench/btl/libs/mtl4/mtl4_interface.hh @@ -88,11 +88,11 @@ public : } static inline void ata_product(const gene_matrix & A, gene_matrix & X, int N){ - X = (trans(A)*A); +// X = (trans(A)*A); } static inline void aat_product(const gene_matrix & A, gene_matrix & X, int N){ - X = (A*trans(A)); +// X = (A*trans(A)); } static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ diff --git a/bench/btl/libs/tiny_blitz/CMakeLists.txt b/bench/btl/libs/tiny_blitz/CMakeLists.txt deleted file mode 100644 index e3e2625a7..000000000 --- a/bench/btl/libs/tiny_blitz/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -include_directories(${BLITZ_INCLUDES}) -btl_add_bench(btl_tiny_blitz main.cpp) -target_link_libraries(btl_tiny_blitz ${BLITZ_LIBRARIES}) diff --git a/bench/btl/libs/tiny_blitz/main.cpp b/bench/btl/libs/tiny_blitz/main.cpp deleted file mode 100644 index eff3c1881..000000000 --- a/bench/btl/libs/tiny_blitz/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//===================================================== -// File : main.cpp -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#include "utilities.h" -#include "tiny_blitz_interface.hh" -#include "static/bench_static.hh" -#include "action_matrix_vector_product.hh" -#include "action_matrix_matrix_product.hh" -#include "action_axpy.hh" -#include "timers/x86_perf_analyzer.hh" - -BTL_MAIN; - -int main() -{ - bench_static(); - bench_static(); - bench_static(); - - return 0; -} - - diff --git a/bench/btl/libs/tiny_blitz/tiny_blitz_interface.hh b/bench/btl/libs/tiny_blitz/tiny_blitz_interface.hh deleted file mode 100644 index 6b26db72d..000000000 --- a/bench/btl/libs/tiny_blitz/tiny_blitz_interface.hh +++ /dev/null @@ -1,106 +0,0 @@ -//===================================================== -// File : tiny_blitz_interface.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef TINY_BLITZ_INTERFACE_HH -#define TINY_BLITZ_INTERFACE_HH - -#include "blitz/array.h" -#include "blitz/tiny.h" -#include "blitz/tinymat.h" -#include "blitz/tinyvec.h" -#include - -#include - -BZ_USING_NAMESPACE(blitz) - -template -class tiny_blitz_interface -{ - -public : - - typedef real real_type ; - - typedef std::vector stl_vector; - typedef std::vector stl_matrix; - - typedef TinyVector gene_vector; - typedef TinyMatrix gene_matrix; - - static inline std::string name() { return "tiny_blitz"; } - - static void free_matrix(gene_matrix & A, int N){} - - static void free_vector(gene_vector & B){} - - static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ - for (int j=0; j