diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-12-09 10:40:35 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-12-09 10:40:35 +0100 |
commit | 10447a7b57960b3315c419b7081c1cc273df3518 (patch) | |
tree | 876943470acddf65be17e7eac9cda3625352318f /Eigen/src/Core/util/MKL_support.h | |
parent | 43cdd242d0e34aa05e368b3d894c1041aa2cd771 (diff) |
mv blas.h to src/misc such that it would be possible to use any blas libraries,
however, this requires some more works:
- add const qualifiers in the declarations of blas.h
- add the possibility to add a suffix to blas function names
Diffstat (limited to 'Eigen/src/Core/util/MKL_support.h')
-rw-r--r-- | Eigen/src/Core/util/MKL_support.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Eigen/src/Core/util/MKL_support.h b/Eigen/src/Core/util/MKL_support.h index 56a03fa32..d605fc844 100644 --- a/Eigen/src/Core/util/MKL_support.h +++ b/Eigen/src/Core/util/MKL_support.h @@ -53,9 +53,19 @@ #include <mkl.h> #include <mkl_lapacke.h> - #define EIGEN_MKL_VML_THRESHOLD 128 +#elif defined EIGEN_USE_BLAS + +#error Currently EIGEN_USE_BLAS requires Intel MKL. If you want to use MKL's BLAS and only it, then define EIGEN_USE_MKL too. + +#include "../../misc/blas.h" +#define MKL_INT int + +#endif + +#if defined(EIGEN_USE_MKL) || defined(EIGEN_USE_BLAS) + namespace Eigen { typedef std::complex<double> dcomplex; @@ -68,6 +78,12 @@ static inline void assign_scalar_eig2mkl(MKLType& mklScalar, const EigenType& ei mklScalar=eigenScalar; } +template<typename MKLType, typename EigenType> +static inline void assign_conj_scalar_eig2mkl(MKLType& mklScalar, const EigenType& eigenScalar) { + mklScalar=eigenScalar; +} + +#ifdef EIGEN_USE_MKL template <> inline void assign_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) { mklScalar.real=eigenScalar.real(); @@ -80,11 +96,6 @@ inline void assign_scalar_eig2mkl<MKL_Complex8,scomplex>(MKL_Complex8& mklScalar mklScalar.imag=eigenScalar.imag(); } -template<typename MKLType, typename EigenType> -static inline void assign_conj_scalar_eig2mkl(MKLType& mklScalar, const EigenType& eigenScalar) { - mklScalar=eigenScalar; -} - template <> inline void assign_conj_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) { mklScalar.real=eigenScalar.real(); @@ -97,14 +108,12 @@ inline void assign_conj_scalar_eig2mkl<MKL_Complex8,scomplex>(MKL_Complex8& mklS mklScalar.imag=-eigenScalar.imag(); } +#endif + } // end namespace internal } // end namespace Eigen -#elif defined EIGEN_USE_BLAS - -#include "../../misc/blas.h" - #endif -#endif +#endif // EIGEN_MKL_SUPPORT_H |