Go to the documentation of this file. 24 #ifndef __DEF_OPENMP_H__ 25 #define __DEF_OPENMP_H__ 28 #define STRINGIFY(x) STR(x) 29 #define CONCATENATE(x, y) x y 30 #define CONCATPARENTH(x, y) x ( y ) 36 #define TPI_PRAGMA_CLAUSE(directive, clause) _Pragma( STRINGIFY( CONCATENATE( directive, clause ) ) ) 37 #define TPI_PRAGMA(directive) _Pragma( STRINGIFY( directive ) ) 38 #define TPI_PRAGMA_PARENTH(directive, var) _Pragma( STRINGIFY( CONCATPARENTH( directive, var ) ) ) 42 #define TPI_PRAGMA_CLAUSE(directive, clause) 43 #define TPI_PRAGMA(directive) 44 #define TPI_PRAGMA_PARENTH(directive, var) 49 #define TPI_FOR_CLAUSE(clause) TPI_PRAGMA_CLAUSE( TPI_DIR_FOR, clause ) 50 #define TPI_FOR TPI_PRAGMA( TPI_DIR_FOR ) 51 #define TPI_PARA_CLAUSE(clause) TPI_PRAGMA_CLAUSE( TPI_DIR_PARA, clause ) 53 #define TPI_PARA_CLAUSE_SHARED(priv, clause) TPI_PRAGMA_CLAUSE( TPI_DIR_PARA, \ 54 TPI_CLAUSE_DEFAULT( shared ) \ 55 TPI_CLAUSE_PRIVATE( (priv) ) clause ) 57 #define TPI_PARA_SHARED TPI_PRAGMA_CLAUSE( TPI_DIR_PARA, \ 58 TPI_CLAUSE_DEFAULT( shared ) ) 60 #define TPI_PARA_SHARED_PRIVATE(priv) TPI_PRAGMA_CLAUSE( TPI_DIR_PARA, \ 61 TPI_CLAUSE_DEFAULT( shared ) \ 62 TPI_CLAUSE_PRIVATE( ( priv ) ) ) 64 #define TPI_PARA_CLAUSE_NONE(share, priv, clause) TPI_PRAGMA_CLAUSE( TPI_DIR_PARA, \ 65 TPI_CLAUSE_DEFAULT( (none) ) \ 66 TPI_CLAUSE_SHARED( (share) ) \ 67 TPI_CLAUSE_PRIVATE( (priv) ) clause ) 69 #define TPI_PARA TPI_PRAGMA( TPI_DIR_PARA ) 70 #define TPI_CRITICAL(var) TPI_PRAGMA_PARENTH( TPI_DIR_CRITICAL, var) 71 #define TPI_MASTER TPI_PRAGMA( TPI_DIR_MASTER ) 72 #define TPI_WAIT TPI_PRAGMA( TPI_DIR_WAIT ) 73 #define TPI_ORDERED TPI_PRAGMA( TPI_DIR_ORDERED ) 74 #define TPI_SINGLE TPI_PRAGMA( TPI_DIR_SINGLE ) 75 #define TPI_CLAUSE_SINGLE(clause) TPI_PRAGMA_CLAUSE( TPI_DIR_SINGLE, clause ) 76 #define TPI_TASK TPI_PRAGMA( TPI_DIR_TASK ) 77 #define TPI_TASK_SHARED TPI_PRAGMA_CLAUSE( TPI_DIR_TASK, \ 78 TPI_CLAUSE_DEFAULT(shared) ) 79 #define TPI_CLAUSE_TASK(clause) TPI_PRAGMA_CLAUSE( TPI_DIR_TASK, clause ) 80 #define TPI_TASKWAIT TPI_PRAGMA( TPI_DIR_TASKWAIT ) 84 #define TPI_DIR_PARA omp parallel 85 #define TPI_DIR_FOR omp for 86 #define TPI_DIR_CRITICAL omp critical 87 #define TPI_DIR_MASTER omp master 88 #define TPI_DIR_WAIT omp barrier 89 #define TPI_DIR_ORDERED omp ordered 90 #define TPI_DIR_TASK omp task 91 #define TPI_DIR_SINGLE omp single 92 #define TPI_DIR_TASKWAIT omp taskwait 96 #define TPI_CLAUSE_PRIVATE(var) CONCATENATE( private, var ) 97 #define TPI_CLAUSE_FSTPRIVATE(var) CONCATENATE( firstprivate, var ) 98 #define TPI_CLAUSE_LSTPRIVATE(var) CONCATENATE( lastprivate, var ) 99 #define TPI_CLAUSE_CPYPRIVATE(var) CONCATENATE( copyprivate, var ) 100 #define TPI_CLAUSE_NOWAIT nowait 101 #define TPI_CLAUSE_SHARED(var) CONCATENATE( shared, var ) 102 #define TPI_CLAUSE_DEFAULT(var) CONCATPARENTH( default, var ) 106 #define TPI_CLAUSE_REDUCE(op, var) CONCATENATE( reduction, CONCATENATE( CONCATENATE( op, : ), var ) ) 107 #define TPI_CLAUSE_ORDERED ordered 108 #define TPI_CLAUSE_IF(var) CONCATENATE( if, var ) 109 #define TPI_CLAUSE_NUMTHREADS(var) CONCATENATE( num_threads, var ) 110 #define TPI_CLAUSE_SCHEDULE(type) CONCATENATE( schedule, type ) 111 #define TPI_CLAUSE_SCHEDULE_CHUNK(type, chunk) CONCATENATE( schedule, CONCATPARENTH( type, chunk ) ) 112 #define TPI_CLAUSE_COPYIN(var) CONCATENATE( copyin, var ) 113 #define TPI_CLAUSE_FINAL(var) CONCATENATE( final, var ) 114 #define TPI_CLAUSE_UNTIED untied 115 #define TPI_CLAUSE_MERGEABLE mergeable 116 #define TPI_CLAUSE_DEPEND(type, var) CONCATENATE( depend, CONCATENATE( CONCATENATE( type, : ), var ) ) 117 #define TPI_CLAUSE_PRIORITY(var) CONCATENATE( priority, var ) 121 #define TPI_SHARED_DATA(name, members) struct TPI_Shared_Data { \ 125 #define TPI_PRIVATE_DATA(name, members) struct TPI_Private_Data { \ 129 #define TPI_FSTPRIVATE_DATA(name, members) struct TPI_FirstPrivate_Data { \ 133 #define TPI_LSTPRIVATE_DATA(name, members) struct TPI_LastPrivate_Data { \ 137 #define TPI_COPYIN_DATA(name, members) struct TPI_CopyIn_Data { \