|
PLASMA 2.3.1
|
00001 00014 #ifndef _PLASMA_H_ 00015 #define _PLASMA_H_ 00016 00017 #define PLASMA_VERSION_MAJOR 2 00018 #define PLASMA_VERSION_MINOR 4 00019 #define PLASMA_VERSION_MICRO 0 00020 00021 #include <quark.h> 00022 00023 /* CBLAS requires for scalar arguments to be passed by address rather than by value */ 00024 #ifndef CBLAS_SADDR 00025 #define CBLAS_SADDR & 00026 #endif 00027 00031 #define PlasmaByte 0 00032 #define PlasmaInteger 1 00033 #define PlasmaRealFloat 2 00034 #define PlasmaRealDouble 3 00035 #define PlasmaComplexFloat 4 00036 #define PlasmaComplexDouble 5 00037 00041 typedef int PLASMA_enum; 00042 typedef int PLASMA_bool; 00043 typedef long PLASMA_index; 00044 typedef long PLASMA_size; 00045 00049 #define PLASMA_HAS_COMPLEX_H 1 00050 00051 #if defined(_WIN32) 00052 # include <float.h> 00053 # if defined(__INTEL_COMPILER) 00054 /* Fix name conflict within the cabs prototype (_Complex) that 00055 * conflicts with a C99 keyword. */ 00056 #define _Complex __ConflictingComplex 00057 #include <math.h> 00058 #undef _Complex 00059 #undef complex 00060 typedef float _Complex PLASMA_Complex32_t; 00061 typedef double _Complex PLASMA_Complex64_t; 00062 # else 00063 /* Use MS VC complex class */ 00064 #include <complex> 00065 typedef std::complex<float> PLASMA_Complex32_t; 00066 typedef std::complex<double> PLASMA_Complex64_t; 00067 /* For LAPACKE lapacke.h force usage of Windows C++ Complex types */ 00068 #define LAPACK_COMPLEX_CUSTOM 00069 #define lapack_complex_float std::complex<float> 00070 #define lapack_complex_double std::complex<double> 00071 #undef PLASMA_HAS_COMPLEX_H 00072 # endif 00073 # define isnan _isnan 00074 # define isinf !_finite 00075 00076 #else /* _WIN32 */ 00077 00078 typedef float _Complex PLASMA_Complex32_t; 00079 typedef double _Complex PLASMA_Complex64_t; 00080 00081 #endif 00082 00083 /* Sun doesn't ship the complex.h header. Sun Studio doesn't have it and older GCC compilers don't have it either. */ 00084 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(sun) || defined(__sun) 00085 #undef PLASMA_HAS_COMPLEX_H 00086 #endif 00087 00088 #ifdef PLASMA_HAS_COMPLEX_H 00089 #include <complex.h> 00090 #else 00091 00092 #ifdef __cplusplus 00093 extern "C" { 00094 #endif 00095 00096 /* These declarations will not clash with what C++ provides because the names in C++ are name-mangled. */ 00097 #if !defined(_WIN32) 00098 extern double cabs(PLASMA_Complex64_t z); 00099 extern PLASMA_Complex64_t conj(PLASMA_Complex64_t z); 00100 #endif 00101 extern float cabsf(PLASMA_Complex32_t z); 00102 extern double cimag(PLASMA_Complex64_t z); 00103 extern double creal(PLASMA_Complex64_t z); 00104 00105 #ifdef __cplusplus 00106 } 00107 #endif 00108 00109 #endif 00110 00129 typedef struct plasma_desc_t { 00130 void *mat; // pointer to the beginning of the matrix 00131 size_t A21; // pointer to the beginning of the matrix A21 00132 size_t A12; // pointer to the beginning of the matrix A12 00133 size_t A22; // pointer to the beginning of the matrix A22 00134 PLASMA_enum dtyp; // precision of the matrix 00135 int mb; // number of rows in a tile 00136 int nb; // number of columns in a tile 00137 int bsiz; // size in elements including padding 00138 int lm; // number of rows of the entire matrix 00139 int ln; // number of columns of the entire matrix 00140 int lm1; // number of tile rows of the A11 matrix - derived parameter 00141 int ln1; // number of tile columns of the A11 matrix - derived parameter 00142 int lmt; // number of tile rows of the entire matrix - derived parameter 00143 int lnt; // number of tile columns of the entire matrix - derived parameter 00144 int i; // row index to the beginning of the submatrix 00145 int j; // column index to the beginning of the submatrix 00146 int m; // number of rows of the submatrix 00147 int n; // number of columns of the submatrix 00148 int mt; // number of tile rows of the submatrix - derived parameter 00149 int nt; // number of tile columns of the submatrix - derived parameter 00150 } PLASMA_desc; 00151 00155 typedef struct plasma_request_t { 00156 PLASMA_enum status; // PLASMA_SUCCESS or appropriate error code 00157 } PLASMA_request; 00158 00159 #define PLASMA_REQUEST_INITIALIZER {PLASMA_SUCCESS} 00160 00165 typedef struct plasma_sequence_t { 00166 Quark_Sequence *quark_sequence; // QUARK sequence associated with PLASMA sequence 00167 PLASMA_bool status; // PLASMA_SUCCESS or appropriate error code 00168 PLASMA_request *request; // failed request 00169 } PLASMA_sequence; 00170 00180 #define PlasmaCM 101 00181 #define PlasmaRM 102 00182 #define PlasmaCCRB 103 00183 #define PlasmaCRRB 104 00184 #define PlasmaRCRB 105 00185 #define PlasmaRRRB 106 00186 00187 #define PlasmaNoTrans 111 00188 #define PlasmaTrans 112 00189 #define PlasmaConjTrans 113 00190 00191 #define PlasmaUpper 121 00192 #define PlasmaLower 122 00193 #define PlasmaUpperLower 123 00194 00195 #define PlasmaNonUnit 131 00196 #define PlasmaUnit 132 00197 00198 #define PlasmaLeft 141 00199 #define PlasmaRight 142 00200 00201 #define PlasmaOneNorm 171 00202 #define PlasmaRealOneNorm 172 00203 #define PlasmaTwoNorm 173 00204 #define PlasmaFrobeniusNorm 174 00205 #define PlasmaInfNorm 175 00206 #define PlasmaRealInfNorm 176 00207 #define PlasmaMaxNorm 177 00208 #define PlasmaRealMaxNorm 178 00209 00210 #define PlasmaDistUniform 201 00211 #define PlasmaDistSymmetric 202 00212 #define PlasmaDistNormal 203 00213 00214 #define PlasmaHermGeev 241 00215 #define PlasmaHermPoev 242 00216 #define PlasmaNonsymPosv 243 00217 #define PlasmaSymPosv 244 00218 00219 #define PlasmaNoPacking 291 00220 #define PlasmaPackSubdiag 292 00221 #define PlasmaPackSupdiag 293 00222 #define PlasmaPackColumn 294 00223 #define PlasmaPackRow 295 00224 #define PlasmaPackLowerBand 296 00225 #define PlasmaPackUpeprBand 297 00226 #define PlasmaPackAll 298 00227 00228 #define PlasmaNoVec 301 00229 #define PlasmaVec 302 00230 00231 #define PlasmaForward 391 00232 #define PlasmaBackward 392 00233 00234 #define PlasmaColumnwise 401 00235 #define PlasmaRowwise 402 00236 #define PlasmaTrd 1001 00237 #define PlasmaBrd 1002 00238 00239 00240 #define plasma_const_neg(const) (((const-1)^0x01)+1) 00241 00245 #define PLASMA_FALSE 0 00246 #define PLASMA_TRUE 1 00247 00251 #define PLASMA_WARNINGS 1 00252 #define PLASMA_ERRORS 2 00253 #define PLASMA_AUTOTUNING 3 00254 00258 #define PLASMA_CONCURRENCY 1 00259 #define PLASMA_TILE_SIZE 2 00260 #define PLASMA_INNER_BLOCK_SIZE 3 00261 #define PLASMA_SCHEDULING_MODE 4 00262 #define PLASMA_HOUSEHOLDER_MODE 5 00263 #define PLASMA_HOUSEHOLDER_SIZE 6 00264 #define PLASMA_TRANSLATION_MODE 7 00265 00266 #define PLASMA_STATIC_SCHEDULING 1 00267 #define PLASMA_DYNAMIC_SCHEDULING 2 00268 00269 #define PLASMA_FLAT_HOUSEHOLDER 1 00270 #define PLASMA_TREE_HOUSEHOLDER 2 00271 00272 #define PLASMA_INPLACE 1 00273 #define PLASMA_OUTOFPLACE 2 00274 00278 #define PLASMA_SUCCESS 0 00279 #define PLASMA_ERR_NOT_INITIALIZED -101 00280 #define PLASMA_ERR_REINITIALIZED -102 00281 #define PLASMA_ERR_NOT_SUPPORTED -103 00282 #define PLASMA_ERR_ILLEGAL_VALUE -104 00283 #define PLASMA_ERR_NOT_FOUND -105 00284 #define PLASMA_ERR_OUT_OF_RESOURCES -106 00285 #define PLASMA_ERR_INTERNAL_LIMIT -107 00286 #define PLASMA_ERR_UNALLOCATED -108 00287 #define PLASMA_ERR_FILESYSTEM -109 00288 #define PLASMA_ERR_UNEXPECTED -110 00289 #define PLASMA_ERR_SEQUENCE_FLUSHED -111 00290 00294 #include <plasma_z.h> 00295 #include <plasma_d.h> 00296 #include <plasma_c.h> 00297 #include <plasma_s.h> 00298 #include <plasma_zc.h> 00299 #include <plasma_ds.h> 00300 00301 #ifdef __cplusplus 00302 extern "C" { 00303 #endif 00304 00308 int PLASMA_Version(int *ver_major, int *ver_minor, int *ver_micro); 00309 int PLASMA_Enable(PLASMA_enum lever); 00310 int PLASMA_Disable(PLASMA_enum lever); 00311 int PLASMA_Set(PLASMA_enum param, int value); 00312 int PLASMA_Get(PLASMA_enum param, int *value); 00313 int PLASMA_Init(int cores); 00314 int PLASMA_Init_Affinity(int cores, int *bindtab); 00315 int PLASMA_Finalize(); 00316 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); 00317 int PLASMA_Desc_Destroy(PLASMA_desc **desc); 00318 int PLASMA_Lapack_to_Tile(void *Af77, int LDA, PLASMA_desc *A); 00319 int PLASMA_Tile_to_Lapack(PLASMA_desc *A, void *Af77, int LDA); 00320 00324 int PLASMA_Dealloc_Handle(void **handle); 00325 int PLASMA_Dealloc_Handle_Tile(PLASMA_desc **desc); 00326 00330 int PLASMA_Sequence_Create(PLASMA_sequence **sequence); 00331 int PLASMA_Sequence_Destroy(PLASMA_sequence *sequence); 00332 int PLASMA_Sequence_Wait(PLASMA_sequence *sequence); 00333 int PLASMA_Sequence_Flush(PLASMA_sequence *sequence, PLASMA_request *request); 00334 00335 #ifdef __cplusplus 00336 } 00337 #endif 00338 00339 #endif
1.7.3