precision_macros.h 8.1 KB
Newer Older
1
#ifdef REALCASE
2
3
#undef DOUBLE_PRECISION_REAL

4
5
#undef  MATH_DATATYPE
#undef  PRECISION
Pavel Kus's avatar
Pavel Kus committed
6
#undef  PRECISION_STR
7
#undef  REAL_DATATYPE
Andreas Marek's avatar
Andreas Marek committed
8

9
10
11
12
13
14
15
16
#undef  PRECISION_GEMV
#undef  PRECISION_TRMV
#undef  PRECISION_GEMM
#undef  PRECISION_TRMM
#undef  PRECISION_HERK
#undef  PRECISION_SYRK
#undef  PRECISION_SYMV
#undef  PRECISION_SYMM
17
18
#undef  PRECISION_HEMV
#undef  PRECISION_HER2
19
20
21
22
23
24
25
26
27
28
#undef  PRECISION_SYR2
#undef  PRECISION_SYR2K
#undef  PRECISION_GEQRF
#undef  PRECISION_STEDC
#undef  PRECISION_STEQR
#undef  PRECISION_LAMRG
#undef  PRECISION_LAMCH
#undef  PRECISION_LAPY2
#undef  PRECISION_LAED4
#undef  PRECISION_LAED5
29
30
31
#undef  cublas_PRECISION_GEMM
#undef  cublas_PRECISION_TRMM
#undef  cublas_PRECISION_GEMV
32
#undef  PRECISION_SUFFIX
Andreas Marek's avatar
Andreas Marek committed
33

34
35
36
37
38
39
40
#undef  CONST_0_0
#undef  CONST_0_5
#undef  CONST_1_0
#undef  CONST_2_0
#undef  CONST_8_0
#undef  size_of_PRECISION_real
#undef  MPI_REAL_PRECISION
41
#undef  C_DATATYPE_KIND
Andreas Marek's avatar
Andreas Marek committed
42

43
44
45
/* General definitions needed in single and real case */
#define  MATH_DATATYPE real

46
#ifdef DOUBLE_PRECISION
47
#define DOUBLE_PRECISION_REAL
48
#define  PRECISION double
Pavel Kus's avatar
Pavel Kus committed
49
#define  PRECISION_STR 'double'
Andreas Marek's avatar
Andreas Marek committed
50
#define  PRECISION_SUFFIX "_double"
51
#define  REAL_DATATYPE rk8
Andreas Marek's avatar
Andreas Marek committed
52

53
54
55
56
57
58
59
60
#define  PRECISION_GEMV DGEMV
#define  PRECISION_TRMV DTRMV
#define  PRECISION_GEMM DGEMM
#define  PRECISION_TRMM DTRMM
#define  PRECISION_HERK DHERK
#define  PRECISION_SYRK DSYRK
#define  PRECISION_SYMV DSYMV
#define  PRECISION_SYMM DSYMM
61
62
#define  PRECISION_HEMV DHEMV
#define  PRECISION_HER2 DHER2
63
64
65
66
67
68
69
70
71
72
#define  PRECISION_SYR2 DSYR2
#define  PRECISION_SYR2K DSYR2K
#define  PRECISION_GEQRF DGEQRF
#define  PRECISION_STEDC DSTEDC
#define  PRECISION_STEQR DSTEQR
#define  PRECISION_LAMRG DLAMRG
#define  PRECISION_LAMCH DLAMCH
#define  PRECISION_LAPY2 DLAPY2
#define  PRECISION_LAED4 DLAED4
#define  PRECISION_LAED5 DLAED5
73
74
75
#define  cublas_PRECISION_GEMM cublas_DGEMM
#define  cublas_PRECISION_TRMM cublas_DTRMM
#define  cublas_PRECISION_GEMV cublas_DGEMV
76
77
78
79
80
81
82
#define  CONST_0_0 0.0_rk8
#define  CONST_0_5 0.5_rk8
#define  CONST_1_0 1.0_rk8
#define  CONST_2_0 2.0_rk8
#define  CONST_8_0 8.0_rk8
#define  size_of_PRECISION_real size_of_double_real_datatype
#define  MPI_REAL_PRECISION MPI_REAL8
83
#define  C_DATATYPE_KIND c_double
84
85

#endif /* DOUBLE_PRECISION */
Andreas Marek's avatar
Andreas Marek committed
86

87
#ifdef SINGLE_PRECISION
88

89
#define  PRECISION single
Pavel Kus's avatar
Pavel Kus committed
90
#define  PRECISION_STR 'single'
Andreas Marek's avatar
Andreas Marek committed
91
#define  PRECISION_SUFFIX "_single"
92
#define  REAL_DATATYPE rk4
Andreas Marek's avatar
Andreas Marek committed
93

94
95
96
97
98
99
100
101
#define  PRECISION_GEMV SGEMV
#define  PRECISION_TRMV STRMV
#define  PRECISION_GEMM SGEMM
#define  PRECISION_TRMM STRMM
#define  PRECISION_HERK SHERK
#define  PRECISION_SYRK SSYRK
#define  PRECISION_SYMV SSYMV
#define  PRECISION_SYMM SSYMM
102
103
#define  PRECISION_HEMV SHEMV
#define  PRECISION_HER2 SHER2
104
105
106
107
108
109
110
111
112
113
#define  PRECISION_SYR2 SSYR2
#define  PRECISION_SYR2K SSYR2K
#define  PRECISION_GEQRF SGEQRF
#define  PRECISION_STEDC SSTEDC
#define  PRECISION_STEQR SSTEQR
#define  PRECISION_LAMRG SLAMRG
#define  PRECISION_LAMCH SLAMCH
#define  PRECISION_LAPY2 SLAPY2
#define  PRECISION_LAED4 SLAED4
#define  PRECISION_LAED5 SLAED5
114
115
116
#define  cublas_PRECISION_GEMM cublas_SGEMM
#define  cublas_PRECISION_TRMM cublas_STRMM
#define  cublas_PRECISION_GEMV cublas_SGEMV
117
118
119
120
121
122
123
#define  CONST_0_0 0.0_rk4
#define  CONST_0_5 0.5_rk4
#define  CONST_1_0 1.0_rk4
#define  CONST_2_0 2.0_rk4
#define  CONST_8_0 8.0_rk4
#define  size_of_PRECISION_real size_of_single_real_datatype
#define  MPI_REAL_PRECISION MPI_REAL4
124
#define  C_DATATYPE_KIND c_float
125
126
127
128

#endif /* SINGLE_PRECISION */

#endif /* REALCASE */
Andreas Marek's avatar
Andreas Marek committed
129

130
#ifdef COMPLEXCASE
131
132

#undef DOUBLE_PRECISION_COMPLEX
133
134
#undef  MATH_DATATYPE
#undef  PRECISION
135
136
137
138
#undef COMPLEX_DATATYPE
/* in the complex case also sometime real valued variables are needed */
#undef REAL_DATATYPE

Pavel Kus's avatar
Pavel Kus committed
139
#undef  PRECISION_STR
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#undef  PRECISION_GEMV
#undef  PRECISION_TRMV
#undef  PRECISION_GEMM
#undef  PRECISION_TRMM
#undef  PRECISION_HERK
#undef  PRECISION_SYRK
#undef  PRECISION_SYMV
#undef  PRECISION_SYMM
#undef  PRECISION_HEMV
#undef  PRECISION_HER2
#undef  PRECISION_SYR2
#undef  PRECISION_SYR2K
#undef  PRECISION_GEQRF
#undef  PRECISION_STEDC
#undef  PRECISION_STEQR
#undef  PRECISION_LAMRG
#undef  PRECISION_LAMCH
#undef  PRECISION_LAPY2
#undef  PRECISION_LAED4
#undef  PRECISION_LAED5
#undef  cublas_PRECISION_GEMM
#undef  cublas_PRECISION_TRMM
#undef  cublas_PRECISION_GEMV
#undef  PRECISION_SUFFIX
#undef  MPI_COMPLEX_PRECISION
#undef  MPI_COMPLEX_EXPLICIT_PRECISION
#undef  MPI_REAL_PRECISION
#undef  KIND_PRECISION
#undef  PRECISION_CMPLX
#undef  PRECISION_IMAG
#undef  PRECISION_REAL
#undef  CONST_REAL_0_0
#undef  CONST_REAL_1_0
#undef  CONST_REAL_0_5
#undef  CONST_COMPLEX_PAIR_0_0
#undef  CONST_COMPLEX_PAIR_1_0
#undef  CONST_COMPLEX_PAIR_NEGATIVE_1_0
#undef  CONST_COMPLEX_PAIR_NEGATIVE_0_5
#undef  CONST_COMPLEX_0_0
#undef  CONST_COMPLEX_1_0
#undef  size_of_PRECISION_complex
181
#undef  C_DATATYPE_KIND
182
183
184
185

/* General definitions needed in single and double case */
#define  MATH_DATATYPE complex

186
#ifdef DOUBLE_PRECISION
187
188

#define DOUBLE_PRECISION_COMPLEX
189
#define  PRECISION double
Pavel Kus's avatar
Pavel Kus committed
190
#define  PRECISION_STR 'double'
Andreas Marek's avatar
Andreas Marek committed
191
#define  PRECISION_SUFFIX "_double"
192
193
194
#define COMPLEX_DATATYPE CK8
#define REAL_DATATYPE RK8

195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#define  PRECISION_GEMV ZGEMV
#define  PRECISION_TRMV ZTRMV
#define  PRECISION_GEMM ZGEMM
#define  PRECISION_TRMM ZTRMM
#define  PRECISION_HERK ZHERK
#define  PRECISION_SYRK ZSYRK
#define  PRECISION_SYMV ZSYMV
#define  PRECISION_SYMM ZSYMM
#define  PRECISION_HEMV ZHEMV
#define  PRECISION_HER2 ZHER2
#define  PRECISION_SYR2 ZSYR2
#define  PRECISION_SYR2K ZSYR2K
#define  PRECISION_GEQRF ZGEQRF
#define  PRECISION_STEDC ZSTEDC
#define  PRECISION_STEQR ZSTEQR
#define  PRECISION_LAMRG ZLAMRG
#define  PRECISION_LAMCH ZLAMCH
#define  PRECISION_LAPY2 ZLAPY2
#define  PRECISION_LAED4 ZLAED4
#define  PRECISION_LAED5 ZLAED5
#define  cublas_PRECISION_GEMM cublas_ZGEMM
#define  cublas_PRECISION_TRMM cublas_ZTRMM
#define  cublas_PRECISION_GEMV cublas_ZGEMV
#define  MPI_COMPLEX_PRECISION MPI_DOUBLE_COMPLEX
#define  MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX16
#define  MPI_REAL_PRECISION MPI_REAL8
#define  KIND_PRECISION rk8
#define  PRECISION_CMPLX DCMPLX
#define  PRECISION_IMAG DIMAG
#define  PRECISION_REAL DREAL
#define  CONST_REAL_0_0 0.0_rk8
#define  CONST_REAL_1_0 1.0_rk8
#define  CONST_REAL_0_5 0.5_rk8
#define  CONST_COMPLEX_PAIR_0_0 (0.0_rk8,0.0_rk8)
#define  CONST_COMPLEX_PAIR_1_0 (1.0_rk8,0.0_rk8)
#define  CONST_COMPLEX_PAIR_NEGATIVE_1_0 (-1.0_rk8,0.0_rk8)
#define  CONST_COMPLEX_PAIR_NEGATIVE_0_5 (-0.5_rk8,0.0_rk8)
#define  CONST_COMPLEX_0_0 0.0_ck8
#define  CONST_COMPLEX_1_0 1.0_ck8
#define  size_of_PRECISION_complex size_of_double_complex_datatype
235
#define  C_DATATYPE_KIND c_double
236
237
238

#endif /* DOUBLE PRECISION */

239
240
#ifdef SINGLE_PRECISION
#define  PRECISION single
Pavel Kus's avatar
Pavel Kus committed
241
#define  PRECISION_STR 'single'
Andreas Marek's avatar
Andreas Marek committed
242
#define  PRECISION_SUFFIX "_single"
243
244
245
#define COMPLEX_DATATYPE CK4
#define REAL_DATATYPE RK4

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
#define  PRECISION_GEMV CGEMV
#define  PRECISION_TRMV CTRMV
#define  PRECISION_GEMM CGEMM
#define  PRECISION_TRMM CTRMM
#define  PRECISION_HERK CHERK
#define  PRECISION_SYRK CSYRK
#define  PRECISION_SYMV CSYMV
#define  PRECISION_SYMM CSYMM
#define  PRECISION_HEMV CHEMV
#define  PRECISION_HER2 CHER2
#define  PRECISION_SYR2 CSYR2
#define  PRECISION_SYR2K CSYR2K
#define  PRECISION_GEQRF CGEQRF
#define  PRECISION_STEDC CSTEDC
#define  PRECISION_STEQR CSTEQR
#define  PRECISION_LAMRG CLAMRG
#define  PRECISION_LAMCH CLAMCH
#define  PRECISION_LAPY2 CLAPY2
#define  PRECISION_LAED4 CLAED4
#define  PRECISION_LAED5 CLAED5
#define  cublas_PRECISION_GEMM cublas_CGEMM
#define  cublas_PRECISION_TRMM cublas_CTRMM
#define  cublas_PRECISION_GEMV cublas_CGEMV
#define  MPI_COMPLEX_PRECISION MPI_COMPLEX
#define  MPI_COMPLEX_EXPLICIT_PRECISION MPI_COMPLEX8
#define  MPI_REAL_PRECISION MPI_REAL4
#define  KIND_PRECISION rk4
#define  PRECISION_CMPLX CMPLX
#define  PRECISION_IMAG AIMAG
#define  PRECISION_REAL REAL
#define  CONST_REAL_0_0 0.0_rk4
#define  CONST_REAL_1_0 1.0_rk4
#define  CONST_REAL_0_5 0.5_rk4
#define  CONST_COMPLEX_PAIR_0_0 (0.0_rk4,0.0_rk4)
#define  CONST_COMPLEX_PAIR_1_0 (1.0_rk4,0.0_rk4)
#define  CONST_COMPLEX_PAIR_NEGATIVE_1_0 (-1.0_rk4,0.0_rk4)
#define  CONST_COMPLEX_PAIR_NEGATIVE_0_5 (-0.5_rk4,0.0_rk4)
#define  CONST_COMPLEX_0_0 0.0_ck4
#define  CONST_COMPLEX_1_0 1.0_ck4
#define  size_of_PRECISION_complex size_of_single_complex_datatype
286
#define  C_DATATYPE_KIND c_float
287
288
289
290

#endif /* SINGLE PRECISION */

#endif /* COMPLEXCASE */