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. */
7 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
8 aspects of that functionality. */
10 /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
11 passed to 'incr' may be unset, and in that case, it will be set to [...]",
12 so to maintain compatibility with earlier Tcl releases, we manually
13 initialize counter variables:
14 { dg-line l_dummy[variable c_compute 0 c_loop 0] }
15 { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
16 "WARNING: dg-line var l_dummy defined, but not used". */
31 /* Test of gang-private variables declared in local scope with parallel
38 for (i
= 0; i
< 32; i
++)
41 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
42 /* { dg-note {variable 'x' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
43 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } l_compute$c_compute } */
44 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
48 #pragma acc loop gang(static:1) /* { dg-line l_loop[incr c_loop] } */
49 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
50 for (i
= 0; i
< 32; i
++)
53 #pragma acc loop gang(static:1) /* { dg-line l_loop[incr c_loop] } */
54 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
55 for (i
= 0; i
< 32; i
++)
57 if (acc_on_device (acc_device_host
))
63 for (i
= 0; i
< 32; i
++)
64 assert (arr
[i
] == 3 + i
* 2);
68 /* Test of worker-private variables declared in a local scope, broadcasting
69 to vector-partitioned mode. Back-to-back worker loops. */
73 int i
, arr
[32 * 32 * 32];
75 for (i
= 0; i
< 32 * 32 * 32; i
++)
78 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
79 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
83 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
84 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
85 for (i
= 0; i
< 32; i
++)
87 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
88 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
89 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
90 /* { dg-note {variable 'x' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
91 for (j
= 0; j
< 32; j
++)
96 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
97 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
98 for (k
= 0; k
< 32; k
++)
99 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
102 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
103 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
104 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
105 /* { dg-note {variable 'x' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
106 for (j
= 0; j
< 32; j
++)
111 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
112 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
113 for (k
= 0; k
< 32; k
++)
114 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
119 for (i
= 0; i
< 32; i
++)
120 for (int j
= 0; j
< 32; j
++)
121 for (int k
= 0; k
< 32; k
++)
123 int idx
= i
* 1024 + j
* 32 + k
;
124 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
129 /* Test of worker-private variables declared in a local scope, broadcasting
130 to vector-partitioned mode. Successive vector loops. */
134 int i
, arr
[32 * 32 * 32];
136 for (i
= 0; i
< 32 * 32 * 32; i
++)
139 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
140 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
144 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
145 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
146 for (i
= 0; i
< 32; i
++)
148 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
149 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
150 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
151 /* { dg-note {variable 'x' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
152 for (j
= 0; j
< 32; j
++)
157 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
158 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
159 for (k
= 0; k
< 32; k
++)
160 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
164 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
165 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
166 for (k
= 0; k
< 32; k
++)
167 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
172 for (i
= 0; i
< 32; i
++)
173 for (int j
= 0; j
< 32; j
++)
174 for (int k
= 0; k
< 32; k
++)
176 int idx
= i
* 1024 + j
* 32 + k
;
177 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
182 /* Test of worker-private variables declared in a local scope, broadcasting
183 to vector-partitioned mode. Aggregate worker variable. */
187 int i
, arr
[32 * 32 * 32];
189 for (i
= 0; i
< 32 * 32 * 32; i
++)
192 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
193 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
197 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
198 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
199 for (i
= 0; i
< 32; i
++)
201 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
202 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
203 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
204 /* { dg-note {variable 'pt' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
205 for (j
= 0; j
< 32; j
++)
213 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
214 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
215 for (k
= 0; k
< 32; k
++)
216 arr
[i
* 1024 + j
* 32 + k
] += pt
.x
* k
;
218 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
219 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
220 for (k
= 0; k
< 32; k
++)
221 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
226 for (i
= 0; i
< 32; i
++)
227 for (int j
= 0; j
< 32; j
++)
228 for (int k
= 0; k
< 32; k
++)
230 int idx
= i
* 1024 + j
* 32 + k
;
231 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
236 /* Test of worker-private variables declared in a local scope, broadcasting
237 to vector-partitioned mode. Addressable worker variable. */
241 int i
, arr
[32 * 32 * 32];
243 for (i
= 0; i
< 32 * 32 * 32; i
++)
246 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
247 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
251 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
252 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
253 for (i
= 0; i
< 32; i
++)
255 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
256 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
257 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
258 /* { dg-note {variable 'pt' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop }
259 { dg-note {variable 'pt' ought to be adjusted for OpenACC privatization level: 'worker'} "" { target *-*-* } l_loop$c_loop }
260 { dg-note {variable 'pt' adjusted for OpenACC privatization level: 'worker'} "TODO" { target { ! openacc_host_selected } xfail *-*-* } l_loop$c_loop } */
261 /* { dg-note {variable 'ptp' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
262 for (j
= 0; j
< 32; j
++)
271 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
272 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
273 for (k
= 0; k
< 32; k
++)
274 arr
[i
* 1024 + j
* 32 + k
] += ptp
->x
* k
;
278 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
279 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
280 for (k
= 0; k
< 32; k
++)
281 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
286 for (i
= 0; i
< 32; i
++)
287 for (int j
= 0; j
< 32; j
++)
288 for (int k
= 0; k
< 32; k
++)
290 int idx
= i
* 1024 + j
* 32 + k
;
291 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
296 /* Test of worker-private variables declared in a local scope, broadcasting
297 to vector-partitioned mode. Array worker variable. */
301 int i
, arr
[32 * 32 * 32];
303 for (i
= 0; i
< 32 * 32 * 32; i
++)
306 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
307 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
311 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
312 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
313 for (i
= 0; i
< 32; i
++)
315 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
316 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
317 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
318 /* { dg-note {variable 'pt' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
319 for (j
= 0; j
< 32; j
++)
326 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
327 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
328 for (k
= 0; k
< 32; k
++)
329 arr
[i
* 1024 + j
* 32 + k
] += pt
[0] * k
;
333 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
334 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
335 for (k
= 0; k
< 32; k
++)
336 arr
[i
* 1024 + j
* 32 + k
] += pt
[1] * k
;
341 for (i
= 0; i
< 32; i
++)
342 for (int j
= 0; j
< 32; j
++)
343 for (int k
= 0; k
< 32; k
++)
345 int idx
= i
* 1024 + j
* 32 + k
;
346 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
351 /* Test of gang-private variables declared on loop directive. */
355 int x
= 5, i
, arr
[32];
357 for (i
= 0; i
< 32; i
++)
360 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
361 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } l_compute$c_compute } */
362 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
364 #pragma acc loop gang private(x) /* { dg-line l_loop[incr c_loop] } */
365 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
366 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
367 for (i
= 0; i
< 32; i
++)
374 for (i
= 0; i
< 32; i
++)
375 assert (arr
[i
] == i
* 3);
379 /* Test of gang-private variables declared on loop directive, with broadcasting
380 to partitioned workers. */
384 int x
= 5, i
, arr
[32 * 32];
386 for (i
= 0; i
< 32 * 32; i
++)
389 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
390 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
392 #pragma acc loop gang private(x) /* { dg-line l_loop[incr c_loop] } */
393 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
394 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
395 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
396 for (i
= 0; i
< 32; i
++)
400 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
401 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
402 for (int j
= 0; j
< 32; j
++)
403 arr
[i
* 32 + j
] += x
;
407 for (i
= 0; i
< 32 * 32; i
++)
408 assert (arr
[i
] == i
+ (i
/ 32) * 2);
412 /* Test of gang-private variables declared on loop directive, with broadcasting
413 to partitioned vectors. */
417 int x
= 5, i
, arr
[32 * 32];
419 for (i
= 0; i
< 32 * 32; i
++)
422 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
423 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } l_compute$c_compute } */
425 #pragma acc loop gang private(x) /* { dg-line l_loop[incr c_loop] } */
426 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
427 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
428 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
429 for (i
= 0; i
< 32; i
++)
433 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
434 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
435 for (int j
= 0; j
< 32; j
++)
436 arr
[i
* 32 + j
] += x
;
440 for (i
= 0; i
< 32 * 32; i
++)
441 assert (arr
[i
] == i
+ (i
/ 32) * 2);
445 /* Test of gang-private addressable variable declared on loop directive, with
446 broadcasting to partitioned workers. */
450 int x
= 5, i
, arr
[32 * 32];
452 for (i
= 0; i
< 32 * 32; i
++)
455 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
456 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
458 #pragma acc loop gang private(x) /* { dg-line l_loop[incr c_loop] } */
459 /* { dg-note {variable 'x' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop }
460 But, with optimizations enabled, per the '*.ssa' dump ('gcc/tree-ssa.c:execute_update_addresses_taken'):
461 No longer having address taken: x
462 Now a gimple register: x
463 However, 'x' remains in the candidate set:
464 { dg-note {variable 'x' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_loop$c_loop }
465 Now, for GCN offloading, 'adjust_private_decl' does the privatization change right away:
466 { dg-note {variable 'x' adjusted for OpenACC privatization level: 'gang'} "" { target openacc_radeon_accel_selected } l_loop$c_loop }
467 For nvptx offloading however, we first mark up 'x', and then later apply the privatization change -- or, with optimizations enabled, don't, because we then don't actually call 'expand_var_decl'.
468 { dg-note {variable 'x' adjusted for OpenACC privatization level: 'gang'} "" { target { openacc_nvidia_accel_selected && { ! __OPTIMIZE__ } } } l_loop$c_loop }
469 { dg-bogus {note: variable 'x' adjusted for OpenACC privatization level: 'gang'} "" { target { openacc_nvidia_accel_selected && __OPTIMIZE__ } } l_loop$c_loop }
471 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
472 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
473 /* { dg-note {variable 'p' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
474 for (i
= 0; i
< 32; i
++)
480 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
481 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
482 for (int j
= 0; j
< 32; j
++)
483 arr
[i
* 32 + j
] += x
;
489 for (i
= 0; i
< 32 * 32; i
++)
490 assert (arr
[i
] == i
+ (i
/ 32) * 2);
494 /* Test of gang-private array variable declared on loop directive, with
495 broadcasting to partitioned workers. */
499 int x
[8], i
, arr
[32 * 32];
501 for (i
= 0; i
< 32 * 32; i
++)
504 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
505 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
507 #pragma acc loop gang private(x) /* { dg-line l_loop[incr c_loop] } */
508 /* { dg-note {variable 'x' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop }
509 { dg-note {variable 'x' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_loop$c_loop }
510 { dg-note {variable 'x' adjusted for OpenACC privatization level: 'gang'} "" { target { ! openacc_host_selected } } l_loop$c_loop } */
511 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
512 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
513 for (i
= 0; i
< 32; i
++)
515 for (int j
= 0; j
< 8; j
++)
518 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
519 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
520 for (int j
= 0; j
< 32; j
++)
521 arr
[i
* 32 + j
] += x
[j
% 8];
525 for (i
= 0; i
< 32 * 32; i
++)
526 assert (arr
[i
] == i
+ (i
% 8) * 2);
530 /* Test of gang-private aggregate variable declared on loop directive, with
531 broadcasting to partitioned workers. */
538 for (i
= 0; i
< 32 * 32; i
++)
541 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
542 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
544 #pragma acc loop gang private(pt) /* { dg-line l_loop[incr c_loop] } */
545 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
546 /* { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
547 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
548 for (i
= 0; i
< 32; i
++)
555 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
556 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
557 for (int j
= 0; j
< 32; j
++)
558 arr
[i
* 32 + j
] += pt
.x
+ pt
.y
+ pt
.z
+ pt
.attr
[5];
562 for (i
= 0; i
< 32 * 32; i
++)
563 assert (arr
[i
] == i
+ (i
/ 32) * 13);
567 /* Test of vector-private variables declared on loop directive. */
571 int x
, i
, arr
[32 * 32 * 32];
573 for (i
= 0; i
< 32 * 32 * 32; i
++)
576 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
577 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
581 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
582 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
583 for (i
= 0; i
< 32; i
++)
585 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
586 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
587 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
588 for (j
= 0; j
< 32; j
++)
592 #pragma acc loop vector private(x) /* { dg-line l_loop[incr c_loop] } */
593 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
594 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
595 for (k
= 0; k
< 32; k
++)
598 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
601 #pragma acc loop vector private(x) /* { dg-line l_loop[incr c_loop] } */
602 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
603 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
604 for (k
= 0; k
< 32; k
++)
607 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
613 for (i
= 0; i
< 32; i
++)
614 for (int j
= 0; j
< 32; j
++)
615 for (int k
= 0; k
< 32; k
++)
617 int idx
= i
* 1024 + j
* 32 + k
;
618 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
623 /* Test of vector-private variables declared on loop directive. Array type. */
627 int pt
[2], i
, arr
[32 * 32 * 32];
629 for (i
= 0; i
< 32 * 32 * 32; i
++)
632 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
633 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
637 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
638 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
639 for (i
= 0; i
< 32; i
++)
641 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
642 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
643 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
644 for (j
= 0; j
< 32; j
++)
648 #pragma acc loop vector private(pt) /* { dg-line l_loop[incr c_loop] } */
649 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
650 /* { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
651 for (k
= 0; k
< 32; k
++)
655 arr
[i
* 1024 + j
* 32 + k
] += pt
[0] * k
;
656 arr
[i
* 1024 + j
* 32 + k
] += pt
[1] * k
;
662 for (i
= 0; i
< 32; i
++)
663 for (int j
= 0; j
< 32; j
++)
664 for (int k
= 0; k
< 32; k
++)
666 int idx
= i
* 1024 + j
* 32 + k
;
667 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
672 /* Test of worker-private variables declared on a loop directive. */
676 int x
= 5, i
, arr
[32 * 32];
678 for (i
= 0; i
< 32 * 32; i
++)
681 #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
682 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
683 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
687 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
688 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
689 for (i
= 0; i
< 32; i
++)
691 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
692 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
693 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
694 for (j
= 0; j
< 32; j
++)
697 /* Try to ensure 'x' accesses doesn't get optimized into a
699 __asm__
__volatile__ ("");
700 arr
[i
* 32 + j
] += x
;
705 for (i
= 0; i
< 32 * 32; i
++)
706 assert (arr
[i
] == i
+ ((i
/ 32) ^ (i
% 32) * 3));
710 /* Test of worker-private variables declared on a loop directive, broadcasting
711 to vector-partitioned mode. */
715 int x
= 5, i
, arr
[32 * 32 * 32];
717 for (i
= 0; i
< 32 * 32 * 32; i
++)
720 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
721 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
725 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
726 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
727 for (i
= 0; i
< 32; i
++)
729 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
730 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
731 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
732 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
733 for (j
= 0; j
< 32; j
++)
738 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
739 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
740 for (k
= 0; k
< 32; k
++)
741 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
746 for (i
= 0; i
< 32; i
++)
747 for (int j
= 0; j
< 32; j
++)
748 for (int k
= 0; k
< 32; k
++)
750 int idx
= i
* 1024 + j
* 32 + k
;
751 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
);
756 /* Test of worker-private variables declared on a loop directive, broadcasting
757 to vector-partitioned mode. Back-to-back worker loops. */
761 int x
= 5, i
, arr
[32 * 32 * 32];
763 for (i
= 0; i
< 32 * 32 * 32; i
++)
766 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
767 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
771 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
772 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
773 for (i
= 0; i
< 32; i
++)
775 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
776 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
777 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
778 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
779 for (j
= 0; j
< 32; j
++)
784 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
785 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
786 for (k
= 0; k
< 32; k
++)
787 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
790 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
791 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
792 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
793 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
794 for (j
= 0; j
< 32; j
++)
799 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
800 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
801 for (k
= 0; k
< 32; k
++)
802 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
807 for (i
= 0; i
< 32; i
++)
808 for (int j
= 0; j
< 32; j
++)
809 for (int k
= 0; k
< 32; k
++)
811 int idx
= i
* 1024 + j
* 32 + k
;
812 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
817 /* Test of worker-private variables declared on a loop directive, broadcasting
818 to vector-partitioned mode. Successive vector loops. */
822 int x
= 5, i
, arr
[32 * 32 * 32];
824 for (i
= 0; i
< 32 * 32 * 32; i
++)
827 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
828 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
832 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
833 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
834 for (i
= 0; i
< 32; i
++)
836 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
837 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
838 /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
839 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
840 for (j
= 0; j
< 32; j
++)
845 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
846 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
847 for (k
= 0; k
< 32; k
++)
848 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
852 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
853 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
854 for (k
= 0; k
< 32; k
++)
855 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
860 for (i
= 0; i
< 32; i
++)
861 for (int j
= 0; j
< 32; j
++)
862 for (int k
= 0; k
< 32; k
++)
864 int idx
= i
* 1024 + j
* 32 + k
;
865 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
870 /* Test of worker-private variables declared on a loop directive, broadcasting
871 to vector-partitioned mode. Addressable worker variable. */
875 int x
= 5, i
, arr
[32 * 32 * 32];
877 for (i
= 0; i
< 32 * 32 * 32; i
++)
880 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
881 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
885 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
886 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
887 for (i
= 0; i
< 32; i
++)
889 #pragma acc loop worker private(x) /* { dg-line l_loop[incr c_loop] } */
890 /* { dg-note {variable 'x' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_loop$c_loop }
891 { dg-note {variable 'x' ought to be adjusted for OpenACC privatization level: 'worker'} "" { target *-*-* } l_loop$c_loop }
892 { dg-note {variable 'x' adjusted for OpenACC privatization level: 'worker'} "TODO" { target { ! openacc_host_selected } xfail *-*-* } l_loop$c_loop } */
893 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
894 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
895 /* { dg-note {variable 'p' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
896 for (j
= 0; j
< 32; j
++)
903 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
904 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
905 for (k
= 0; k
< 32; k
++)
906 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
910 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
911 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
912 for (k
= 0; k
< 32; k
++)
913 arr
[i
* 1024 + j
* 32 + k
] += x
* k
;
918 for (i
= 0; i
< 32; i
++)
919 for (int j
= 0; j
< 32; j
++)
920 for (int k
= 0; k
< 32; k
++)
922 int idx
= i
* 1024 + j
* 32 + k
;
923 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
928 /* Test of worker-private variables declared on a loop directive, broadcasting
929 to vector-partitioned mode. Aggregate worker variable. */
933 int i
, arr
[32 * 32 * 32];
936 for (i
= 0; i
< 32 * 32 * 32; i
++)
939 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
940 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
944 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
945 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
946 for (i
= 0; i
< 32; i
++)
948 #pragma acc loop worker private(pt) /* { dg-line l_loop[incr c_loop] } */
949 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
950 /* { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
951 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
952 for (j
= 0; j
< 32; j
++)
959 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
960 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
961 for (k
= 0; k
< 32; k
++)
962 arr
[i
* 1024 + j
* 32 + k
] += pt
.x
* k
;
964 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
965 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
966 for (k
= 0; k
< 32; k
++)
967 arr
[i
* 1024 + j
* 32 + k
] += pt
.y
* k
;
972 for (i
= 0; i
< 32; i
++)
973 for (int j
= 0; j
< 32; j
++)
974 for (int k
= 0; k
< 32; k
++)
976 int idx
= i
* 1024 + j
* 32 + k
;
977 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
982 /* Test of worker-private variables declared on loop directive, broadcasting
983 to vector-partitioned mode. Array worker variable. */
987 int i
, arr
[32 * 32 * 32];
990 for (i
= 0; i
< 32 * 32 * 32; i
++)
993 /* "pt" is treated as "present_or_copy" on the parallel directive because it
994 is an array variable. */
995 #pragma acc parallel copy(arr) num_gangs(32) num_workers(32) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
996 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
1000 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
1001 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1002 for (i
= 0; i
< 32; i
++)
1004 /* But here, it is made private per-worker. */
1005 #pragma acc loop worker private(pt) /* { dg-line l_loop[incr c_loop] } */
1006 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1007 /* { dg-note {variable 'pt' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1008 /* { dg-note {variable 'k' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1009 for (j
= 0; j
< 32; j
++)
1015 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
1016 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1017 for (k
= 0; k
< 32; k
++)
1018 arr
[i
* 1024 + j
* 32 + k
] += pt
[0] * k
;
1022 #pragma acc loop vector /* { dg-line l_loop[incr c_loop] } */
1023 /* { dg-note {variable 'k' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1024 for (k
= 0; k
< 32; k
++)
1025 arr
[i
* 1024 + j
* 32 + k
] += pt
[1] * k
;
1030 for (i
= 0; i
< 32; i
++)
1031 for (int j
= 0; j
< 32; j
++)
1032 for (int k
= 0; k
< 32; k
++)
1034 int idx
= i
* 1024 + j
* 32 + k
;
1035 assert (arr
[idx
] == idx
+ (i
^ j
* 3) * k
+ (i
| j
* 5) * k
);
1040 /* Test of gang-private variables declared on the parallel directive. */
1044 int x
= 5, i
, arr
[32];
1046 for (i
= 0; i
< 32; i
++)
1049 #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(8) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
1050 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } l_compute$c_compute } */
1051 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
1053 #pragma acc loop gang(static:1) /* { dg-line l_loop[incr c_loop] } */
1054 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1055 for (i
= 0; i
< 32; i
++)
1058 #pragma acc loop gang(static:1) /* { dg-line l_loop[incr c_loop] } */
1059 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1060 for (i
= 0; i
< 32; i
++)
1062 if (acc_on_device (acc_device_host
))
1068 for (i
= 0; i
< 32; i
++)
1069 assert (arr
[i
] == 3 + i
* 2);
1073 /* Test of gang-private array variable declared on the parallel directive. */
1077 int x
[32], i
, arr
[32 * 32];
1079 for (i
= 0; i
< 32 * 32; i
++)
1082 #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(2) vector_length(32) /* { dg-line l_compute[incr c_compute] } */
1083 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } l_compute$c_compute } */
1085 #pragma acc loop gang /* { dg-line l_loop[incr c_loop] } */
1086 /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1087 /* { dg-note {variable 'j' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1088 for (i
= 0; i
< 32; i
++)
1091 for (j
= 0; j
< 32; j
++)
1094 #pragma acc loop worker /* { dg-line l_loop[incr c_loop] } */
1095 /* { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_loop$c_loop } */
1096 for (j
= 0; j
< 32; j
++)
1097 arr
[i
* 32 + j
] += x
[31 - j
];
1101 for (i
= 0; i
< 32 * 32; i
++)
1102 assert (arr
[i
] == i
+ (31 - (i
% 32)) * 2);