1 typedef enum omp_allocator_handle_t
2 #if __cplusplus >= 201103L
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
;
18 int bar (int, int *, int);
19 omp_allocator_handle_t
baz (void);
24 int y
[16] = { 0 }, r
= 0, i
;
25 omp_allocator_handle_t h
= baz ();
26 #pragma omp parallel allocate (x) allocate (omp_default_mem_alloc : y) \
27 allocate ((omp_allocator_handle_t) omp_default_mem_alloc:z) firstprivate (x, y, z)
29 #pragma omp task private (x) firstprivate (z) allocate (omp_low_lat_mem_alloc:x,z)
32 #pragma omp target teams distribute parallel for private (x) firstprivate (y) \
33 allocate ((omp_allocator_handle_t)(omp_default_mem_alloc + 0):z) \
34 allocate (omp_default_mem_alloc: x, y) allocate (omp_low_lat_mem_alloc: r) \
35 lastprivate (z) reduction(+:r)
36 for (i
= 0; i
< 64; i
++)
41 #pragma omp single private (x) allocate (h:x)
43 #pragma omp single allocate (*&h : x) private (x)
45 #pragma omp parallel shared (r, x, z)
46 #pragma omp single firstprivate (r) allocate (x, r, z) private (x, z)
48 #pragma omp for allocate (x) private (x)
49 for (i
= 0; i
< 64; i
++)
51 #pragma omp sections private (x) allocate (omp_low_lat_mem_alloc: x)
59 #pragma omp taskgroup task_reduction(+:r) allocate (omp_default_mem_alloc : r)
60 #pragma omp task in_reduction(+:r) allocate (omp_default_mem_alloc : r)
62 #pragma omp teams private (x) firstprivate (y) allocate (h : x, y)
64 #pragma omp taskloop lastprivate (x) reduction (+:r) allocate (h : x, r)
65 for (i
= 0; i
< 16; i
++)
70 #pragma omp taskgroup task_reduction(+:r) allocate (omp_default_mem_alloc : r)
71 #pragma omp taskloop firstprivate (x) in_reduction (+:r) \
72 allocate (omp_default_mem_alloc : x, r)
73 for (i
= 0; i
< 16; i
++)
79 qux (const omp_allocator_handle_t h
)
82 #pragma omp parallel firstprivate (x) allocate (h: x)