mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-01 17:50:40 +08:00
fix various regressions with MKL support
(transplanted from 8ab0e16e27ea50912ad181ad492b7bd10ffeba98 )
This commit is contained in:
parent
9f945b6028
commit
a03c970c5c
@ -57,11 +57,11 @@ template <typename Index, int Mode, \
|
|||||||
struct product_triangular_matrix_matrix<Scalar,Index, Mode, LhsIsTriangular, \
|
struct product_triangular_matrix_matrix<Scalar,Index, Mode, LhsIsTriangular, \
|
||||||
LhsStorageOrder,ConjugateLhs, RhsStorageOrder,ConjugateRhs,ColMajor,Specialized> { \
|
LhsStorageOrder,ConjugateLhs, RhsStorageOrder,ConjugateRhs,ColMajor,Specialized> { \
|
||||||
static inline void run(Index _rows, Index _cols, Index _depth, const Scalar* _lhs, Index lhsStride,\
|
static inline void run(Index _rows, Index _cols, Index _depth, const Scalar* _lhs, Index lhsStride,\
|
||||||
const Scalar* _rhs, Index rhsStride, Scalar* res, Index resStride, Scalar alpha) { \
|
const Scalar* _rhs, Index rhsStride, Scalar* res, Index resStride, Scalar alpha, level3_blocking<Scalar,Scalar>& blocking) { \
|
||||||
product_triangular_matrix_matrix_trmm<Scalar,Index,Mode, \
|
product_triangular_matrix_matrix_trmm<Scalar,Index,Mode, \
|
||||||
LhsIsTriangular,LhsStorageOrder,ConjugateLhs, \
|
LhsIsTriangular,LhsStorageOrder,ConjugateLhs, \
|
||||||
RhsStorageOrder, ConjugateRhs, ColMajor>::run( \
|
RhsStorageOrder, ConjugateRhs, ColMajor>::run( \
|
||||||
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha); \
|
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
|
||||||
} \
|
} \
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,true, \
|
|||||||
const EIGTYPE* _lhs, Index lhsStride, \
|
const EIGTYPE* _lhs, Index lhsStride, \
|
||||||
const EIGTYPE* _rhs, Index rhsStride, \
|
const EIGTYPE* _rhs, Index rhsStride, \
|
||||||
EIGTYPE* res, Index resStride, \
|
EIGTYPE* res, Index resStride, \
|
||||||
EIGTYPE alpha) \
|
EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
|
||||||
{ \
|
{ \
|
||||||
Index diagSize = (std::min)(_rows,_depth); \
|
Index diagSize = (std::min)(_rows,_depth); \
|
||||||
Index rows = IsLower ? _rows : diagSize; \
|
Index rows = IsLower ? _rows : diagSize; \
|
||||||
@ -115,16 +115,16 @@ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,true, \
|
|||||||
/* Most likely no benefit to call TRMM or GEMM from MKL*/ \
|
/* Most likely no benefit to call TRMM or GEMM from MKL*/ \
|
||||||
product_triangular_matrix_matrix<EIGTYPE,Index,Mode,true, \
|
product_triangular_matrix_matrix<EIGTYPE,Index,Mode,true, \
|
||||||
LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
|
LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
|
||||||
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha); \
|
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
|
||||||
/*std::cout << "TRMM_L: A is not square! Go to Eigen TRMM implementation!\n";*/ \
|
/*std::cout << "TRMM_L: A is not square! Go to Eigen TRMM implementation!\n";*/ \
|
||||||
} else { \
|
} else { \
|
||||||
/* Make sense to call GEMM */ \
|
/* Make sense to call GEMM */ \
|
||||||
Map<const MatrixLhs, 0, OuterStride<> > lhsMap(_lhs,rows,depth,OuterStride<>(lhsStride)); \
|
Map<const MatrixLhs, 0, OuterStride<> > lhsMap(_lhs,rows,depth,OuterStride<>(lhsStride)); \
|
||||||
MatrixLhs aa_tmp=lhsMap.template triangularView<Mode>(); \
|
MatrixLhs aa_tmp=lhsMap.template triangularView<Mode>(); \
|
||||||
MKL_INT aStride = aa_tmp.outerStride(); \
|
MKL_INT aStride = aa_tmp.outerStride(); \
|
||||||
gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> blocking(_rows,_cols,_depth); \
|
gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> gemm_blocking(_rows,_cols,_depth); \
|
||||||
general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
|
general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
|
||||||
rows, cols, depth, aa_tmp.data(), aStride, _rhs, rhsStride, res, resStride, alpha, blocking, 0); \
|
rows, cols, depth, aa_tmp.data(), aStride, _rhs, rhsStride, res, resStride, alpha, gemm_blocking, 0); \
|
||||||
\
|
\
|
||||||
/*std::cout << "TRMM_L: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
|
/*std::cout << "TRMM_L: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
|
||||||
} \
|
} \
|
||||||
@ -210,7 +210,7 @@ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,false, \
|
|||||||
const EIGTYPE* _lhs, Index lhsStride, \
|
const EIGTYPE* _lhs, Index lhsStride, \
|
||||||
const EIGTYPE* _rhs, Index rhsStride, \
|
const EIGTYPE* _rhs, Index rhsStride, \
|
||||||
EIGTYPE* res, Index resStride, \
|
EIGTYPE* res, Index resStride, \
|
||||||
EIGTYPE alpha) \
|
EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
|
||||||
{ \
|
{ \
|
||||||
Index diagSize = (std::min)(_cols,_depth); \
|
Index diagSize = (std::min)(_cols,_depth); \
|
||||||
Index rows = _rows; \
|
Index rows = _rows; \
|
||||||
@ -229,16 +229,16 @@ struct product_triangular_matrix_matrix_trmm<EIGTYPE,Index,Mode,false, \
|
|||||||
/* Most likely no benefit to call TRMM or GEMM from MKL*/ \
|
/* Most likely no benefit to call TRMM or GEMM from MKL*/ \
|
||||||
product_triangular_matrix_matrix<EIGTYPE,Index,Mode,false, \
|
product_triangular_matrix_matrix<EIGTYPE,Index,Mode,false, \
|
||||||
LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
|
LhsStorageOrder,ConjugateLhs, RhsStorageOrder, ConjugateRhs, ColMajor, BuiltIn>::run( \
|
||||||
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha); \
|
_rows, _cols, _depth, _lhs, lhsStride, _rhs, rhsStride, res, resStride, alpha, blocking); \
|
||||||
/*std::cout << "TRMM_R: A is not square! Go to Eigen TRMM implementation!\n";*/ \
|
/*std::cout << "TRMM_R: A is not square! Go to Eigen TRMM implementation!\n";*/ \
|
||||||
} else { \
|
} else { \
|
||||||
/* Make sense to call GEMM */ \
|
/* Make sense to call GEMM */ \
|
||||||
Map<const MatrixRhs, 0, OuterStride<> > rhsMap(_rhs,depth,cols, OuterStride<>(rhsStride)); \
|
Map<const MatrixRhs, 0, OuterStride<> > rhsMap(_rhs,depth,cols, OuterStride<>(rhsStride)); \
|
||||||
MatrixRhs aa_tmp=rhsMap.template triangularView<Mode>(); \
|
MatrixRhs aa_tmp=rhsMap.template triangularView<Mode>(); \
|
||||||
MKL_INT aStride = aa_tmp.outerStride(); \
|
MKL_INT aStride = aa_tmp.outerStride(); \
|
||||||
gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> blocking(_rows,_cols,_depth); \
|
gemm_blocking_space<ColMajor,EIGTYPE,EIGTYPE,Dynamic,Dynamic,Dynamic> gemm_blocking(_rows,_cols,_depth); \
|
||||||
general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
|
general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor>::run( \
|
||||||
rows, cols, depth, _lhs, lhsStride, aa_tmp.data(), aStride, res, resStride, alpha, blocking, 0); \
|
rows, cols, depth, _lhs, lhsStride, aa_tmp.data(), aStride, res, resStride, alpha, gemm_blocking, 0); \
|
||||||
\
|
\
|
||||||
/*std::cout << "TRMM_R: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
|
/*std::cout << "TRMM_R: A is not square! Go to MKL GEMM implementation! " << nthr<<" \n";*/ \
|
||||||
} \
|
} \
|
||||||
|
@ -82,11 +82,11 @@ struct triangular_matrix_vector_product_trmv<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,
|
|||||||
LowUp = IsLower ? Lower : Upper \
|
LowUp = IsLower ? Lower : Upper \
|
||||||
}; \
|
}; \
|
||||||
static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
||||||
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
|
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha) \
|
||||||
{ \
|
{ \
|
||||||
if (ConjLhs || IsZeroDiag) { \
|
if (ConjLhs || IsZeroDiag) { \
|
||||||
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,ColMajor,BuiltIn>::run( \
|
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,ColMajor,BuiltIn>::run( \
|
||||||
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha, blocking); \
|
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
||||||
return; \
|
return; \
|
||||||
}\
|
}\
|
||||||
Index size = (std::min)(_rows,_cols); \
|
Index size = (std::min)(_rows,_cols); \
|
||||||
@ -167,11 +167,11 @@ struct triangular_matrix_vector_product_trmv<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,
|
|||||||
LowUp = IsLower ? Lower : Upper \
|
LowUp = IsLower ? Lower : Upper \
|
||||||
}; \
|
}; \
|
||||||
static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
static EIGEN_DONT_INLINE void run(Index _rows, Index _cols, const EIGTYPE* _lhs, Index lhsStride, \
|
||||||
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha, level3_blocking<EIGTYPE,EIGTYPE>& blocking) \
|
const EIGTYPE* _rhs, Index rhsIncr, EIGTYPE* _res, Index resIncr, EIGTYPE alpha) \
|
||||||
{ \
|
{ \
|
||||||
if (IsZeroDiag) { \
|
if (IsZeroDiag) { \
|
||||||
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,RowMajor,BuiltIn>::run( \
|
triangular_matrix_vector_product<Index,Mode,EIGTYPE,ConjLhs,EIGTYPE,ConjRhs,RowMajor,BuiltIn>::run( \
|
||||||
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha, blocking); \
|
_rows, _cols, _lhs, lhsStride, _rhs, rhsIncr, _res, resIncr, alpha); \
|
||||||
return; \
|
return; \
|
||||||
}\
|
}\
|
||||||
Index size = (std::min)(_rows,_cols); \
|
Index size = (std::min)(_rows,_cols); \
|
||||||
|
@ -40,7 +40,7 @@ namespace Eigen {
|
|||||||
/** \internal Specialization for the data types supported by MKL */
|
/** \internal Specialization for the data types supported by MKL */
|
||||||
|
|
||||||
#define EIGEN_MKL_SCHUR_COMPLEX(EIGTYPE, MKLTYPE, MKLPREFIX, MKLPREFIX_U, EIGCOLROW, MKLCOLROW) \
|
#define EIGEN_MKL_SCHUR_COMPLEX(EIGTYPE, MKLTYPE, MKLPREFIX, MKLPREFIX_U, EIGCOLROW, MKLCOLROW) \
|
||||||
template<> inline\
|
template<> inline \
|
||||||
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
||||||
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, bool computeU) \
|
ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, bool computeU) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -40,7 +40,7 @@ namespace Eigen {
|
|||||||
/** \internal Specialization for the data types supported by MKL */
|
/** \internal Specialization for the data types supported by MKL */
|
||||||
|
|
||||||
#define EIGEN_MKL_EIG_SELFADJ(EIGTYPE, MKLTYPE, MKLRTYPE, MKLNAME, EIGCOLROW, MKLCOLROW ) \
|
#define EIGEN_MKL_EIG_SELFADJ(EIGTYPE, MKLTYPE, MKLRTYPE, MKLNAME, EIGCOLROW, MKLCOLROW ) \
|
||||||
template<> inline\
|
template<> inline \
|
||||||
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \
|
||||||
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, int options) \
|
SelfAdjointEigenSolver<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, int options) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -41,7 +41,7 @@ namespace Eigen {
|
|||||||
/** \internal Specialization for the data types supported by MKL */
|
/** \internal Specialization for the data types supported by MKL */
|
||||||
|
|
||||||
#define EIGEN_MKL_QR_COLPIV(EIGTYPE, MKLTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \
|
#define EIGEN_MKL_QR_COLPIV(EIGTYPE, MKLTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \
|
||||||
template<> inline\
|
template<> inline \
|
||||||
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >& \
|
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >& \
|
||||||
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >::compute( \
|
ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >::compute( \
|
||||||
const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix) \
|
const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix) \
|
||||||
|
@ -40,7 +40,7 @@ namespace Eigen {
|
|||||||
/** \internal Specialization for the data types supported by MKL */
|
/** \internal Specialization for the data types supported by MKL */
|
||||||
|
|
||||||
#define EIGEN_MKL_SVD(EIGTYPE, MKLTYPE, MKLRTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \
|
#define EIGEN_MKL_SVD(EIGTYPE, MKLTYPE, MKLRTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \
|
||||||
template<> inline\
|
template<> inline \
|
||||||
JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>& \
|
JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>& \
|
||||||
JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix, unsigned int computationOptions) \
|
JacobiSVD<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>, ColPivHouseholderQRPreconditioner>::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix, unsigned int computationOptions) \
|
||||||
{ \
|
{ \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user