33 #ifndef EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
34 #define EIGEN_GENERAL_MATRIX_MATRIX_BLAS_H
37 #include "../InternalHeaderCheck.h"
52 #define GEMM_SPECIALIZATION(EIGTYPE, EIGPREFIX, BLASTYPE, BLASFUNC) \
53 template <typename Index, int LhsStorageOrder, bool ConjugateLhs, int RhsStorageOrder, bool ConjugateRhs> \
54 struct general_matrix_matrix_product<Index, EIGTYPE, LhsStorageOrder, ConjugateLhs, EIGTYPE, RhsStorageOrder, \
55 ConjugateRhs, ColMajor, 1> { \
56 typedef gebp_traits<EIGTYPE, EIGTYPE> Traits; \
58 static void run(Index rows, Index cols, Index depth, const EIGTYPE* _lhs, Index lhsStride, const EIGTYPE* _rhs, \
59 Index rhsStride, EIGTYPE* res, Index resIncr, Index resStride, EIGTYPE alpha, \
60 level3_blocking<EIGTYPE, EIGTYPE>& , GemmParallelInfo<Index>* ) { \
62 if (rows == 0 || cols == 0 || depth == 0) return; \
63 EIGEN_ONLY_USED_FOR_DEBUG(resIncr); \
64 eigen_assert(resIncr == 1); \
65 char transa, transb; \
66 BlasIndex m, n, k, lda, ldb, ldc; \
67 const EIGTYPE *a, *b; \
69 MatrixX##EIGPREFIX a_tmp, b_tmp; \
72 transa = (LhsStorageOrder == RowMajor) ? ((ConjugateLhs) ? 'C' : 'T') : 'N'; \
73 transb = (RhsStorageOrder == RowMajor) ? ((ConjugateRhs) ? 'C' : 'T') : 'N'; \
76 m = convert_index<BlasIndex>(rows); \
77 n = convert_index<BlasIndex>(cols); \
78 k = convert_index<BlasIndex>(depth); \
81 lda = convert_index<BlasIndex>(lhsStride); \
82 ldb = convert_index<BlasIndex>(rhsStride); \
83 ldc = convert_index<BlasIndex>(resStride); \
86 if ((LhsStorageOrder == ColMajor) && (ConjugateLhs)) { \
87 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > lhs(_lhs, m, k, OuterStride<>(lhsStride)); \
88 a_tmp = lhs.conjugate(); \
90 lda = convert_index<BlasIndex>(a_tmp.outerStride()); \
94 if ((RhsStorageOrder == ColMajor) && (ConjugateRhs)) { \
95 Map<const MatrixX##EIGPREFIX, 0, OuterStride<> > rhs(_rhs, k, n, OuterStride<>(rhsStride)); \
96 b_tmp = rhs.conjugate(); \
98 ldb = convert_index<BlasIndex>(b_tmp.outerStride()); \
102 BLASFUNC(&transa, &transb, &m, &n, &k, (const BLASTYPE*)&numext::real_ref(alpha), (const BLASTYPE*)a, &lda, \
103 (const BLASTYPE*)b, &ldb, (const BLASTYPE*)&numext::real_ref(beta), (BLASTYPE*)res, &ldc); \
#define GEMM_SPECIALIZATION(EIGTYPE, EIGPREFIX, BLASTYPE, BLASFUNC)
Definition: GeneralMatrixMatrix_BLAS.h:52
int dgemm_(const char *transA, const char *transB, int *M, int *N, int *k, double *alpha, double *A, int *LDA, double *B, int *LDB, double *beta, double *C, int *LDC)
This is the gernal matrix multiplication from blas level 3.
int BLASFUNC() dgemm(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *)
int BLASFUNC() sgemm(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *)
int BLASFUNC() cgemm(char *, char *, int *, int *, int *, float *, float *, int *, float *, int *, float *, float *, int *)
int BLASFUNC() zgemm(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *, double *, double *, int *)
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
std::complex< double > dcomplex
Definition: MKL_support.h:128
std::complex< float > scomplex
Definition: MKL_support.h:129
Definition: Eigen_Colamd.h:49
int zgemm_(char *, char *, int *, int *, int *, doublecomplex *, doublecomplex *, int *, doublecomplex *, int *, doublecomplex *, doublecomplex *, int *)