1 /* { dg-additional-options "-fopt-info-note-omp" }
2 { dg-additional-options "--param=openacc-privatization=noisy" }
3 { dg-additional-options "-foffload=-fopt-info-note-omp" }
4 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
5 for testing/documenting aspects of that functionality. */
9 /* Test of worker-private variables declared in a local scope, broadcasting
10 to vector-partitioned mode. Aggregate worker variable. */
18 main (int argc
, char* argv
[])
20 int i
, arr
[32 * 32 * 32];
22 for (i
= 0; i
< 32 * 32 * 32; i
++)
25 #pragma acc kernels copy(arr)
26 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
30 #pragma acc loop gang(num:32)
31 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
32 for (i
= 0; i
< 32; i
++)
34 #pragma acc loop worker(num:32)
35 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
36 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */
37 /* { dg-note {variable 'pt' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-3 } */
38 for (j
= 0; j
< 32; j
++)
46 #pragma acc loop vector(length:32)
47 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
48 for (k
= 0; k
< 32; k
++)
49 arr
[i
* 1024 + j
* 32 + k
] += pt
.x
* k
;
51 #pragma acc loop vector(length:32)
52 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */
53 for (k
= 0; k
< 32; k
++)
54 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
59 for (i
= 0; i
< 32; i
++)
60 for (int j
= 0; j
< 32; j
++)
61 for (int k
= 0; k
< 32; k
++)
63 int idx
= i
* 1024 + j
* 32 + k
;
64 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);