Commit 8879b360 by MIJIEUX Thomas

### Add type traits and static assert to detect invalid combination

parent 053c328e
 ... ... @@ -64,7 +64,8 @@ public: * \return Total Number of Matrix vector product done * (cumulated size of the spanned Krylov Spaces) */ template< template class ARNOLDI_HESS, class Matrix, class Block > template< template class ARNOLDI_HESS, class Matrix, class Block > int solve_block( Matrix &A, Block &B, Block &X, const int maxMVP, const int max_krylov_space_size, const std::vector

&epsilon, ... ...

 ... ... @@ -9,7 +9,7 @@ template class HESSENBERG, class S> class Arnoldi_IB; #include "fabulous/data/BlockWP.hpp" #include "fabulous/utils/Utils.hpp" #include "fabulous/utils/Logger.hpp" #include "fabulous/utils/ClassCompatibility.hpp" #include "fabulous/utils/TypeInfo.hpp" namespace fabulous { ... ... @@ -20,7 +20,7 @@ namespace fabulous { * * \warning This class does NOT support DeflatedRestarting (not implemented) */ template class HESSENBERG, class S> class Arnoldi_IB template < template class HESSENBERG, class S > class Arnoldi_IB { static_assert( arnoldiXhessenberg::value, ... ... @@ -327,8 +327,8 @@ private: public: template Arnoldi_IB(Logger

&logger, Restarter &restarter, template

 ... ... @@ -9,7 +9,7 @@ template class HESSENBERG, class S > class Arnoldi; #include "fabulous/data/Block.hpp" #include "fabulous/utils/Utils.hpp" #include "fabulous/utils/Logger.hpp" #include "fabulous/utils/ClassCompatibility.hpp" #include "fabulous/utils/TypeInfo.hpp" #include "fabulous/restart/DeflatedRestart.hpp" #include "fabulous/orthogonalization/Arnoldi_Ortho.hpp" ... ... @@ -152,8 +152,8 @@ private: } public: template Arnoldi(Logger

&logger, Restarter &restarter, template

 #ifndef FABULOUS_LAPACK_INTERFACE_HPP #define FABULOUS_LAPACK_INTERFACE_HPP #include #include #include #include #include #include namespace fabulous { ... ... @@ -14,8 +10,6 @@ struct LapackKernI; #include "fabulous/utils/Arithmetic.hpp" #include "fabulous/utils/Error.hpp" #include "fabulous/ext/cblas.h" #include "fabulous/ext/lapacke.h" namespace fabulous { ... ... @@ -250,21 +244,19 @@ struct LapackKernI }; // end class LapackKernI }; // namespace fabulous #define FABULOUS_LAPACK_INTERFACE_INC__ #include "LapackInterface_cblas.hpp" #include "./LapackInterface_cblas.hpp" #ifdef FABULOUS_LAPACKE_NANCHECK # include "LapackInterface_nancheck.hpp" # include "./LapackInterface_nancheck.hpp" #else # include "LapackInterface_work.hpp" # include "./LapackInterface_work.hpp" #endif #undef FABULOUS_LAPACK_INTERFACE_INC__ }; // namespace fabulous #endif // FABULOUS_LAPACK_INTERFACE_HPP
 #ifndef FABULOUS_LAPACK_INTERFACE_CBLAS_HPP #define FABULOUS_LAPACK_INTERFACE_CBLAS_HPP #ifndef FABULOUS_LAPACK_INTERFACE_INC__ # error "Do not include this header directly, use LapackInterface.hpp instead" #endif #include "./LapackInterface.hpp" #include "fabulous/ext/cblas.h" /************* T-GEMM ********************/ namespace fabulous { template<> //float inline void LapackKernI::Tgemm(int m, int n, int k, const float *A, int lda, ... ... @@ -26,7 +34,7 @@ inline void LapackKernI::Tgemm(int m, int n, int k, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc); } template<> //Cmplx Float template<> //Complex Float inline void LapackKernI::Tgemm(int m, int n, int k, const std::complex *A, int lda, const std::complex *B, int ldb, ... ... @@ -38,7 +46,7 @@ inline void LapackKernI::Tgemm(int m, int n, int k, m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc); } template<> //Cmplx Double template<> //Complex Double inline void LapackKernI::Tgemm(int m, int n, int k, const std::complex *A, int lda, const std::complex *B, int ldb, ... ... @@ -195,3 +203,8 @@ inline void LapackKernI::dot(int N, { cblas_zdotc_sub(N, X, incX, Y, incY, ret); } }; #endif // FABULOUS_LAPACK_INTERFACE_CBLAS_HPP
 #ifndef FABULOUS_LAPACK_INTERFACE_NANCHECK_HPP #define FABULOUS_LAPACK_INTERFACE_NANCHECK_HPP #ifndef FABULOUS_LAPACK_INTERFACE_INC__ # error "Do not include this header directly, use LapackInterface.hpp instead" #endif ... ... @@ -6,7 +9,12 @@ # error "LapackInterface_nancheck.hpp was included but FABULOUS_LAPACKE_NANCHECK is not set" #endif #include "./LapackInterface.hpp" #include "fabulous/utils/Arithmetic.hpp" #include "fabulous/ext/lapacke.h" namespace fabulous { /********* LACPY **********/ ... ... @@ -249,3 +257,6 @@ inline int LapackKernI::ggev(int n, std::complex * a,int lda, FABULOUS_ARITHMETIC_LIST(FABULOUS_SPECIALIZE_TRSM); }; // end namespace fabulous #endif // FABULOUS_LAPACK_INTERFACE_NANCHECK_HPP
 #ifndef FABULOUS_LAPACK_INTERFACE_WORK_HPP #define FABULOUS_LAPACK_INTERFACE_WORK_HPP #ifndef FABULOUS_LAPACK_INTERFACE_INC__ # error "Do not include this header directly, use LapackInterface.hpp instead" #endif ... ... @@ -6,6 +9,14 @@ # error "LapackInterface_work.hpp was included but FABULOUS_LAPACKE_NANCHECK is set" #endif #include "./LapackInterface.hpp" #include "fabulous/ext/lapacke.h" namespace fabulous { /********* LACPY **********/ #define FABULOUS_SPECIALIZE_LACPY(_1, S_, P_, _4, _5, _6, prefix_, ...) \ ... ... @@ -454,3 +465,8 @@ inline int LapackKernI::ggev(int n, } \ FABULOUS_ARITHMETIC_LIST(FABULOUS_SPECIALIZE_TRSM); }; #endif // FABULOUS_LAPACK_INTERFACE_WORK_HPP
 ... ... @@ -22,6 +22,8 @@ template< template class HESSENBERG, #include #include namespace fabulous { template< ... ... @@ -35,7 +37,6 @@ struct arnoldiXhessenberg : public std::false_type {}; struct arnoldiXhessenberg \ : public std::true_type {}; \ ARNOLDI_X_HESSENBERG(Arnoldi, HessStandard); ARNOLDI_X_HESSENBERG(Arnoldi, HessQR); ARNOLDI_X_HESSENBERG(Arnoldi, HessQRDR); ... ...
 ... ... @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) // OrthoScheme::IMGS, OrthoType::BLOCK // ); runTest_BGMRES_DR_filelog( runTest_BGMRES_DR_filelog( "young1c", mat, RHS, XExact, maxMVP, restart, epsilon, ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!