3 #include <gomp-constants.h>
5 #define N (32*32*32+17)
11 int workersize
, vectorsize
;
13 #pragma acc parallel num_workers(32) vector_length(32) copy(ondev) \
14 copyout(workersize, vectorsize)
16 #pragma acc loop worker vector reduction (+:t)
17 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 val
= (g
<< 16) | (w
<< 8) | v
;
33 workersize
= __builtin_goacc_parlevel_size (GOMP_DIM_WORKER
);
34 vectorsize
= __builtin_goacc_parlevel_size (GOMP_DIM_VECTOR
);
37 for (ix
= 0; ix
< N
; ix
++)
43 int w
= (ix
/ vectorsize
) % workersize
;
44 int v
= ix
% vectorsize
;
46 val
= (g
<< 16) | (w
<< 8) | v
;
52 printf ("t=%x expected %x\n", t
, h
);