| 1 |
/* PR debug/104517 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O1 -fcompare-debug -fopenmp -fno-tree-ter -save-temps" } */ |
| 4 |
|
| 5 |
typedef enum omp_allocator_handle_t |
| 6 |
{ |
| 7 |
omp_null_allocator = 0, |
| 8 |
omp_default_mem_alloc = 1, |
| 9 |
omp_large_cap_mem_alloc = 2, |
| 10 |
omp_const_mem_alloc = 3, |
| 11 |
omp_high_bw_mem_alloc = 4, |
| 12 |
} omp_allocator_handle_t; |
| 13 |
|
| 14 |
int t, bar_nte, bar_tl, bar_i3, bar_dd; |
| 15 |
|
| 16 |
#pragma omp threadprivate(t) |
| 17 |
#pragma omp declare target |
| 18 |
int f, l, ll, r, r2; |
| 19 |
#pragma omp end declare target |
| 20 |
|
| 21 |
void |
| 22 |
bar (int *idp, int s, int nth, int g, int nta, int fi, int pp, int *q, |
| 23 |
int ntm) |
| 24 |
{ |
| 25 |
int p = 0, i2 = 0, i1 = 0, m = 0, d = 0; |
| 26 |
|
| 27 |
#pragma omp target parallel for \ |
| 28 |
device(p) firstprivate (f) allocate (omp_default_mem_alloc:f) in_reduction(+:r2) |
| 29 |
for (int i = 0; i < 4; i++) |
| 30 |
ll++; |
| 31 |
|
| 32 |
#pragma omp target parallel for \ |
| 33 |
device(d) map (m) \ |
| 34 |
if (target: p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \ |
| 35 |
if (parallel: i2) reduction(+:r) num_threads (nth) linear (ll) \ |
| 36 |
schedule(static) collapse(1) nowait depend(inout: d) \ |
| 37 |
allocate (omp_default_mem_alloc:f) in_reduction(+:r2) |
| 38 |
for (int i = 0; i < 4; i++) |
| 39 |
ll++; |
| 40 |
|
| 41 |
#pragma omp taskloop simd firstprivate(f) lastprivate(s) grainsize(g) \ |
| 42 |
collapse(1) untied if (i1) final(fi) mergeable nogroup \ |
| 43 |
priority(pp) linear(ll) aligned(q) allocate(f) |
| 44 |
for (int i = 0; i < 4; i++) |
| 45 |
ll++; |
| 46 |
|
| 47 |
#pragma omp taskloop simd firstprivate(f) lastprivate(s) num_tasks(nta) \ |
| 48 |
collapse(1) if (i1) final(fi) priority(pp) safelen(8) simdlen(4) \ |
| 49 |
linear(ll) aligned(q) nontemporal(ntm) order(concurrent) allocate(f) |
| 50 |
for (int i = 0; i < 4; i++) |
| 51 |
ll++; |
| 52 |
|
| 53 |
#pragma omp parallel master firstprivate(f) shared(nth) proc_bind(spread) \ |
| 54 |
copyin(t) allocate(f) |
| 55 |
; |
| 56 |
} |