33 #ifndef EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
34 #define EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
36 #include "../InternalHeaderCheck.h"
51 #define GEMM_SPECIALIZATION(EIGTYPE, EIGPREFIX, BLASTYPE, BLASFUNC) \
54 int LhsStorageOrder, bool ConjugateLhs, \
55 int RhsStorageOrder, bool ConjugateRhs> \
56 struct general_matrix_matrix_product<Index,EIGTYPE,LhsStorageOrder,ConjugateLhs,EIGTYPE,RhsStorageOrder,ConjugateRhs,ColMajor,1> \
58 typedef gebp_traits<EIGTYPE,EIGTYPE> Traits; \
60 static void run(Index rows, Index cols, Index depth, \
61 const EIGTYPE* _lhs, Index lhsStride, \
62 const EIGTYPE* _rhs, Index rhsStride, \
63 EIGTYPE* res, Index resIncr, Index resStride, \
65 level3_blocking<EIGTYPE, EIGTYPE>& , \
66 GemmParallelInfo<Index>* ) \
70 EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
71 eigen_assert(resIncr == 1); \
72 char transa, transb; \
73 BlasIndex m, n, k, lda, ldb, ldc; \
74 const EIGTYPE *a, *b; \
76 MatrixX##EIGPREFIX a_tmp, b_tmp; \
79 transa = (LhsStorageOrder==RowMajor) ? ((ConjugateLhs) ? 'C' : 'T') : 'N'; \
80 transb = (RhsStorageOrder==RowMajor) ? ((ConjugateRhs) ? 'C' : 'T') : 'N'; \
83 m = convert_index<BlasIndex>(rows); \
84 n = convert_index<BlasIndex>(cols); \
85 k = convert_index<BlasIndex>(depth); \
88 lda = convert_index<BlasIndex>(lhsStride); \
89 ldb = convert_index<BlasIndex>(rhsStride); \
90 ldc = convert_index<BlasIndex>(resStride); \
93 if ((LhsStorageOrder==ColMajor) && (ConjugateLhs)) { \
94 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs,m,k,OuterStride<>(lhsStride)); \
95 a_tmp = lhs.conjugate(); \
97 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
100 if ((RhsStorageOrder==ColMajor) && (ConjugateRhs)) { \
101 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs,k,n,OuterStride<>(rhsStride)); \
102 b_tmp = rhs.conjugate(); \
104 ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
107 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)
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 *)
std::complex< double > dcomplex
std::complex< float > scomplex