3 #include <gomp-constants.h>
5 #define N (32*32*32+17)
13 for (ix
= 0; ix
< N
;ix
++)
16 #pragma acc parallel num_workers(32) vector_length(32) copy(ary) copy(ondev)
18 #pragma acc loop worker
19 for (unsigned ix
= 0; ix
< N
; ix
++)
21 if (acc_on_device (acc_device_not_host
))
25 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
26 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
27 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
28 ary
[ix
] = (g
<< 16) | (w
<< 8) | v
;
36 for (ix
= 0; ix
< N
; ix
++)
45 expected
= (g
<< 16) | (w
<< 8) | v
;
48 if (ary
[ix
] != expected
)
51 printf ("ary[%d]=%x expected %x\n", ix
, ary
[ix
], expected
);