Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
blas_symbs.cxx
Go to the documentation of this file.
1 #include "blas_symbs.h"
2 #include "util.h"
3 namespace CTF_BLAS {
4  template <typename dtype>
5  void gemm(const char *,
6  const char *,
7  const int *,
8  const int *,
9  const int *,
10  const dtype *,
11  const dtype *,
12  const int *,
13  const dtype *,
14  const int *,
15  const dtype *,
16  dtype *,
17  const int *){
18  printf("CTF ERROR GEMM not available for this type.\n");
19  ASSERT(0);
20  assert(0);
21  }
22 #define INST_GEMM(dtype,s) \
23  template <> \
24  void gemm<dtype>(const char * a, \
25  const char * b, \
26  const int * c, \
27  const int * d, \
28  const int * e, \
29  const dtype * f, \
30  const dtype * g, \
31  const int * h, \
32  const dtype * i, \
33  const int * j, \
34  const dtype * k, \
35  dtype * l, \
36  const int * m){ \
37  s ## GEMM(a,b,c,d,e,f,g,h,i,j,k,l,m); \
38  }
39  INST_GEMM(float,S)
40  INST_GEMM(double,D)
41  INST_GEMM(std::complex<float>,C)
42  INST_GEMM(std::complex<double>,Z)
43 #undef INST_GEMM
44 
45 
46 #ifdef USE_BATCH_GEMM
47  template <typename dtype>
48  void gemm_batch(const char *,
49  const char *,
50  const int *,
51  const int *,
52  const int *,
53  const dtype *,
54  dtype **,
55  const int *,
56  dtype **,
57  const int *,
58  const dtype *,
59  dtype **,
60  const int *,
61  const int *,
62  const int *){
63  printf("CTF ERROR gemm_batch not available for this type.\n");
64  ASSERT(0);
65  assert(0);
66  }
67 
68 #define INST_GEMM_BATCH(dtype,s) \
69  template <> \
70  void gemm_batch<dtype>(const char * a, \
71  const char * b, \
72  const int * c, \
73  const int * d, \
74  const int * e, \
75  const dtype * f, \
76  dtype ** g, \
77  const int * h, \
78  dtype ** i, \
79  const int * j, \
80  const dtype * k, \
81  dtype ** l, \
82  const int * m, \
83  const int * n, \
84  const int * o){ \
85  s ## GEMM_BATCH(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o); \
86  }
87  INST_GEMM_BATCH(float,S)
88  INST_GEMM_BATCH(double,D)
89  INST_GEMM_BATCH(std::complex<float>,C)
90  INST_GEMM_BATCH(std::complex<double>,Z)
91 #endif
92 }
93 #undef INST_GEMM_BATCH
#define ASSERT(...)
Definition: util.h:88
#define INST_GEMM(dtype, s)
Definition: blas_symbs.cxx:22
void gemm(const char *, const char *, const int *, const int *, const int *, const dtype *, const dtype *, const int *, const dtype *, const int *, const dtype *, dtype *, const int *)
Definition: blas_symbs.cxx:5
void gemm_batch(char taA, char taB, int l, int m, int n, int k, dtype alpha, dtype const *A, dtype const *B, dtype beta, dtype *C)
Definition: semiring.cxx:15
#define INST_GEMM_BATCH(dtype)
Definition: semiring.cxx:63