3 /* Test of worker-private variables declared in a local scope, broadcasting
4 to vector-partitioned mode. Addressable 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
++)
36 #pragma acc loop vector(length:32)
37 for (k
= 0; k
< 32; k
++)
38 arr
[i
* 1024 + j
* 32 + k
] += ptp
->x
* k
;
42 #pragma acc loop vector(length:32)
43 for (k
= 0; k
< 32; k
++)
44 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
49 for (i
= 0; i
< 32; i
++)
50 for (int j
= 0; j
< 32; j
++)
51 for (int k
= 0; k
< 32; k
++)
53 int idx
= i
* 1024 + j
* 32 + k
;
54 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);