00001
00015
00019 #ifndef _PLASMA_COMMON_H_
00020 #define _PLASMA_COMMON_H_
00021
00022 #if defined( _WIN32 ) || defined( _WIN64 )
00023 #include <io.h>
00024 #else
00025 #include <unistd.h>
00026 #endif
00027
00028 #include "global.h"
00029 #include "context.h"
00030 #include "control.h"
00031 #include "core_blas.h"
00032 #include "allocate.h"
00033 #include "auxiliary.h"
00034 #include "descriptor.h"
00035 #include "tile.h"
00036 #include "async.h"
00037
00038
00041 #define PLASMA_RANK plasma_rank(plasma)
00042 #define PLASMA_SIZE plasma->world_size
00043 #define PLASMA_GRPSIZE plasma->group_size
00044 #define PLASMA_NB plasma->nb
00045 #define PLASMA_IB plasma->ib
00046 #define PLASMA_NBNBSIZE plasma->nbnbsize
00047 #define PLASMA_IBNBSIZE plasma->ibnbsize
00048 #define PLASMA_INFO plasma->info
00049 #define PLASMA_SCHEDULING plasma->scheduling
00050 #define PLASMA_RHBLK plasma->rhblock
00051 #define PLASMA_TRANSLATION plasma->translation
00052
00053
00056 #define PlasmaIPT_NoDep 0
00057 #define PlasmaIPT_Panel 1
00058 #define PlasmaIPT_All 2
00059
00060
00063 #ifndef max
00064 #define max(a, b) ((a) > (b) ? (a) : (b))
00065 #endif
00066 #ifndef min
00067 #define min(a, b) ((a) < (b) ? (a) : (b))
00068 #endif
00069 #ifndef roundup
00070 #define roundup(a, b) (b <= 0) ? (a) : (((a) + (b)-1) & ~((b)-1))
00071 #endif
00072
00073
00076 #define ss_init(m, n, init_val) \
00077 { \
00078 if (PLASMA_RANK == 0) { \
00079 plasma->ss_progress = (volatile int *)plasma_shared_alloc(plasma, (m)*(n), PlasmaInteger); \
00080 plasma_memset_int((int*)plasma->ss_progress, (m)*(n), (init_val)); \
00081 } \
00082 plasma->ss_ld = (m); \
00083 plasma->ss_abort = 0; \
00084 plasma_barrier(plasma); \
00085 }
00086
00087 #define ss_abort() plasma->ss_abort = 1;
00088 #define ss_aborted() plasma->ss_abort
00089
00090 #define ss_cond_set(m, n, val) \
00091 { \
00092 plasma->ss_progress[(m)+plasma->ss_ld*(n)] = (val); \
00093 }
00094
00095 #define ss_cond_wait(m, n, val) \
00096 { \
00097 while (!plasma->ss_abort && \
00098 plasma->ss_progress[(m)+plasma->ss_ld*(n)] != (val)) \
00099 plasma_yield(); \
00100 if (plasma->ss_abort) \
00101 break; \
00102 }
00103
00104 #define ss_finalize() \
00105 { \
00106 plasma_barrier(plasma); \
00107 if (PLASMA_RANK == 0) \
00108 plasma_shared_free(plasma, (void*)plasma->ss_progress); \
00109 }
00110
00111
00114 extern char *plasma_lapack_constants[];
00115
00116 #ifdef __cplusplus
00117 extern "C" {
00118 #endif
00119
00120 #include "compute_s.h"
00121 #include "compute_d.h"
00122 #define COMPLEX
00123 #include "compute_c.h"
00124 #include "compute_z.h"
00125 #undef COMPLEX
00126
00127 void plasma_pdlag2s(plasma_context_t *plasma);
00128 void plasma_pzlag2c(plasma_context_t *plasma);
00129 void plasma_pslag2d(plasma_context_t *plasma);
00130 void plasma_pclag2z(plasma_context_t *plasma);
00131
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135
00136 #endif