33 #ifndef EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
34 #define EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
49 #define GEMM_SPECIALIZATION(EIGTYPE, EIGPREFIX, BLASTYPE, BLASFUNC) \
52 int LhsStorageOrder, bool ConjugateLhs, \
53 int RhsStorageOrder, bool ConjugateRhs> \
54 struct general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor,1> \
56 typedef gebp_traits<EIGTYPE,EIGTYPE> Traits; \
58 static void run(Index rows, Index cols, Index depth, \
59 const EIGTYPE* _lhs, Index lhsStride, \
60 const EIGTYPE* _rhs, Index rhsStride, \
61 EIGTYPE* res, Index resIncr, Index resStride, \
63 level3_blocking<EIGTYPE, EIGTYPE>& , \
64 GemmParallelInfo<Index>* ) \
68 EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
69 eigen_assert(resIncr == 1); \
70 char transa, transb; \
71 BlasIndex m, n, k, lda, ldb, ldc; \
72 const EIGTYPE *a, *b; \
74 MatrixX##EIGPREFIX a_tmp, b_tmp; \
77 transa = (LhsStorageOrder==RowMajor) ? ((ConjugateLhs) ? 'C' : 'T') : 'N'; \
78 transb = (RhsStorageOrder==RowMajor) ? ((ConjugateRhs) ? 'C' : 'T') : 'N'; \
81 m = convert_index<BlasIndex>(rows); \
82 n = convert_index<BlasIndex>(cols); \
83 k = convert_index<BlasIndex>(depth); \
86 lda = convert_index<BlasIndex>(lhsStride); \
87 ldb = convert_index<BlasIndex>(rhsStride); \
88 ldc = convert_index<BlasIndex>(resStride); \
91 if ((LhsStorageOrder==ColMajor) && (ConjugateLhs)) { \
92 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,m,k,OuterStride<>(lhsStride)); \
93 a_tmp = lhs.conjugate(); \
95 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
98 if ((RhsStorageOrder==ColMajor) && (ConjugateRhs)) { \
99 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,k,n,OuterStride<>(rhsStride)); \
100 b_tmp = rhs.conjugate(); \
102 ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
105 BLASFUNC(&transa, &transb, &m, &n, &k, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
#define GEMM_SPECIALIZATION(EIGTYPE, EIGPREFIX, BLASTYPE, BLASFUNC)
Definition: GeneralMatrixMatrix_BLAS.h:49
int BLASFUNC() sgemm(const char *, const char *, const int *, const int *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *)
int BLASFUNC() cgemm(const char *, const char *, const int *, const int *, const int *, const float *, const float *, const int *, const float *, const int *, const float *, float *, const int *)
int BLASFUNC() zgemm(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *)
int BLASFUNC() dgemm(const char *, const char *, const int *, const int *, const int *, const double *, const double *, const int *, const double *, const int *, const double *, double *, const int *)
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
std::complex< double > dcomplex
Definition: MKL_support.h:125
std::complex< float > scomplex
Definition: MKL_support.h:126
Definition: document.h:416