diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-07-28 17:10:34 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-07-28 17:10:34 +0200 |
commit | de8b7958958fe2a40719fd8e47bd9cace998bd2a (patch) | |
tree | 7446b569fafe9c9f73bf889c39a3b762470b01bf /bench/btl | |
parent | 7ed7ec64b543095d6f30139ff26706ad3ab1278c (diff) |
compilation fixes in BTL
Diffstat (limited to 'bench/btl')
-rw-r--r-- | bench/btl/actions/action_matrix_matrix_product.hh | 22 | ||||
-rw-r--r-- | bench/btl/libs/C_BLAS/C_BLAS_interface.hh | 3 | ||||
-rw-r--r-- | bench/btl/libs/C_BLAS/main.cpp | 4 | ||||
-rw-r--r-- | bench/btl/libs/eigen2/eigen2_interface.hh | 9 | ||||
-rw-r--r-- | bench/btl/libs/eigen2/main_adv.cpp | 4 |
5 files changed, 22 insertions, 20 deletions
diff --git a/bench/btl/actions/action_matrix_matrix_product.hh b/bench/btl/actions/action_matrix_matrix_product.hh index 048594c70..f65ee0529 100644 --- a/bench/btl/actions/action_matrix_matrix_product.hh +++ b/bench/btl/actions/action_matrix_matrix_product.hh @@ -110,19 +110,17 @@ public : void check_result( void ){ // calculation check - - Interface::matrix_to_stl(X,resu_stl); - - STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); - - typename Interface::real_type error= - STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); -// exit(1); + if (_size<200) + { + Interface::matrix_to_stl(X,resu_stl); + STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); + typename Interface::real_type error= + STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(1); + } } - } private : diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh index c85c4e818..e08c4aedc 100644 --- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh +++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh @@ -133,6 +133,7 @@ static char notrans = 'N'; static char trans = 'T'; static char nonunit = 'N'; static char lower = 'L'; +static char right = 'R'; static int intone = 1; template<> @@ -312,7 +313,7 @@ public : static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix & X, int N){ #ifdef PUREBLAS scopy_(&N, B, &intone, X, &intone); - strsv_(&lower, ¬rans, &nonunit, &N, L, &N, X, &intone); + strsm_(&right, &lower, ¬rans, &nonunit, &N, &N, &fone, L, &N, X, &N); #else cblas_scopy(N, B, 1, X, 1); cblas_strsm(CblasColMajor, CblasRight, CblasLower, CblasNoTrans, CblasNonUnit, N, N, 1, L, N, X, N); diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp index 81cac6c29..5c2f8a377 100644 --- a/bench/btl/libs/C_BLAS/main.cpp +++ b/bench/btl/libs/C_BLAS/main.cpp @@ -24,7 +24,7 @@ #include "action_cholesky.hh" #include "action_lu_decomp.hh" -#include "action_partial_lu_decomp.hh" +// #include "action_partial_lu_decomp.hh" #include "action_trisolve_matrix.hh" #ifdef HAS_LAPACK @@ -55,7 +55,7 @@ int main() #ifdef HAS_LAPACK bench<Action_lu_decomp<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - bench<Action_partial_lu_decomp<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); +// bench<Action_partial_lu_decomp<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_hessenberg<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_tridiagonalization<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); #endif diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh index 186a485cf..ffc800a8d 100644 --- a/bench/btl/libs/eigen2/eigen2_interface.hh +++ b/bench/btl/libs/eigen2/eigen2_interface.hh @@ -109,7 +109,7 @@ public : static inline void symv(const gene_matrix & A, const gene_vector & B, gene_vector & X, int N){ //X = (A.template marked<SelfAdjoint|LowerTriangular>() * B)/*.lazy()*/; - ei_product_selfadjoint_vector<real,0,LowerTriangularBit>(N,A.data(),N, B.data(), X.data()); + ei_product_selfadjoint_vector<real,0,LowerTriangularBit,false,false>(N,A.data(),N, B.data(), 1, X.data(), 1); } template<typename Dest, typename Src> static void triassign(Dest& dst, const Src& src) @@ -186,11 +186,14 @@ public : } static inline void trisolve_lower(const gene_matrix & L, const gene_vector& B, gene_vector& X, int N){ - X = L.template marked<LowerTriangular>().solveTriangular(B); + X = L.template triangularView<LowerTriangular>().solve(B); } static inline void trisolve_lower_matrix(const gene_matrix & L, const gene_matrix& B, gene_matrix& X, int N){ - X = L.template marked<LowerTriangular>().solveTriangular(B); +// X = L.template triangularView<LowerTriangular>().solve(B); + X = B; + ei_triangular_solve_matrix<real,ColMajor,ColMajor,LowerTriangular> + ::run(L.cols(), X.cols(), L.data(), L.stride(), X.data(), X.stride()); } static inline void cholesky(const gene_matrix & X, gene_matrix & C, int N){ diff --git a/bench/btl/libs/eigen2/main_adv.cpp b/bench/btl/libs/eigen2/main_adv.cpp index e6c7fe7cd..c3e5fac30 100644 --- a/bench/btl/libs/eigen2/main_adv.cpp +++ b/bench/btl/libs/eigen2/main_adv.cpp @@ -23,7 +23,7 @@ #include "action_cholesky.hh" #include "action_hessenberg.hh" #include "action_lu_decomp.hh" -#include "action_partial_lu_decomp.hh" +// #include "action_partial_lu_decomp.hh" BTL_MAIN; @@ -33,7 +33,7 @@ int main() bench<Action_trisolve_matrix<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_cholesky<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_lu_decomp<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - bench<Action_partial_lu_decomp<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); +// bench<Action_partial_lu_decomp<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_hessenberg<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); bench<Action_tridiagonalization<eigen2_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); |