3 /* Test of gang-private array variable declared on loop directive, with
4 broadcasting to partitioned workers. */
7 main (int argc
, char* argv
[])
9 int x
[8], i
, arr
[32 * 32];
11 for (i
= 0; i
< 32 * 32; i
++)
14 #pragma acc kernels copy(arr)
16 #pragma acc loop gang(num:32) private(x)
17 for (i
= 0; i
< 32; i
++)
19 for (int j
= 0; j
< 8; j
++)
22 #pragma acc loop worker(num:32)
23 for (int j
= 0; j
< 32; j
++)
24 arr
[i
* 32 + j
] += x
[j
% 8];
28 for (i
= 0; i
< 32 * 32; i
++)
29 assert (arr
[i
] == i
+ (i
% 8) * 2);