3 /* Test of worker-private variables declared in a local scope, broadcasting
4 to vector-partitioned mode. Aggregate worker variable. */
12 main (int argc
, char* argv
[])
14 int i
, arr
[32 * 32 * 32];
16 for (i
= 0; i
< 32 * 32 * 32; i
++)
19 #pragma acc kernels copy(arr)
23 #pragma acc loop gang(num:32)
24 for (i
= 0; i
< 32; i
++)
26 #pragma acc loop worker(num:32)
27 for (j
= 0; j
< 32; j
++)
35 #pragma acc loop vector(length:32)
36 for (k
= 0; k
< 32; k
++)
37 arr
[i
* 1024 + j
* 32 + k
] += pt
.x
* k
;
39 #pragma acc loop vector(length:32)
40 for (k
= 0; k
< 32; k
++)
41 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
46 for (i
= 0; i
< 32; i
++)
47 for (int j
= 0; j
< 32; j
++)
48 for (int k
= 0; k
< 32; k
++)
50 int idx
= i
* 1024 + j
* 32 + k
;
51 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);