3 #include <gomp-constants.h>
5 #define N (32*32*32+17)
12 #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) copy(ondev)
14 #pragma acc loop gang worker vector reduction(+:t)
15 for (unsigned ix
= 0; ix
< N
; ix
++)
19 if (acc_on_device (acc_device_not_host
))
23 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
24 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
25 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
26 val
= (g
<< 16) | (w
<< 8) | v
;
33 for (ix
= 0; ix
< N
; ix
++)
38 int chunk_size
= (N
+ 32*32*32 - 1) / (32*32*32);
40 int g
= ix
/ (chunk_size
* 32 * 32);
44 val
= (g
<< 16) | (w
<< 8) | v
;
50 printf ("t=%x expected %x\n", t
, h
);