PLASMA: /home/mathieu/svn/plasma/trunk/tools/plasma_2.5.0/include/plasma.h Source File

PLASMA 2.4.6

- Main Page
- Modules
- Data Types List

All Data Structures Functions Groups
plasma.h
1
14 #ifndef _PLASMA_H_
15 #define _PLASMA_H_
16
17 #define PLASMA_VERSION_MAJOR 2
18 #define PLASMA_VERSION_MINOR 4
19 #define PLASMA_VERSION_MICRO 6
20
21 /* CBLAS requires for scalar arguments to be passed by address rather than by value */
22 #ifndef CBLAS_SADDR
23 #define CBLAS_SADDR( _val_ ) &(_val_)
24 #endif
25
29 #define PlasmaByte 0
30 #define PlasmaInteger 1
31 #define PlasmaRealFloat 2
32 #define PlasmaRealDouble 3
33 #define PlasmaComplexFloat 4
34 #define PlasmaComplexDouble 5
35
39 typedef int PLASMA_enum;
40 typedef int PLASMA_bool;
41 typedef long PLASMA_index;
42 typedef long PLASMA_size;
43
47 #define PLASMA_HAS_COMPLEX_H 1
48
49 #if defined(_WIN32)
50 # include <float.h>
51 # if defined(__INTEL_COMPILER)
52 /* Fix name conflict within the cabs prototype (_Complex) that
53 * conflicts with a C99 keyword. */
54 #define _Complex __ConflictingComplex
55 #include <math.h>
56 #undef _Complex
57 #undef complex
58 typedef float _Complex PLASMA_Complex32_t;
59 typedef double _Complex PLASMA_Complex64_t;
60 # else
61 /* Use MS VC complex class */
62 #include <complex>
63 typedef std::complex<float> PLASMA_Complex32_t;
64 typedef std::complex<double> PLASMA_Complex64_t;
65 /* For LAPACKE lapacke.h force usage of Windows C++ Complex types */
66 #define LAPACK_COMPLEX_CUSTOM
67 #define lapack_complex_float std::complex<float>
68 #define lapack_complex_double std::complex<double>
69 #undef PLASMA_HAS_COMPLEX_H
70 # endif
71 # define isnan _isnan
72 # define isinf !_finite
73
74 #else /* _WIN32 */
75
76 typedef float _Complex PLASMA_Complex32_t;
77 typedef double _Complex PLASMA_Complex64_t;
78
79 #endif
80
81 /* Sun doesn't ship the complex.h header. Sun Studio doesn't have it and older GCC compilers don't have it either. */
82 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(sun) || defined(__sun)
83 #undef PLASMA_HAS_COMPLEX_H
84 #endif
85
86 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
87 #define PLASMA_DEPRECATED __attribute__((__deprecated__))
88 #else
89 #define PLASMA_DEPRECATED
90 #endif /* __GNUC__ */
91
92 #ifdef PLASMA_HAS_COMPLEX_H
93 #include <complex.h>
94 #else
95
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99
100 /* These declarations will not clash with what C++ provides because the names in C++ are name-mangled. */
101 #if !defined(_WIN32)
102 extern double cabs(PLASMA_Complex64_t z);
103 extern PLASMA_Complex64_t conj(PLASMA_Complex64_t z);
104 #endif
105 extern float cabsf(PLASMA_Complex32_t z);
106 extern double cimag(PLASMA_Complex64_t z);
107 extern double creal(PLASMA_Complex64_t z);
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif
114
115 #include <quark.h>
116
135 typedef struct plasma_desc_t {
136 void *mat; // pointer to the beginning of the matrix
137 size_t A21; // pointer to the beginning of the matrix A21
138 size_t A12; // pointer to the beginning of the matrix A12
139 size_t A22; // pointer to the beginning of the matrix A22
140 PLASMA_enum dtyp; // precision of the matrix
141 int mb; // number of rows in a tile
142 int nb; // number of columns in a tile
143 int bsiz; // size in elements including padding
144 int lm; // number of rows of the entire matrix
145 int ln; // number of columns of the entire matrix
146 int lm1; // number of tile rows of the A11 matrix - derived parameter
147 int ln1; // number of tile columns of the A11 matrix - derived parameter
148 int lmt; // number of tile rows of the entire matrix - derived parameter
149 int lnt; // number of tile columns of the entire matrix - derived parameter
150 int i; // row index to the beginning of the submatrix
151 int j; // column index to the beginning of the submatrix
152 int m; // number of rows of the submatrix
153 int n; // number of columns of the submatrix
154 int mt; // number of tile rows of the submatrix - derived parameter
155 int nt; // number of tile columns of the submatrix - derived parameter
156 } PLASMA_desc;
157
161 typedef struct plasma_request_t {
162 PLASMA_enum status; // PLASMA_SUCCESS or appropriate error code
163 } PLASMA_request;
164
165 #define PLASMA_REQUEST_INITIALIZER {PLASMA_SUCCESS}
166
171 typedef struct plasma_sequence_t {
172 Quark_Sequence *quark_sequence; // QUARK sequence associated with PLASMA sequence
173 PLASMA_bool status; // PLASMA_SUCCESS or appropriate error code
174 PLASMA_request *request; // failed request
175 } PLASMA_sequence;
176
186 #define PlasmaRM 101
187 #define PlasmaCM 102
188 #define PlasmaCCRB 103
189 #define PlasmaCRRB 104
190 #define PlasmaRCRB 105
191 #define PlasmaRRRB 106
192
193 #define PlasmaNoTrans 111
194 #define PlasmaTrans 112
195 #define PlasmaConjTrans 113
196
197 #define PlasmaUpper 121
198 #define PlasmaLower 122
199 #define PlasmaUpperLower 123
200
201 #define PlasmaNonUnit 131
202 #define PlasmaUnit 132
203
204 #define PlasmaLeft 141
205 #define PlasmaRight 142
206
207 #define PlasmaOneNorm 171
208 #define PlasmaRealOneNorm 172
209 #define PlasmaTwoNorm 173
210 #define PlasmaFrobeniusNorm 174
211 #define PlasmaInfNorm 175
212 #define PlasmaRealInfNorm 176
213 #define PlasmaMaxNorm 177
214 #define PlasmaRealMaxNorm 178
215
216 #define PlasmaDistUniform 201
217 #define PlasmaDistSymmetric 202
218 #define PlasmaDistNormal 203
219
220 #define PlasmaHermGeev 241
221 #define PlasmaHermPoev 242
222 #define PlasmaNonsymPosv 243
223 #define PlasmaSymPosv 244
224
225 #define PlasmaNoPacking 291
226 #define PlasmaPackSubdiag 292
227 #define PlasmaPackSupdiag 293
228 #define PlasmaPackColumn 294
229 #define PlasmaPackRow 295
230 #define PlasmaPackLowerBand 296
231 #define PlasmaPackUpeprBand 297
232 #define PlasmaPackAll 298
233
234 #define PlasmaNoVec 301
235 #define PlasmaVec 302
236 #define PlasmaIvec 303
237
238 #define PlasmaForward 391
239 #define PlasmaBackward 392
240
241 #define PlasmaColumnwise 401
242 #define PlasmaRowwise 402
243 #define PlasmaTrd 1001
244 #define PlasmaBrd 1002
245
246 #define PlasmaW 501
247 #define PlasmaA2 502
248
249 #define plasma_const_neg(const) (((const-1)^0x01)+1)
250
254 #define PLASMA_FALSE 0
255 #define PLASMA_TRUE 1
256
260 #define PLASMA_WARNINGS 1
261 #define PLASMA_ERRORS 2
262 #define PLASMA_AUTOTUNING 3
263 #define PLASMA_DAG 4
264
268 #define PLASMA_CONCURRENCY 1
269 #define PLASMA_TILE_SIZE 2
270 #define PLASMA_INNER_BLOCK_SIZE 3
271 #define PLASMA_SCHEDULING_MODE 4
272 #define PLASMA_HOUSEHOLDER_MODE 5
273 #define PLASMA_HOUSEHOLDER_SIZE 6
274 #define PLASMA_TRANSLATION_MODE 7
275
276 #define PLASMA_STATIC_SCHEDULING 1
277 #define PLASMA_DYNAMIC_SCHEDULING 2
278
279 #define PLASMA_FLAT_HOUSEHOLDER 1
280 #define PLASMA_TREE_HOUSEHOLDER 2
281
282 #define PLASMA_INPLACE 1
283 #define PLASMA_OUTOFPLACE 2
284
288 #define PLASMA_SUCCESS 0
289 #define PLASMA_ERR_NOT_INITIALIZED -101
290 #define PLASMA_ERR_REINITIALIZED -102
291 #define PLASMA_ERR_NOT_SUPPORTED -103
292 #define PLASMA_ERR_ILLEGAL_VALUE -104
293 #define PLASMA_ERR_NOT_FOUND -105
294 #define PLASMA_ERR_OUT_OF_RESOURCES -106
295 #define PLASMA_ERR_INTERNAL_LIMIT -107
296 #define PLASMA_ERR_UNALLOCATED -108
297 #define PLASMA_ERR_FILESYSTEM -109
298 #define PLASMA_ERR_UNEXPECTED -110
299 #define PLASMA_ERR_SEQUENCE_FLUSHED -111
300
304 #include <plasma_z.h>
305 #include <plasma_d.h>
306 #include <plasma_c.h>
307 #include <plasma_s.h>
308 #include <plasma_zc.h>
309 #include <plasma_ds.h>
310
311 #ifdef __cplusplus
312 extern "C" {
313 #endif
314
318 int PLASMA_Version(int *ver_major, int *ver_minor, int *ver_micro);
319 int PLASMA_Enable(PLASMA_enum lever);
320 int PLASMA_Disable(PLASMA_enum lever);
321 int PLASMA_Set(PLASMA_enum param, int value);
322 int PLASMA_Get(PLASMA_enum param, int *value);
323 int PLASMA_Init(int cores);
324 int PLASMA_Init_Affinity(int cores, int *bindtab);
325 int PLASMA_Finalize();
326 int PLASMA_Desc_Create(PLASMA_desc **desc, void *mat, PLASMA_enum dtyp, int mb, int nb, int bsiz, int lm, int ln, int i, int j, int m, int n);
327 int PLASMA_Desc_Destroy(PLASMA_desc **desc);
328 int PLASMA_Lapack_to_Tile(void *Af77, int LDA, PLASMA_desc *A);
329 int PLASMA_Tile_to_Lapack(PLASMA_desc *A, void *Af77, int LDA);
330
334 int PLASMA_Dealloc_Handle(void **handle);
335 int PLASMA_Dealloc_Handle_Tile(PLASMA_desc **desc);
336
340 int PLASMA_Sequence_Create(PLASMA_sequence **sequence);
341 int PLASMA_Sequence_Destroy(PLASMA_sequence *sequence);
342 int PLASMA_Sequence_Wait(PLASMA_sequence *sequence);
343 int PLASMA_Sequence_Flush(PLASMA_sequence *sequence, PLASMA_request *request);
344
345 #ifdef __cplusplus
346 }
347 #endif
348
349 #endif