mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
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
This commit is contained in:
parent
43cdd242d0
commit
10447a7b57
@ -53,9 +53,19 @@
|
|||||||
|
|
||||||
#include <mkl.h>
|
#include <mkl.h>
|
||||||
#include <mkl_lapacke.h>
|
#include <mkl_lapacke.h>
|
||||||
|
|
||||||
#define EIGEN_MKL_VML_THRESHOLD 128
|
#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 {
|
namespace Eigen {
|
||||||
|
|
||||||
typedef std::complex<double> dcomplex;
|
typedef std::complex<double> dcomplex;
|
||||||
@ -68,6 +78,12 @@ static inline void assign_scalar_eig2mkl(MKLType& mklScalar, const EigenType& ei
|
|||||||
mklScalar=eigenScalar;
|
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 <>
|
template <>
|
||||||
inline void assign_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) {
|
inline void assign_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) {
|
||||||
mklScalar.real=eigenScalar.real();
|
mklScalar.real=eigenScalar.real();
|
||||||
@ -80,11 +96,6 @@ inline void assign_scalar_eig2mkl<MKL_Complex8,scomplex>(MKL_Complex8& mklScalar
|
|||||||
mklScalar.imag=eigenScalar.imag();
|
mklScalar.imag=eigenScalar.imag();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename MKLType, typename EigenType>
|
|
||||||
static inline void assign_conj_scalar_eig2mkl(MKLType& mklScalar, const EigenType& eigenScalar) {
|
|
||||||
mklScalar=eigenScalar;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
inline void assign_conj_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) {
|
inline void assign_conj_scalar_eig2mkl<MKL_Complex16,dcomplex>(MKL_Complex16& mklScalar, const dcomplex& eigenScalar) {
|
||||||
mklScalar.real=eigenScalar.real();
|
mklScalar.real=eigenScalar.real();
|
||||||
@ -97,14 +108,12 @@ inline void assign_conj_scalar_eig2mkl<MKL_Complex8,scomplex>(MKL_Complex8& mklS
|
|||||||
mklScalar.imag=-eigenScalar.imag();
|
mklScalar.imag=-eigenScalar.imag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end namespace internal
|
} // end namespace internal
|
||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
|
||||||
#elif defined EIGEN_USE_BLAS
|
|
||||||
|
|
||||||
#include "../../misc/blas.h"
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif // EIGEN_MKL_SUPPORT_H
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#ifndef BLAS_H
|
#ifndef BLAS_H
|
||||||
#define BLAS_H
|
#define BLAS_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
#define BLASFUNC(FUNC) FUNC##_
|
#define BLASFUNC(FUNC) FUNC##_
|
||||||
|
|
||||||
#ifdef __WIN64__
|
#ifdef __WIN64__
|
||||||
@ -646,4 +651,8 @@ int BLASFUNC(cpotri)(char *, int *, float *, int *, int *);
|
|||||||
int BLASFUNC(zpotri)(char *, int *, double *, int *, int *);
|
int BLASFUNC(zpotri)(char *, int *, double *, int *, int *);
|
||||||
int BLASFUNC(xpotri)(char *, int *, double *, int *, int *);
|
int BLASFUNC(xpotri)(char *, int *, double *, int *, int *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -32,16 +32,8 @@
|
|||||||
#error the token SCALAR must be defined to compile this file
|
#error the token SCALAR must be defined to compile this file
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#include <Eigen/src/misc/blas.h>
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "blas.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NOTR 0
|
#define NOTR 0
|
||||||
#define TR 1
|
#define TR 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user