| 1 |
typedef enum omp_allocator_handle_t |
| 2 |
#if __cplusplus >= 201103L |
| 3 |
: __UINTPTR_TYPE__ |
| 4 |
#endif |
| 5 |
{ |
| 6 |
omp_null_allocator = 0, |
| 7 |
omp_default_mem_alloc = 1, |
| 8 |
omp_large_cap_mem_alloc = 2, |
| 9 |
omp_const_mem_alloc = 3, |
| 10 |
omp_high_bw_mem_alloc = 4, |
| 11 |
omp_low_lat_mem_alloc = 5, |
| 12 |
omp_cgroup_mem_alloc = 6, |
| 13 |
omp_pteam_mem_alloc = 7, |
| 14 |
omp_thread_mem_alloc = 8, |
| 15 |
__omp_allocator_handle_t_max__ = __UINTPTR_MAX__ |
| 16 |
} omp_allocator_handle_t; |
| 17 |
|
| 18 |
omp_allocator_handle_t baz (int); |
| 19 |
|
| 20 |
int |
| 21 |
foo (omp_allocator_handle_t h1, omp_allocator_handle_t h2, int y) |
| 22 |
{ |
| 23 |
int x; |
| 24 |
#pragma omp taskloop default(none) lastprivate (x) allocate (h1:x) firstprivate(y) allocate (h2:y) |
| 25 |
for (int i = 0; i < 64; i++) |
| 26 |
x = y + i; |
| 27 |
return x; |
| 28 |
} |
| 29 |
|
| 30 |
int |
| 31 |
bar (int y) |
| 32 |
{ |
| 33 |
int x; |
| 34 |
#pragma omp taskloop default(none) lastprivate (x) allocate (baz (0):x) allocate (baz (1):y) firstprivate(y) |
| 35 |
for (int i = 0; i < 64; i++) |
| 36 |
x = y + i; |
| 37 |
return x; |
| 38 |
} |