in BTL: a specific bench/action can be selected at runtime, e.g.:

BTL_CONFIG="-a ata" ctest -V -R eigen
  run the all benchmarks having "ata" in their name for all
  libraries matching the regexp "eigen"
This commit is contained in:
Gael Guennebaud
2008-07-09 22:35:11 +00:00
parent c9b046d5d5
commit 7b4c6b8862
23 changed files with 415 additions and 122 deletions

View File

@@ -28,6 +28,8 @@
//#include "action_lu_solve.hh"
#include "timers/mixed_perf_analyzer.hh"
BTL_MAIN;
int main()
{

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -23,6 +23,8 @@
#include "action_atv_product.hh"
#include "action_axpy.hh"
BTL_MAIN;
int main()
{

View File

@@ -29,6 +29,8 @@
#include "action_aat_product.hh"
#include "action_atv_product.hh"
BTL_MAIN;
int main()
{

View File

@@ -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){

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -26,6 +26,8 @@
#include "action_aat_product.hh"
#include "action_atv_product.hh"
BTL_MAIN;
int main()
{

View File

@@ -26,6 +26,8 @@
#include "action_aat_product.hh"
#include "action_atv_product.hh"
BTL_MAIN;
int main()
{

View File

@@ -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>();

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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 matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N)
{
X=product(A,B);
static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){
cible = source;
}
static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & 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 axpy(const real coef, const gene_vector & X, gene_vector & Y, int N)
{
static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N){
X = prod(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){
Y+=coef*X;
}
};
#endif

View File

@@ -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);