1 /* Tests for gang-private variables, 'atomic' access */
3 /* { dg-additional-options "-fopt-info-note-omp" }
4 { dg-additional-options "--param=openacc-privatization=noisy" }
5 { dg-additional-options "-foffload=-fopt-info-note-omp" }
6 { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
7 for testing/documenting aspects of that functionality. */
9 /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
10 passed to 'incr' may be unset, and in that case, it will be set to [...]",
11 so to maintain compatibility with earlier Tcl releases, we manually
12 initialize counter variables:
13 { dg-line l_dummy[variable c_compute 0 c_loop 0] }
14 { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
15 "WARNING: dg-line var l_dummy defined, but not used". */
26 #pragma acc parallel num_gangs(1444) num_workers(32) reduction(+: ret) /* { dg-line l_compute[incr c_compute] } */
27 /* { dg-note {variable 'w' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_compute$c_compute }
28 { dg-note {variable 'w' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_compute$c_compute }
29 { dg-note {variable 'w' adjusted for OpenACC privatization level: 'gang'} "" { target { ! openacc_host_selected } } l_compute$c_compute } */
30 /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
34 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
35 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
36 for (int i
= 0; i
< 2232; i
++)
38 #pragma acc atomic update
42 ret
= (w
== -22 + 2232);
44 if (acc_get_device_type () == acc_device_host
)
51 #pragma acc parallel num_gangs(1414) vector_length(32) reduction(+: ret) /* { dg-line l_compute[incr c_compute] } */
52 /* { dg-note {variable 'v' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_compute$c_compute }
53 { dg-note {variable 'v' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_compute$c_compute }
54 { dg-note {variable 'v' adjusted for OpenACC privatization level: 'gang'} "" { target { ! openacc_host_selected } } l_compute$c_compute } */
55 /* { dg-note {variable 'i' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
59 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
60 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
61 for (int i
= 0; i
< 3201; i
++)
63 #pragma acc atomic update
67 ret
= (v
== 10 + 3201);
69 if (acc_get_device_type () == acc_device_host
)
76 #pragma acc parallel num_gangs(314) reduction(+: ret) /* { dg-line l_compute[incr c_compute] } */
77 /* { dg-note {variable 'v' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_compute$c_compute }
78 { dg-note {variable 'v' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_compute$c_compute }
79 { dg-note {variable 'v' adjusted for OpenACC privatization level: 'gang'} "" { target { ! openacc_host_selected } } l_compute$c_compute } */
83 #pragma acc atomic update
85 #pragma acc atomic update
87 #pragma acc atomic update
90 ret
+= (v
== -222 + 3);
92 if (acc_get_device_type () == acc_device_host
)