diff options
Diffstat (limited to 'bench/btl/libs')
-rw-r--r-- | bench/btl/libs/C/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/C_BLAS/main.cpp | 19 | ||||
-rw-r--r-- | bench/btl/libs/STL/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/STL_algo/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/blitz/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/eigen2/eigen2_interface.hh | 2 | ||||
-rw-r--r-- | bench/btl/libs/eigen2/main.cpp | 15 | ||||
-rw-r--r-- | bench/btl/libs/f77/main.cpp | 17 | ||||
-rw-r--r-- | bench/btl/libs/gmm/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/mtl4/main.cpp | 2 | ||||
-rw-r--r-- | bench/btl/libs/tiny_blitz/main.cpp | 10 | ||||
-rw-r--r-- | bench/btl/libs/tvmet/CMakeLists.txt | 5 | ||||
-rw-r--r-- | bench/btl/libs/tvmet/main.cpp | 12 | ||||
-rw-r--r-- | bench/btl/libs/tvmet/tvmet_interface.hh | 115 | ||||
-rw-r--r-- | bench/btl/libs/ublas/main.cpp | 2 |
15 files changed, 95 insertions, 114 deletions
diff --git a/bench/btl/libs/C/main.cpp b/bench/btl/libs/C/main.cpp index b15b7d9d5..60ff2b4d6 100644 --- a/bench/btl/libs/C/main.cpp +++ b/bench/btl/libs/C/main.cpp @@ -28,6 +28,8 @@ //#include "action_lu_solve.hh" #include "timers/mixed_perf_analyzer.hh" +BTL_MAIN; + int main() { diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp index d88effa29..97a0c6ca1 100644 --- a/bench/btl/libs/C_BLAS/main.cpp +++ b/bench/btl/libs/C_BLAS/main.cpp @@ -1,14 +1,14 @@ //===================================================== // File : main.cpp -// Author : L. Plagne <laurent.plagne@edf.fr)> +// Author : L. Plagne <laurent.plagne@edf.fr)> // Copyright (C) EDF R&D, lun sep 30 14:23:28 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. -// +// #include "utilities.h" #include "C_BLAS_interface.hh" #include "bench.hh" @@ -27,22 +27,23 @@ #include "action_ata_product.hh" #include "action_aat_product.hh" +BTL_MAIN; int main() { - bench<Action_axpy<C_BLAS_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); + bench<Action_axpy<C_BLAS_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); - bench<Action_matrix_vector_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); + bench<Action_matrix_vector_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); - bench<Action_matrix_matrix_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,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_aat_product<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); //bench<Action_lu_solve<C_BLAS_LU_solve_interface<REAL_TYPE> > >(MIN_LU,MAX_LU,NB_POINT); - + return 0; } diff --git a/bench/btl/libs/STL/main.cpp b/bench/btl/libs/STL/main.cpp index dc2044320..4cb846633 100644 --- a/bench/btl/libs/STL/main.cpp +++ b/bench/btl/libs/STL/main.cpp @@ -28,6 +28,8 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { bench<Action_axpy<STL_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); diff --git a/bench/btl/libs/STL_algo/main.cpp b/bench/btl/libs/STL_algo/main.cpp index 8c8b60781..9ce2d947e 100644 --- a/bench/btl/libs/STL_algo/main.cpp +++ b/bench/btl/libs/STL_algo/main.cpp @@ -23,6 +23,8 @@ #include "action_atv_product.hh" #include "action_axpy.hh" +BTL_MAIN; + int main() { diff --git a/bench/btl/libs/blitz/main.cpp b/bench/btl/libs/blitz/main.cpp index 65fbb6b11..16d2b5951 100644 --- a/bench/btl/libs/blitz/main.cpp +++ b/bench/btl/libs/blitz/main.cpp @@ -29,6 +29,8 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh index 5d8ad9466..8c4270e8c 100644 --- a/bench/btl/libs/eigen2/eigen2_interface.hh +++ b/bench/btl/libs/eigen2/eigen2_interface.hh @@ -108,7 +108,7 @@ public : } static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ - X = (A*B).lazy(); + X = (A.transpose()*B).lazy(); } static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){ diff --git a/bench/btl/libs/eigen2/main.cpp b/bench/btl/libs/eigen2/main.cpp index d73a80768..dbd6a1764 100644 --- a/bench/btl/libs/eigen2/main.cpp +++ b/bench/btl/libs/eigen2/main.cpp @@ -18,7 +18,6 @@ #include "utilities.h" #include "eigen2_interface.hh" #include "bench.hh" -#include "static/bench_static.hh" #include "action_matrix_vector_product.hh" #include "action_matrix_matrix_product.hh" #include "action_axpy.hh" @@ -27,22 +26,20 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { bench<Action_matrix_vector_product<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); bench<Action_atv_product<eigen2_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); - bench<Action_axpy<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); - bench<Action_matrix_matrix_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - bench<Action_ata_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - bench<Action_aat_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); +// bench<Action_axpy<eigen2_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); +// bench<Action_matrix_matrix_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); +// bench<Action_ata_product<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); +// bench<Action_aat_product<eigen2_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); - bench_static<Action_axpy,eigen2_interface>(); - bench_static<Action_matrix_matrix_product,eigen2_interface>(); - bench_static<Action_matrix_vector_product,eigen2_interface>(); - return 0; } diff --git a/bench/btl/libs/f77/main.cpp b/bench/btl/libs/f77/main.cpp index 17934fb25..a4b67b487 100644 --- a/bench/btl/libs/f77/main.cpp +++ b/bench/btl/libs/f77/main.cpp @@ -1,14 +1,14 @@ //===================================================== // File : main.cpp -// Author : L. Plagne <laurent.plagne@edf.fr)> +// Author : L. Plagne <laurent.plagne@edf.fr)> // Copyright (C) EDF R&D, lun sep 30 14:23:25 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. -// +// #include "utilities.h" #include "f77_interface.hh" #include "bench.hh" @@ -27,17 +27,18 @@ #include "action_ata_product.hh" #include "action_aat_product.hh" +BTL_MAIN; int main() { - bench<Action_axpy<f77_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); + bench<Action_axpy<f77_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); - bench<Action_matrix_vector_product<f77_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); + bench<Action_matrix_vector_product<f77_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); - bench<Action_matrix_matrix_product<f77_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); + bench<Action_matrix_matrix_product<f77_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_ata_product<f77_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - + bench<Action_aat_product<f77_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); return 0; diff --git a/bench/btl/libs/gmm/main.cpp b/bench/btl/libs/gmm/main.cpp index 27afeedbb..a05fd1b46 100644 --- a/bench/btl/libs/gmm/main.cpp +++ b/bench/btl/libs/gmm/main.cpp @@ -26,6 +26,8 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { diff --git a/bench/btl/libs/mtl4/main.cpp b/bench/btl/libs/mtl4/main.cpp index 219570d28..17b200a90 100644 --- a/bench/btl/libs/mtl4/main.cpp +++ b/bench/btl/libs/mtl4/main.cpp @@ -26,6 +26,8 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { diff --git a/bench/btl/libs/tiny_blitz/main.cpp b/bench/btl/libs/tiny_blitz/main.cpp index 6675d3d1a..eff3c1881 100644 --- a/bench/btl/libs/tiny_blitz/main.cpp +++ b/bench/btl/libs/tiny_blitz/main.cpp @@ -1,14 +1,14 @@ //===================================================== // File : main.cpp -// Author : L. Plagne <laurent.plagne@edf.fr)> +// Author : L. Plagne <laurent.plagne@edf.fr)> // 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 @@ -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. -// +// #include "utilities.h" #include "tiny_blitz_interface.hh" #include "static/bench_static.hh" @@ -25,6 +25,8 @@ #include "action_axpy.hh" #include "timers/x86_perf_analyzer.hh" +BTL_MAIN; + int main() { bench_static<Action_axpy,tiny_blitz_interface>(); diff --git a/bench/btl/libs/tvmet/CMakeLists.txt b/bench/btl/libs/tvmet/CMakeLists.txt index e047b4e08..3e965069b 100644 --- a/bench/btl/libs/tvmet/CMakeLists.txt +++ b/bench/btl/libs/tvmet/CMakeLists.txt @@ -1,4 +1,3 @@ -include_directories(${BLITZ_INCLUDES}) -add_executable(btl_blitz main.cpp) -target_link_libraries(btl_blitz ${BLITZ_LIBRARIES}) +include_directories(${TVMET_INCLUDE_DIR}) +add_executable(btl_tvmet main.cpp) diff --git a/bench/btl/libs/tvmet/main.cpp b/bench/btl/libs/tvmet/main.cpp index 448c1a980..633215c43 100644 --- a/bench/btl/libs/tvmet/main.cpp +++ b/bench/btl/libs/tvmet/main.cpp @@ -1,14 +1,14 @@ //===================================================== // File : main.cpp -// Author : L. Plagne <laurent.plagne@edf.fr)> +// Author : L. Plagne <laurent.plagne@edf.fr)> // 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 @@ -16,19 +16,23 @@ // 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 "tvmet_interface.hh" #include "static/bench_static.hh" #include "action_matrix_vector_product.hh" #include "action_matrix_matrix_product.hh" +#include "action_atv_product.hh" #include "action_axpy.hh" +BTL_MAIN; + int main() { bench_static<Action_axpy,tvmet_interface>(); bench_static<Action_matrix_matrix_product,tvmet_interface>(); bench_static<Action_matrix_vector_product,tvmet_interface>(); + bench_static<Action_atv_product,tvmet_interface>(); return 0; } diff --git a/bench/btl/libs/tvmet/tvmet_interface.hh b/bench/btl/libs/tvmet/tvmet_interface.hh index dfbfa20aa..28aa35300 100644 --- a/bench/btl/libs/tvmet/tvmet_interface.hh +++ b/bench/btl/libs/tvmet/tvmet_interface.hh @@ -1,14 +1,14 @@ //===================================================== // File : tvmet_interface.hh -// Author : L. Plagne <laurent.plagne@edf.fr)> +// Author : L. Plagne <laurent.plagne@edf.fr)> // 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 @@ -16,10 +16,11 @@ // 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 TVMET_INTERFACE_HH #define TVMET_INTERFACE_HH +#include <tvmet/tvmet.h> #include <tvmet/Vector.h> #include <tvmet/Matrix.h> @@ -29,113 +30,75 @@ using namespace tvmet; template<class real, int SIZE> class tvmet_interface{ - + public : - + typedef real real_type ; typedef std::vector<real> stl_vector; typedef std::vector<stl_vector > stl_matrix; - + typedef Vector<real,SIZE> gene_vector; typedef Matrix<real,SIZE,SIZE> gene_matrix; - static inline std::string name( void ) - { - return "tvmet"; - } - - - static void free_matrix(gene_matrix & A, int N){ - - return ; - } - - static void free_vector(gene_vector & B){ - - return ; - - } - + static inline std::string name() { return "tvmet"; } + + 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 i=0; i<A_stl.size() ; i++){ - for (int j=0; j<A_stl[i].size() ; j++){ - A(i,j)=A_stl[i][j]; - } - - } + for (int j=0; j<A_stl.size() ; j++) + for (int i=0; i<A_stl[j].size() ; i++) + A(i,j) = A_stl[j][i]; } - + static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){ - - for (int i=0; i<B_stl.size() ; i++){ + for (int i=0; i<B_stl.size() ; i++) B[i]=B_stl[i]; - } } - + static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){ - for (int i=0; i<B_stl.size() ; i++){ B_stl[i]=B[i]; } } static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){ - - int N=A_stl.size(); - - for (int i=0;i<N;i++){ - A_stl[i].resize(N); - for (int j=0;j<N;j++){ - A_stl[i][j]=A(i,j); - } + int N = A_stl.size(); + for (int j=0;j<N;j++){ + A_stl[j].resize(N); + for (int i=0;i<N;i++) + A_stl[j][i] = A(i,j); } - } - static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N) - { - - for (int i=0;i<N;i++){ - for (int j=0;j<N;j++){ - cible(i,j)=source(i,j); - } - } - + static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N){ + cible = source; } - static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N) - { - - for (int i=0;i<N;i++){ - cible[i]=source[i]; - } - + static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){ + cible = source; } - - - - static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N) - { - X=product(A,B); + + static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N){ + X = prod(A,B); } + static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ + X = prod(A,B); + } - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) - { - X=product(A,B); - + static inline void atv_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){ + X = prod(trans(A),B); } - static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N) - { + static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N){ Y+=coef*X; } - }; - + #endif diff --git a/bench/btl/libs/ublas/main.cpp b/bench/btl/libs/ublas/main.cpp index 768010406..acc59364f 100644 --- a/bench/btl/libs/ublas/main.cpp +++ b/bench/btl/libs/ublas/main.cpp @@ -27,6 +27,8 @@ #include "action_aat_product.hh" #include "action_atv_product.hh" +BTL_MAIN; + int main() { bench<Action_axpy<ublas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); |