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