20 #ifndef TENSOR_GEMM_CC
21 #define TENSOR_GEMM_CC
23 #ifdef TENSOR_USE_ESSL
26 #include <tensor/tensor_blas.h>
30 inline void gemm(
char op1,
char op2, integer m, integer n, integer k,
31 double alpha,
const double *A, integer lda,
const double *B,
32 integer ldb,
double beta,
double *C, integer ldc)
34 #ifdef TENSOR_USE_ESSL
35 dgemm(&op1, &op2, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
37 #ifdef TENSOR_USE_ACML
38 dgemm(op1, op2, m, n, k, alpha, const_cast<double *>(A),
39 lda, const_cast<double*>(B), ldb, beta, C, ldc);
41 #if !defined(TENSOR_USE_ESSL) && !defined(TENSOR_USE_ACML)
42 cblas_dgemm(CblasColMajor, char_to_op(op1), char_to_op(op2),
43 m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
47 inline void gemm(
char op1,
char op2, integer m, integer n, integer k,
48 const tensor::cdouble &alpha,
const tensor::cdouble *A, integer lda,
49 const tensor::cdouble *B, integer ldb,
const tensor::cdouble &beta,
50 tensor::cdouble *C, integer ldc)
52 #ifdef TENSOR_USE_ESSL
53 zgemm(&op1, &op2, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
55 #ifdef TENSOR_USE_ACML
56 zgemm(op1, op2, m, n, k,
57 reinterpret_cast<doublecomplex *>(const_cast<tensor::cdouble *>(&alpha)),
58 reinterpret_cast<doublecomplex *>(const_cast<tensor::cdouble *>(A)),
60 reinterpret_cast<doublecomplex *>(const_cast<tensor::cdouble *>(B)),
62 reinterpret_cast<doublecomplex *>(const_cast<tensor::cdouble *>(&beta)),
63 reinterpret_cast<doublecomplex *>(C), ldc);
65 #if !defined(TENSOR_USE_ESSL) && !defined(TENSOR_USE_ACML)
66 cblas_zgemm(CblasColMajor, char_to_op(op1), char_to_op(op2),
67 m, n, k, &alpha, A, lda, B, ldb, &beta, C, ldc);