10 #define MAX_OUTLINED_FUNC_PARAMETER_COUNT 256
22 extern double xomp_time_stamp(
void);
23 extern int env_region_instr_val;
35 extern void XOMP_init (
int argc,
char ** argv);
36 extern void xomp_init (
void);
37 extern void xomp_acc_init (
void);
40 extern void XOMP_terminate (
int exitcode);
47 extern void XOMP_parallel_start (
void (*func) (
void *),
void *data,
unsigned ifClauseValue,
unsigned numThreadsSpecified,
char* file_name,
int line_no);
48 extern void XOMP_parallel_end (
char* file_name,
int line_no);
51 extern int XOMP_sections_init_next(
int section_count);
54 extern int XOMP_sections_next(
void);
57 extern void XOMP_sections_end(
void);
60 extern void XOMP_sections_end_nowait(
void);
62 extern void XOMP_task (
void (*) (
void *),
void *,
void (*) (
void *,
void *),
63 long,
long,
bool,
unsigned);
64 extern void XOMP_taskwait (
void);
72 extern void XOMP_loop_default(
unsigned int lower,
unsigned int upper,
unsigned int stride,
long* n_lower,
long* n_upper);
76 extern void XOMP_loop_static_init(
int lower,
int upper,
int stride,
int chunk_size);
77 extern void XOMP_loop_dynamic_init(
int lower,
int upper,
int stride,
int chunk_size);
78 extern void XOMP_loop_guided_init(
int lower,
int upper,
int stride,
int chunk_size);
79 extern void XOMP_loop_runtime_init(
int lower,
int upper,
int stride);
82 extern void XOMP_loop_ordered_static_init(
int lower,
int upper,
int stride,
int chunk_size);
83 extern void XOMP_loop_ordered_dynamic_init(
int lower,
int upper,
int stride,
int chunk_size);
84 extern void XOMP_loop_ordered_guided_init(
int lower,
int upper,
int stride,
int chunk_size);
85 extern void XOMP_loop_ordered_runtime_init(
int lower,
int upper,
int stride);
93 extern bool XOMP_loop_static_start (
long,
long,
long,
long,
long *,
long *);
94 extern bool XOMP_loop_dynamic_start (
long,
long,
long,
long,
long *,
long *);
95 extern bool XOMP_loop_guided_start (
long,
long,
long,
long,
long *,
long *);
96 extern bool XOMP_loop_runtime_start (
long,
long,
long,
long *,
long *);
98 extern bool XOMP_loop_ordered_static_start (
long,
long,
long,
long,
long *,
long *);
99 extern bool XOMP_loop_ordered_dynamic_start (
long,
long,
long,
long,
long *,
long *);
100 extern bool XOMP_loop_ordered_guided_start (
long,
long,
long,
long,
long *,
long *);
101 extern bool XOMP_loop_ordered_runtime_start (
long,
long,
long,
long *,
long *);
104 extern bool XOMP_loop_static_next (
long *,
long *);
105 extern bool XOMP_loop_dynamic_next (
long *,
long *);
106 extern bool XOMP_loop_guided_next (
long *,
long *);
107 extern bool XOMP_loop_runtime_next (
long *,
long *);
109 extern bool XOMP_loop_ordered_static_next (
long *,
long *);
110 extern bool XOMP_loop_ordered_dynamic_next (
long *,
long *);
111 extern bool XOMP_loop_ordered_guided_next (
long *,
long *);
112 extern bool XOMP_loop_ordered_runtime_next (
long *,
long *);
119 extern void XOMP_static_even_divide (
long start,
long orig_size,
int chunk_count,
int chunk_id,
long * chunk_offset,
long * chunk_size);
123 extern void XOMP_barrier (
void);
124 extern void XOMP_critical_start (
void** data);
125 extern void XOMP_critical_end (
void** data);
126 extern bool XOMP_single(
void);
127 extern bool XOMP_master(
void);
129 extern void XOMP_atomic_start (
void);
130 extern void XOMP_atomic_end (
void);
132 extern void XOMP_loop_end (
void);
133 extern void XOMP_loop_end_nowait (
void);
136 extern void XOMP_flush_all (
void);
138 extern void XOMP_flush_one (
char * startAddress,
int nbyte);
142 extern void XOMP_ordered_start (
void);
143 extern void XOMP_ordered_end (
void);
149 extern void xomp_set_default_device (
int devID);
153 extern size_t xomp_get_maxThreadsPerBlock(
int devID);
156 extern size_t xomp_get_max1DBlock(
int devID,
size_t ss);
165 extern size_t xomp_get_max_threads_per_dimesion_2D (
int devID);
168 extern size_t xomp_get_maxSegmentsPerDimensionOf2DBlock(
int devID,
size_t dimension_size);
181 extern void* xomp_deviceMalloc(
size_t size);
184 extern void* xomp_hostMalloc(
size_t size);
187 extern double xomp_time_stamp();
191 extern void * xomp_memcpyHostToDevice (
void *dest,
const void * src,
size_t n_n);
192 extern void * xomp_memcpyDeviceToHost (
void *dest,
const void * src,
size_t n_n);
197 extern void * xomp_memcpyDynamicHostToDevice (
void *dest,
const void * src,
int * dimensions,
size_t dimension_size,
size_t element_size,
size_t *bytes_copied);
203 extern void * xomp_memcpyDynamicDeviceToHost (
void *dest,
int * dimensions,
size_t dimension_size,
const void * src,
size_t element_size,
size_t *bytes_copied);
205 extern void * xomp_memcpyDeviceToDevice (
void *dest,
const void * src,
size_t n_n);
206 extern void * xomp_memcpyHostToHost (
void *dest,
const void * src,
size_t n_n);
210 extern bool xomp_freeDevice(
void* devPtr);
212 extern bool xomp_freeHost(
void* hostPtr);
225 extern void * xomp_mallocArray(
int * dimensions,
size_t dimension_num,
size_t esize);
227 extern void xomp_freeArrayPointer (
void* array,
int * dimensions,
size_t dimension_num);
241 #define XOMP_REDUCTION_PLUS 6
242 #define XOMP_REDUCTION_MINUS 7
243 #define XOMP_REDUCTION_MUL 8
244 #define XOMP_REDUCTION_BITAND 9 // &
245 #define XOMP_REDUCTION_BITOR 10 // |
246 #define XOMP_REDUCTION_BITXOR 11 // ^
247 #define XOMP_REDUCTION_LOGAND 12 // &&
248 #define XOMP_REDUCTION_LOGOR 13 // ||
265 #define XOMP_BEYOND_BLOCK_REDUCTION_DECL(dtype) \
266 dtype xomp_beyond_block_reduction_##dtype(dtype * per_block_results, int numBlocks, int reduction_op);
268 XOMP_BEYOND_BLOCK_REDUCTION_DECL(
int)
269 XOMP_BEYOND_BLOCK_REDUCTION_DECL(
float)
270 XOMP_BEYOND_BLOCK_REDUCTION_DECL(
double)
272 #undef XOMP_BEYOND_BLOCK_REDUCTION_DECL
285 int loop_sched_index;
292 #define XOMP_MAX_MAPPED_VARS 256 // for simplicity, we use preallocated memory for storing the mapped variable list
324 int new_variable_count;
329 int inherited_variable_count;
340 extern int xomp_get_num_devices();
341 extern int xomp_get_max_devices(
void);
342 extern int xomp_num_devices;
343 extern int xomp_max_num_devices;
346 extern DDE** DDE_head;
348 extern DDE** DDE_tail;
350 extern void** xomp_cuda_prop;
354 extern void xomp_deviceDataEnvironmentEnter(
int devID);
363 extern void* xomp_deviceDataEnvironmentPrepareVariable(
int devID,
void* original_variable_address,
int nDim,
int typeSize,
int* size,
int* offset,
int* vDimSize,
bool copyTo,
bool copyFrom);
368 extern void* xomp_deviceDataEnvironmentGetInheritedVariable (
int devID,
void* original_variable_address,
int typeSize,
int* size);
372 extern void xomp_deviceDataEnvironmentAddVariable (
int devID,
void* var_addr,
int* var_size,
int* var_offset,
int* var_dim,
int nDim,
int typeSize,
void * dev_addr,
bool copyTo,
bool copyFrom);
376 extern void xomp_deviceDataEnvironmentExit(
int devID);