1 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
2 aspects of that functionality. */
6 #include <gomp-constants.h>
8 #define N (32*32*32+17)
10 #pragma acc routine worker
11 void __attribute__ ((noinline
)) worker (int ary
[N
])
12 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
14 #pragma acc loop worker
15 for (unsigned ix
= 0; ix
< N
; ix
++)
17 if (acc_on_device (acc_device_not_host
))
21 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
22 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
23 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
24 ary
[ix
] = (g
<< 16) | (w
<< 8) | v
;
39 for (ix
= 0; ix
< N
;ix
++)
44 #pragma acc parallel num_workers(NW) vector_length(VL) \
47 ondev
= acc_on_device (acc_device_not_host
);
51 #ifdef ACC_DEVICE_TYPE_radeon
52 /* AMD GCN has an upper limit of 'num_workers(16)'. */
57 for (ix
= 0; ix
< N
; ix
++)
63 int w
= ix
% workersize
;
66 expected
= (g
<< 16) | (w
<< 8) | v
;
69 if (ary
[ix
] != expected
)
72 printf ("ary[%d]=%x expected %x\n", ix
, ary
[ix
], expected
);