diff options
author | Andrea Arteaga <andyspiros@gmail.com> | 2012-10-16 00:17:37 +0200 |
---|---|---|
committer | Andrea Arteaga <andyspiros@gmail.com> | 2012-10-16 00:17:37 +0200 |
commit | 9b2b15a0a6c05ea3a6631be234713403b2c0a7aa (patch) | |
tree | 943c7065785295c043cf8ff965c46de4efe72c92 | |
parent | Added QRdecomp. Solved issue with constant A in LU and Cholesky. Solved (diff) | |
download | auto-numerical-bench-9b2b15a0a6c05ea3a6631be234713403b2c0a7aa.tar.gz auto-numerical-bench-9b2b15a0a6c05ea3a6631be234713403b2c0a7aa.tar.bz2 auto-numerical-bench-9b2b15a0a6c05ea3a6631be234713403b2c0a7aa.zip |
Updated LAPACK main program. Updated labels. Updated sample for LAPACK.
-rw-r--r-- | btl/actions/LAPACK/action_LUdecomp.hpp | 2 | ||||
-rw-r--r-- | btl/libs/BLAS/main.cpp | 7 | ||||
-rw-r--r-- | btl/libs/LAPACK/lapack.hh | 33 | ||||
-rw-r--r-- | btl/libs/LAPACK/lapack_.hh | 40 | ||||
-rw-r--r-- | btl/libs/LAPACK/lapack_interface.hh | 67 | ||||
-rw-r--r-- | btl/libs/LAPACK/lapack_interface_impl.hh | 141 | ||||
-rw-r--r-- | btl/libs/LAPACK/lapacke_interface_impl.hh | 112 | ||||
-rw-r--r-- | btl/libs/LAPACK/main.cpp | 111 | ||||
-rw-r--r-- | numbench/modules/internal/lapackBase.py | 10 | ||||
-rw-r--r-- | numbench/testdescr.py | 15 | ||||
-rw-r--r-- | samples/lapacktests.xml | 35 |
11 files changed, 76 insertions, 497 deletions
diff --git a/btl/actions/LAPACK/action_LUdecomp.hpp b/btl/actions/LAPACK/action_LUdecomp.hpp index 09a161e..1369017 100644 --- a/btl/actions/LAPACK/action_LUdecomp.hpp +++ b/btl/actions/LAPACK/action_LUdecomp.hpp @@ -76,7 +76,7 @@ public: Interface::TriMatrixMatrix('u', _size, _size, &A_work[0], &eye_work[0]); - // FIXME: hard-coded unitary diagonal + // Hard-coded unitary diagonal for (int r = 0; r < _size; ++r) A_work[r+_size*r] = 1.; diff --git a/btl/libs/BLAS/main.cpp b/btl/libs/BLAS/main.cpp index f4dc8fa..b25900e 100644 --- a/btl/libs/BLAS/main.cpp +++ b/btl/libs/BLAS/main.cpp @@ -16,6 +16,9 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // +#include <string> +#include <iostream> + // Include the numeric interface #ifdef NI_BLAS # define NI_FORTRAN @@ -32,8 +35,6 @@ typedef NumericInterface<double> Interface; // Include the operations #include "actionsBLAS.hpp" -#include <string> -#include <iostream> using namespace std; @@ -109,6 +110,6 @@ int main(int argv, char **argc) bench<Action_TriSolveMatrix<Interface> >(MIN_MM,MAX_MM, N); - return 0; + return 0; } diff --git a/btl/libs/LAPACK/lapack.hh b/btl/libs/LAPACK/lapack.hh deleted file mode 100644 index a6d46f1..0000000 --- a/btl/libs/LAPACK/lapack.hh +++ /dev/null @@ -1,33 +0,0 @@ -//===================================================== -// Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> -//===================================================== -// -// 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 LAPACK_HH -#define LAPACK_HH - -#define SCALAR float -#define SCALAR_PREFIX s -#include "lapack_.hh" -#undef SCALAR -#undef SCALAR_PREFIX - -#define SCALAR double -#define SCALAR_PREFIX d -#include "lapack_.hh" -#undef SCALAR -#undef SCALAR_PREFIX - -#endif /* LAPACK_HH */ diff --git a/btl/libs/LAPACK/lapack_.hh b/btl/libs/LAPACK/lapack_.hh deleted file mode 100644 index bc56dda..0000000 --- a/btl/libs/LAPACK/lapack_.hh +++ /dev/null @@ -1,40 +0,0 @@ -//===================================================== -// Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> -//===================================================== -// -// 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 CAT -# define CAT2(A,B) A##B -# define CAT(A,B) CAT2(A,B) -#endif -#define LAPACKFUNC(NAME) CAT(CAT(SCALAR_PREFIX,NAME),_) - -#ifdef __cplusplus -extern "C" { -#endif - -void LAPACKFUNC(getrf)(const int*, const int*, SCALAR*, const int*, int*, int*); -void LAPACKFUNC(potrf)(const char*, const int*, SCALAR*, const int*, int*); -void LAPACKFUNC(geqrf)(const int*, const int*, SCALAR*, const int*, SCALAR*, SCALAR*, const int*, int*); -void LAPACKFUNC(gesvd)(const char*, const char*, const int*, const int*, SCALAR*, const int*, SCALAR*, SCALAR*, const int*, SCALAR*, const int*, SCALAR*, const int*, int*); -void LAPACKFUNC(syev)(const char*, const char*, const int*, SCALAR*, const int*, SCALAR*, SCALAR*, const int*, int*); -void LAPACKFUNC(stev)(const char*, const int*, SCALAR*, SCALAR*, SCALAR*, const int*, SCALAR*, int*); - -void LAPACKFUNC(gels)(char*, int*, int*, int*, SCALAR*, int*, SCALAR*, int*, SCALAR*, int*, int*); - -#ifdef __cplusplus -} -#endif - diff --git a/btl/libs/LAPACK/lapack_interface.hh b/btl/libs/LAPACK/lapack_interface.hh deleted file mode 100644 index 87b3cbb..0000000 --- a/btl/libs/LAPACK/lapack_interface.hh +++ /dev/null @@ -1,67 +0,0 @@ -//===================================================== -// Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> -//===================================================== -// -// 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 LAPACK_INTERFACE_HH -#define LAPACK_INTERFACE_HH - -#include <../BLAS/c_interface_base.h> -#include <complex> -//#include "lapack.hh" - - -#define MAKE_STRING2(S) #S -#define MAKE_STRING(S) MAKE_STRING2(S) - -#ifndef CAT -# define CAT2(A,B) A##B -# define CAT(A,B) CAT2(A,B) -#endif - -template <typename real> class lapack_interface; - - -static char notrans = 'N'; -static char trans = 'T'; -static char nonunit = 'N'; -static char lower = 'L'; -static char right = 'R'; -static char left = 'L'; -static int intone = 1; -static int zeroint = 0; - - -#define SCALAR float -#define SCALAR_PREFIX s -#ifdef LAPACKE_INTERFACE -# include "lapacke_interface_impl.hh" -#else -# include "lapack_interface_impl.hh" -#endif -#undef SCALAR -#undef SCALAR_PREFIX - -#define SCALAR double -#define SCALAR_PREFIX d -#ifdef LAPACKE_INTERFACE -# include "lapacke_interface_impl.hh" -#else -# include "lapack_interface_impl.hh" -#endif -#undef SCALAR -#undef SCALAR_PREFIX - -#endif /* LAPACK_INTERFACE_HH */ diff --git a/btl/libs/LAPACK/lapack_interface_impl.hh b/btl/libs/LAPACK/lapack_interface_impl.hh deleted file mode 100644 index 523e53a..0000000 --- a/btl/libs/LAPACK/lapack_interface_impl.hh +++ /dev/null @@ -1,141 +0,0 @@ -//===================================================== -// Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> -//===================================================== -// -// 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. -// -#define LAPACKFUNC(NAME) CAT(CAT(SCALAR_PREFIX,NAME),_) - -#include "lapack_.hh" -#include "blas.h" - -template<> class lapack_interface<SCALAR> : public c_interface_base<SCALAR> -{ -public: - - static inline std::string name() - { - return MAKE_STRING(LAPACKNAME); - } - - static inline void general_solve(gene_matrix& A, gene_vector& b, gene_vector& x, int N) - { - int *ipiv = new int[N]; - int info; - LAPACKFUNC(copy)(&N, b, &intone, x, &intone); - LAPACKFUNC(gesv)(&N, &intone, A, &N, ipiv, x, &N, &info); - delete[] ipiv; - } - - static inline void least_squares(gene_matrix& A, gene_vector& b, gene_vector& x, int N) - { - int *ipiv = new int[N]; - int info; - LAPACKFUNC(copy)(&N, b, &intone, x, &intone); - SCALAR work1; - int MONE = -1; - LAPACKFUNC(gels)(¬rans, &N, &N, &intone, A, &N, x, &N, &work1, &MONE, &info); - int lwork = (int)work1; - SCALAR *work2 = new SCALAR[lwork]; - LAPACKFUNC(gels)(¬rans, &N, &N, &intone, A, &N, x, &N, work2, &lwork, &info); - delete[] work2; - delete[] ipiv; - } - - static inline void lu_decomp(const gene_matrix& X, gene_matrix& C, int N) - { - int N2 = N*N; - int *ipiv = new int[N]; - int info; - LAPACKFUNC(copy)(&N2, X, &intone, C, &intone); - LAPACKFUNC(getrf)(&N, &N, C, &N, ipiv, &info); - delete[] ipiv; - } - - static inline void cholesky(const gene_matrix& X, gene_matrix& C, int N) - { - int N2 = N*N; - int info; - LAPACKFUNC(copy)(&N2, X, &intone, C, &intone); - LAPACKFUNC(potrf)(&lower, &N, C, &N, &info); - } - - static inline void qr_decomp(const gene_matrix& X, gene_matrix& QR, gene_vector& tau, const int& N) - { - int N2 = N*N; - LAPACKFUNC(copy)(&N2, X, &intone, QR, &intone); - - SCALAR *work = new SCALAR; - int lwork = -1, info; - LAPACKFUNC(geqrf)(&N, &N, QR, &N, tau, work, &lwork, &info); - lwork = *work; - delete work; - work = new SCALAR[lwork]; - LAPACKFUNC(geqrf)(&N, &N, QR, &N, tau, work, &lwork, &info); - delete[] work; - } - - static inline void svd_decomp(const gene_matrix& X, gene_matrix& U, gene_vector& S, gene_matrix& VT, const int& N) - { - int N2 = N*N; - stl_vector Xcopy(N2); - LAPACKFUNC(copy)(&N2, X, &intone, &Xcopy[0], &intone); - - stl_vector work(1); - int lwork = -1, info; - LAPACKFUNC(gesvd)("A", "A", &N, &N, &Xcopy[0], &N, S, U, &N, VT, &N, &work[0], &lwork, &info); - lwork = work[0]; - work.resize(lwork); - LAPACKFUNC(gesvd)("A", "A", &N, &N, &Xcopy[0], &N, S, U, &N, VT, &N, &work[0], &lwork, &info); - } - - static inline void syev(const gene_matrix& X, gene_matrix& V, gene_vector& W, const int& N) - { - int N2 = N*N; - LAPACKFUNC(copy)(&N2, X, &intone, V, &intone); - - stl_vector work(1); - int lwork = -1, info; - LAPACKFUNC(syev)("V", "U", &N, V, &N, W, &work[0], &lwork, &info); - lwork = work[0]; - work.resize(lwork); - LAPACKFUNC(syev)("V", "U", &N, V, &N, W, &work[0], &lwork, &info); - } - - /* Size of D, W: N; size of E: N-1, size of V: NxN */ - static inline void stev(const gene_vector& D, const gene_vector& E, gene_vector& W, gene_matrix& V, const int& N) - { - int N0 = N; - LAPACKFUNC(copy)(&N0, D, &intone, W, &intone); - stl_vector E_(E, E+N-1), work(max(1, 2*N-2)); - - int info; - LAPACKFUNC(stev)("V", &N, W, &E_[0], V, &N, &work[0], &info); - } - - static inline void symm_ev(const gene_matrix& X, gene_vector& W, int N) - { - char jobz = 'N'; - SCALAR *work = new SCALAR; - int lwork = -1, info; - LAPACKFUNC(syev)(&jobz, &lower, &N, X, &N, W, work, &lwork, &info); - lwork = *work; - delete work; - work = new SCALAR[lwork]; - LAPACKFUNC(syev)(&jobz, &lower, &N, X, &N, W, work, &lwork, &info); - delete[] work; - } - - -}; diff --git a/btl/libs/LAPACK/lapacke_interface_impl.hh b/btl/libs/LAPACK/lapacke_interface_impl.hh deleted file mode 100644 index 410f5c8..0000000 --- a/btl/libs/LAPACK/lapacke_interface_impl.hh +++ /dev/null @@ -1,112 +0,0 @@ -//===================================================== -// Copyright (C) 2012 Andrea Arteaga <andyspiros@gmail.com> -//===================================================== -// -// 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. -// -#define LAPACKEFUNC(NAME) CAT(LAPACKE_,CAT(SCALAR_PREFIX,NAME)) -#define BLASFUNC(NAME) CAT(CAT(SCALAR_PREFIX,NAME),_) - -//#include "lapacke.h" - - -#define LAPACK_ROW_MAJOR 101 -#define LAPACK_COL_MAJOR 102 - -// Define BLAS functions used by LAPACKE interface -extern "C" { - int BLASFUNC(copy) (int *, SCALAR*, int *, SCALAR*, int *); - - int LAPACKEFUNC(gesv)(int, int, int, const SCALAR*, int, int*, SCALAR*, int); - int LAPACKEFUNC(gels)(int, char, int, int, int, SCALAR*, int, SCALAR*, int); - int LAPACKEFUNC(getrf)(int, int, int, SCALAR*, int, int*); - int LAPACKEFUNC(potrf)(int, char, int, SCALAR*, int); - int LAPACKEFUNC(geqrf)(int, int, int, SCALAR*, int, SCALAR*); - int LAPACKEFUNC(gesvd)(int, char, char, int, int, SCALAR*, int, SCALAR*, SCALAR*, int, SCALAR*, int, SCALAR*); - int LAPACKEFUNC(syev)(int, char, char, int, SCALAR*, int, SCALAR*); - int LAPACKEFUNC(stev)(int, char, int, SCALAR*, SCALAR*, SCALAR*, int); -} - -template<> class lapack_interface<SCALAR> : public c_interface_base<SCALAR> -{ -public: - - static inline std::string name() - { - return MAKE_STRING(LAPACKNAME); - } - - static inline void general_solve(gene_matrix& A, gene_vector& b, gene_vector& x, int N) - { - std::vector<int> ipiv(N); - BLASFUNC(copy)(&N, b, &intone, x, &intone); - LAPACKEFUNC(gesv)(LAPACK_COL_MAJOR, N, 1, A, N, &ipiv[0], x, N); - } - - static inline void least_squares(gene_matrix& A, gene_vector& b, gene_vector& x, int N) - { - BLASFUNC(copy)(&N, b, &intone, x, &intone); - LAPACKEFUNC(gels)(LAPACK_COL_MAJOR, 'N', N, N, 1, A, N, x, N); - } - - static inline void lu_decomp(const gene_matrix& X, gene_matrix& C, int N) - { - int N2 = N*N; - std::vector<int> ipiv(N); - BLASFUNC(copy)(&N2, X, &intone, C, &intone); - LAPACKEFUNC(getrf)(LAPACK_COL_MAJOR, N, N, C, N, &ipiv[0]); - } - - static inline void cholesky(const gene_matrix& X, gene_matrix& C, int N) - { - int N2 = N*N; - BLASFUNC(copy)(&N2, X, &intone, C, &intone); - LAPACKEFUNC(potrf)(LAPACK_COL_MAJOR, 'L', N, C, N); - } - - static inline void qr_decomp(const gene_matrix& X, gene_matrix& QR, gene_vector& tau, const int& N) - { - int N2 = N*N; - BLASFUNC(copy)(&N2, X, &intone, QR, &intone); - LAPACKEFUNC(geqrf)(LAPACK_COL_MAJOR, N, N, QR, N, tau); - } - - static inline void svd_decomp(const gene_matrix& X, gene_matrix& U, gene_vector& S, gene_matrix& VT, const int& N) - { - int N2 = N*N; - stl_vector Xcopy(N2), superb(N-1); - BLASFUNC(copy)(&N2, X, &intone, &Xcopy[0], &intone); - LAPACKEFUNC(gesvd)(LAPACK_COL_MAJOR, 'A', 'A', N, N, &Xcopy[0], N, S, U, N, VT, N, &superb[0]); - } - - static inline void syev(const gene_matrix& X, gene_matrix& V, gene_vector& W, const int& N) - { - int N2 = N*N; - BLASFUNC(copy)(&N2, X, &intone, V, &intone); - LAPACKEFUNC(syev)(LAPACK_COL_MAJOR, 'V', 'U', N, V, N, W); - } - - /* Size of D, W: N; size of E: N-1, size of V: NxN */ - static inline void stev(const gene_vector& D, const gene_vector& E, gene_vector& W, gene_matrix& V, int N) - { - stl_vector E_(E, E+N-1); - BLASFUNC(copy)(&N, D, &intone, W, &intone); - LAPACKEFUNC(stev)(LAPACK_COL_MAJOR, 'V', N, W, &E_[0], V, N); - } - - static inline void symm_ev(const gene_matrix& X, gene_vector& W, int N) - { - LAPACKEFUNC(syev)(LAPACK_COL_MAJOR, 'N', 'L', N, X, N, W); - } -}; diff --git a/btl/libs/LAPACK/main.cpp b/btl/libs/LAPACK/main.cpp index 78f314a..8196619 100644 --- a/btl/libs/LAPACK/main.cpp +++ b/btl/libs/LAPACK/main.cpp @@ -1,5 +1,5 @@ //===================================================== -// Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com> +// Copyright (C) 2012 Andrea Arteaga <andyspiros@gmail.com> //===================================================== // // This program is free software; you can redistribute it and/or @@ -15,81 +15,74 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // -#include <btl.hh> -#include <bench.hh> -#include <action_general_solve.hh> -#include <action_least_squares.hh> -#include <action_lu_decomp.hh> -#include <action_cholesky.hh> -#include <action_qr_decomp.hh> -#include <action_svd_decomp.hh> -#include <action_syev.hh> -#include <action_stev.hh> -#include <action_symm_ev.hh> -#include <lapack_interface.hh> #include <string> -#include <cstdlib> +#include <iostream> + +// Include the numeric interface +#ifdef NI_LAPACK +# define NI_FORTRAN +#endif + +#include "NumericInterface.hpp" + +typedef NumericInterface<double> Interface; + +// Include the BTL +#include "utilities.h" +#include "bench.hh" + +// Include the operations +#include "actionsLAPACK.hpp" + + +using namespace std; BTL_MAIN; -int main(int argc, char **argv) +int main(int argv, char **argc) { bool - general_solve=false, least_squares=false, lu_decomp=false, cholesky=false, - qr_decomp=false, svd_decomp=false, syev=false, stev=false, - symm_ev=false; - int N = 100; - - - for (int i = 1; i < argc; ++i) { - std::string arg = argv[i]; - if (arg == "general_solve") general_solve = true; - else if (arg == "least_squares") least_squares = true; - else if (arg == "lu_decomp") lu_decomp = true; - else if (arg == "cholesky") cholesky = true; - else if (arg == "qr_decomp") qr_decomp = true; - else if (arg == "svd_decomp") svd_decomp = true; - else if (arg == "syev") syev = true; - else if (arg == "stev") stev = true; - else if (arg == "symm_ev") symm_ev = true; - - // Check switch -N - else if (arg[0] == '-' && arg[1] == 'N') { - if (arg[2] != '\0') - N = atoi(arg.c_str()+2); - else - N = atoi(argv[++i]); - } - } + do_GeneralSolve=false, do_LeastSquaresSolve=false, + do_LUdecomp=false, do_Choleskydecomp=false, do_QRdecomp=false + ; - if (general_solve) - bench<Action_general_solve<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); + int N = 100; - if (least_squares) - bench<Action_least_squares<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); - if (lu_decomp) - bench<Action_lu_decomp<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); + for (int i = 1; i < argv; ++i) { + std::string arg = argc[i]; - if (cholesky) - bench<Action_cholesky<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); + if (arg == "GeneralSolve") do_GeneralSolve = true; + else if (arg == "LeastSquaresSolve") do_LeastSquaresSolve = true; - if (qr_decomp) - bench<Action_qr_decomp<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); + else if (arg == "LUdecomp") do_LUdecomp= true; + else if (arg == "Choleskydecomp") do_Choleskydecomp= true; + else if (arg == "QRdecomp") do_QRdecomp= true; - if (svd_decomp) - bench<Action_svd_decomp<lapack_interface<REAL_TYPE> > >(MIN_MM,750,N); + // Check switch -N + else if (arg[0] == '-' && arg[1] == 'N') { + if (arg[2] != '\0') + N = atoi(arg.c_str()+2); + else + N = atoi(argc[++i]); + } + } - if (syev) - bench<Action_syev<lapack_interface<REAL_TYPE> > >(MIN_MM,750,N); + if (do_GeneralSolve) + bench<Action_GeneralSolve<Interface> >(MIN_MM,MAX_MM, N); + if (do_LeastSquaresSolve) + bench<Action_LeastSquaresSolve<Interface> >(MIN_MM,MAX_MM, N); - if (stev) - bench<Action_stev<lapack_interface<REAL_TYPE> > >(MIN_MM,1000,N); + if(do_LUdecomp) + bench<Action_LUdecomp<Interface> >(MIN_MM,MAX_MM, N); + if(do_Choleskydecomp) + bench<Action_Choleskydecomp<Interface> >(MIN_MM,MAX_MM, N); + if(do_QRdecomp) + bench<Action_QRdecomp<Interface> >(MIN_MM,MAX_MM, N); - if (symm_ev) - bench<Action_symm_ev<lapack_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,N); return 0; } + diff --git a/numbench/modules/internal/lapackBase.py b/numbench/modules/internal/lapackBase.py index e7b458d..890bcce 100644 --- a/numbench/modules/internal/lapackBase.py +++ b/numbench/modules/internal/lapackBase.py @@ -21,9 +21,9 @@ import btlBase from os.path import join as pjoin -availableTests = ('general_solve', 'least_squares', 'lu_decomp', 'cholesky', \ - 'qr_decomp', 'svd_decomp', 'syev', 'stev', 'symm_ev') -defaultTests = ('lu_decomp', 'cholesky', 'qr_decomp', 'svd_decomp', 'syev') +availableTests = ('GeneralSolve', 'LeastSquaresSolve', + 'LUdecomp', 'Choleskydecomp', 'QRdecomp') +defaultTests = ('GeneralSolve', 'LUdecomp', 'Choleskydecomp') def init(self, args): @@ -43,8 +43,8 @@ def runTest(self, test, implementation): exe = pjoin(test['testdir'], implementation, 'test'), logdir = pjoin(test['logdir'], implementation), testdir = pjoin(test['testdir'], implementation), - btlincludes = ('libs/BLAS', 'libs/LAPACK'), - defines = ('LAPACKNAME='+self.libname, self.libname.upper()+"_INTERFACE"), + btlincludes = ('libs/LAPACK',), + defines = ("NI_NAME=" + self.libname, "NI_" + self.libname.upper()), flags = alt.getFlags(test, self.libname, implementation), tests = self.tests ) diff --git a/numbench/testdescr.py b/numbench/testdescr.py index 1f96080..8e1b005 100644 --- a/numbench/testdescr.py +++ b/numbench/testdescr.py @@ -32,15 +32,12 @@ testdescr = { 'TriSolveMatrix': 'Triangular system solution with n right hand side vectors', # LAPACK(e) -'general_solve': 'Solution of a generic linear system of equations', -'least_squares': 'Least squares solution', -'lu_decomp': 'LU-decomposition', -'cholesky': 'Cholesky decomposition', -'svd_decomp': 'SVD-decomposition', -'qr_decomp': 'QR-decomposition', -'syev': 'Diagonalization of a symmetric matrix', -'stev': 'Diagonalization of a tridiagonal matrix', -'symm_ev': 'Symmetric Eigenvalue computation', +'GeneralSolve': 'Solution of a generic linear system of equations', +'LeastSquaresSolve': 'Least squares solution', +'LUdecomp': 'LU-decomposition', +'Choleskydecomp': 'Cholesky decomposition', +'QRdecomp': 'QR-decomposition', +'SVDdecomp': 'SVD-decomposition', # FFTW 'FFTW_1D_Forward_Measure': 'FFTW 1D Forward (Measure)', diff --git a/samples/lapacktests.xml b/samples/lapacktests.xml index 2c7741b..3c6b4a7 100644 --- a/samples/lapacktests.xml +++ b/samples/lapacktests.xml @@ -1,42 +1,23 @@ <numbench> - <operations module="lapack"> - general_solve - least_squares - lu_decomp - cholesky - qr_decomp - svd_decomp - syev - stev - symm_ev - </operations> + <operations module="lapack">GeneralSolve LeastSquaresSolve LUdecomp Choleskydecomp QRdecomp</operations> <testcases> <case id="reference"> <pkg>sci-libs/lapack-reference-3.4.1</pkg> - <emergeenv> - <var name="FFLAGS">-O3</var> - </emergeenv> - </case> - - <case id="atlas"> - <pkg>sci-libs/atlas-3.10.0</pkg> - <emergeenv> - <var name="USE">-threads openmp</var> - </emergeenv> </case> <case id="mkl"> - <pkg>sci-libs/mkl-10.3.7.256</pkg> - <skip>mkl32*</skip> - <skip>*gfortran*</skip> - <skip>*int64*</skip> + <pkg>sci-libs/mkl-11.0.0.079</pkg> + <skip>mkl32*</skip> + <skip>*int64*</skip> + <skip>*gfortran*</skip> </case> - <case id="acml"> - <pkg>sci-libs/acml-5.1.0</pkg> + <case id="atlas"> + <pkg>sci-libs/atlas-3.10.0</pkg> + <skip>atlas</skip> </case> </testcases> |