Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
blas_symbs.h
Go to the documentation of this file.
1 #ifndef __BLAS_SYMBS__
2 #define __BLAS_SYMBS__
3 
4 #include <complex>
5 #if FTN_UNDERSCORE
6 #define DDOT ddot_
7 #define SGEMM sgemm_
8 #define DGEMM dgemm_
9 #define CGEMM cgemm_
10 #define ZGEMM zgemm_
11 #define SGEMM_BATCH sgemm_batch_
12 #define DGEMM_BATCH dgemm_batch_
13 #define CGEMM_BATCH cgemm_batch_
14 #define ZGEMM_BATCH zgemm_batch_
15 #define SAXPY saxpy_
16 #define DAXPY daxpy_
17 #define CAXPY caxpy_
18 #define ZAXPY zaxpy_
19 #define SSCAL sscal_
20 #define DSCAL dscal_
21 #define CSCAL cscal_
22 #define ZSCAL zscal_
23 #define SCOPY scopy_
24 #define DCOPY dcopy_
25 #define ZCOPY zcopy_
26 #else
27 #define DDOT ddot
28 #define SGEMM sgemm
29 #define DGEMM dgemm
30 #define CGEMM cgemm
31 #define ZGEMM zgemm
32 #define SGEMM_BATCH sgemm_batch
33 #define DGEMM_BATCH dgemm_batch
34 #define CGEMM_BATCH cgemm_batch
35 #define ZGEMM_BATCH zgemm_batch
36 #define SAXPY saxpy
37 #define DAXPY daxpy
38 #define CAXPY caxpy
39 #define ZAXPY zaxpy
40 #define SSCAL sscal
41 #define DSCAL dscal
42 #define CSCAL cscal
43 #define ZSCAL zscal
44 #define SCOPY scopy
45 #define DCOPY dcopy
46 #define ZCOPY zcopy
47 #endif
48 
49 
50 namespace CTF_BLAS {
51  extern "C"
52  double DDOT(int * n, const double * dX,
53  int * incX, const double * dY,
54  int * incY);
55 
56  extern "C"
57  void SGEMM(const char *,
58  const char *,
59  const int *,
60  const int *,
61  const int *,
62  const float *,
63  const float *,
64  const int *,
65  const float *,
66  const int *,
67  const float *,
68  float *,
69  const int *);
70 
71 
72  extern "C"
73  void DGEMM(const char *,
74  const char *,
75  const int *,
76  const int *,
77  const int *,
78  const double *,
79  const double *,
80  const int *,
81  const double *,
82  const int *,
83  const double *,
84  double *,
85  const int *);
86 
87 
88  extern "C"
89  void CGEMM(const char *,
90  const char *,
91  const int *,
92  const int *,
93  const int *,
94  const std::complex<float> *,
95  const std::complex<float> *,
96  const int *,
97  const std::complex<float> *,
98  const int *,
99  const std::complex<float> *,
100  std::complex<float> *,
101  const int *);
102 
103  extern "C"
104  void ZGEMM(const char *,
105  const char *,
106  const int *,
107  const int *,
108  const int *,
109  const std::complex<double> *,
110  const std::complex<double> *,
111  const int *,
112  const std::complex<double> *,
113  const int *,
114  const std::complex<double> *,
115  std::complex<double> *,
116  const int *);
117 
118 
119  extern "C"
120  void SAXPY(const int * n,
121  float * dA,
122  const float * dX,
123  const int * incX,
124  float * dY,
125  const int * incY);
126 
127 
128  template <typename dtype>
129  void gemm(const char *,
130  const char *,
131  const int *,
132  const int *,
133  const int *,
134  const dtype *,
135  const dtype *,
136  const int *,
137  const dtype *,
138  const int *,
139  const dtype *,
140  dtype *,
141  const int *);
142 
143 
144  extern "C"
145  void SAXPY(const int * n,
146  float * dA,
147  const float * dX,
148  const int * incX,
149  float * dY,
150  const int * incY);
151 
152 
153  extern "C"
154  void DAXPY(const int * n,
155  double * dA,
156  const double * dX,
157  const int * incX,
158  double * dY,
159  const int * incY);
160 
161  extern "C"
162  void CAXPY(const int * n,
163  std::complex<float> * dA,
164  const std::complex<float> * dX,
165  const int * incX,
166  std::complex<float> * dY,
167  const int * incY);
168 
169  extern "C"
170  void ZAXPY(const int * n,
171  std::complex<double> * dA,
172  const std::complex<double> * dX,
173  const int * incX,
174  std::complex<double> * dY,
175  const int * incY);
176 
177  extern "C"
178  void SCOPY(const int * n,
179  const float * dX,
180  const int * incX,
181  float * dY,
182  const int * incY);
183 
184 
185  extern "C"
186  void DCOPY(const int * n,
187  const double * dX,
188  const int * incX,
189  double * dY,
190  const int * incY);
191 
192 
193  extern "C"
194  void ZCOPY(const int * n,
195  const std::complex<double> * dX,
196  const int * incX,
197  std::complex<double> * dY,
198  const int * incY);
199 
200  extern "C"
201  void SSCAL(const int * n,
202  float * dA,
203  float * dX,
204  const int * incX);
205 
206  extern "C"
207  void DSCAL(const int * n,
208  double * dA,
209  double * dX,
210  const int * incX);
211 
212  extern "C"
213  void CSCAL(const int * n,
214  std::complex<float> * dA,
215  std::complex<float> * dX,
216  const int * incX);
217 
218  extern "C"
219  void ZSCAL(const int * n,
220  std::complex<double> * dA,
221  std::complex<double> * dX,
222  const int * incX);
223 
224 
225 #ifdef USE_BATCH_GEMM
226  extern "C"
227  void SGEMM_BATCH(
228  const char *,
229  const char *,
230  const int *,
231  const int *,
232  const int *,
233  const float *,
234  float **,
235  const int *,
236  float **,
237  const int *,
238  const float *,
239  float **,
240  const int *,
241  const int *,
242  const int *);
243 
244  extern "C"
245  void DGEMM_BATCH(
246  const char *,
247  const char *,
248  const int *,
249  const int *,
250  const int *,
251  const double *,
252  double **,
253  const int *,
254  double **,
255  const int *,
256  const double *,
257  double **,
258  const int *,
259  const int *,
260  const int *);
261 
262  extern "C"
263  void CGEMM_BATCH(
264  const char *,
265  const char *,
266  const int *,
267  const int *,
268  const int *,
269  const std::complex<float> *,
270  std::complex<float> **,
271  const int *,
272  std::complex<float> **,
273  const int *,
274  const std::complex<float> *,
275  std::complex<float> **,
276  const int *,
277  const int *,
278  const int *);
279 
280  extern "C"
281  void ZGEMM_BATCH(
282  const char *,
283  const char *,
284  const int *,
285  const int *,
286  const int *,
287  const std::complex<double> *,
288  std::complex<double> **,
289  const int *,
290  std::complex<double> **,
291  const int *,
292  const std::complex<double> *,
293  std::complex<double> **,
294  const int *,
295  const int *,
296  const int *);
297 
298  template <typename dtype>
299  void gemm_batch(const char *,
300  const char *,
301  const int *,
302  const int *,
303  const int *,
304  const dtype *,
305  dtype **,
306  const int *,
307  dtype **,
308  const int *,
309  const dtype *,
310  dtype **,
311  const int *,
312  const int *,
313  const int *);
314 #endif //USE_BATCH_GEMM
315 
316 }
317 #endif
void SSCAL(const int *n, float *dA, float *dX, const int *incX)
void CAXPY(const int *n, std::complex< float > *dA, const std::complex< float > *dX, const int *incX, std::complex< float > *dY, const int *incY)
void ZSCAL(const int *n, std::complex< double > *dA, std::complex< double > *dX, const int *incX)
void 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 *)
double DDOT(int *n, const double *dX, int *incX, const double *dY, int *incY)
#define SGEMM_BATCH
Definition: blas_symbs.h:32
#define ZGEMM_BATCH
Definition: blas_symbs.h:35
void SCOPY(const int *n, const float *dX, const int *incX, float *dY, const int *incY)
void ZAXPY(const int *n, std::complex< double > *dA, const std::complex< double > *dX, const int *incX, std::complex< double > *dY, const int *incY)
void CSCAL(const int *n, std::complex< float > *dA, std::complex< float > *dX, const int *incX)
void CGEMM(const char *, const char *, const int *, const int *, const int *, const std::complex< float > *, const std::complex< float > *, const int *, const std::complex< float > *, const int *, const std::complex< float > *, std::complex< float > *, const int *)
void DCOPY(const int *n, const double *dX, const int *incX, double *dY, const int *incY)
void DAXPY(const int *n, double *dA, const double *dX, const int *incX, double *dY, const int *incY)
void DSCAL(const int *n, double *dA, double *dX, const int *incX)
void SAXPY(const int *n, float *dA, const float *dX, const int *incX, float *dY, const int *incY)
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
void ZGEMM(const char *, const char *, const int *, const int *, const int *, const std::complex< double > *, const std::complex< double > *, const int *, const std::complex< double > *, const int *, const std::complex< double > *, std::complex< double > *, const int *)
void 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 *)
#define DGEMM_BATCH
Definition: blas_symbs.h:33
void ZCOPY(const int *n, const std::complex< double > *dX, const int *incX, std::complex< double > *dY, const int *incY)
#define CGEMM_BATCH
Definition: blas_symbs.h:34