2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
11 main (int argc
, char **argv
)
17 a
= (float *) malloc (N
* sizeof (float));
18 b
= (float *) malloc (N
* sizeof (float));
19 c
= (float *) malloc (N
* sizeof (float));
21 for (i
= 0; i
< N
; i
++)
27 #pragma acc parallel copyin (a[0:N]) copyout (b[0:N])
31 for (ii
= 0; ii
< N
; ii
++)
35 for (i
= 0; i
< N
; i
++)
41 if (acc_is_present (&a
[0], (N
* sizeof (float))))
44 if (acc_is_present (&b
[0], (N
* sizeof (float))))
47 for (i
= 0; i
< N
; i
++)
53 #pragma acc parallel copyin (a[0:N]) copyout (b[0:N])
57 for (ii
= 0; ii
< N
; ii
++)
61 for (i
= 0; i
< N
; i
++)
67 if (acc_is_present (&a
[0], (N
* sizeof (float))))
70 if (acc_is_present (&b
[0], (N
* sizeof (float))))
73 for (i
= 0; i
< N
; i
++)
79 d
= (float *) acc_copyin (&a
[0], N
* sizeof (float));
81 for (i
= 0; i
< N
; i
++)
86 #pragma acc parallel present_or_copyin (a[0:N]) copyout (b[0:N])
90 for (ii
= 0; ii
< N
; ii
++)
94 for (i
= 0; i
< N
; i
++)
100 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
103 if (acc_is_present (&b
[0], (N
* sizeof (float))))
108 for (i
= 0; i
< N
; i
++)
114 #pragma acc parallel copyin (a[0:N]) present_or_copyout (b[0:N])
118 for (ii
= 0; ii
< N
; ii
++)
122 for (i
= 0; i
< N
; i
++)
128 if (acc_is_present (&a
[0], (N
* sizeof (float))))
131 if (acc_is_present (&b
[0], (N
* sizeof (float))))
134 for (i
= 0; i
< N
; i
++)
140 d
= (float *) acc_copyin (&b
[0], N
* sizeof (float));
142 #pragma acc parallel copyin (a[0:N]) present_or_copyout (b[0:N])
146 for (ii
= 0; ii
< N
; ii
++)
150 for (i
= 0; i
< N
; i
++)
159 if (acc_is_present (&a
[0], (N
* sizeof (float))))
162 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
167 if (acc_is_present (&b
[0], (N
* sizeof (float))))
170 for (i
= 0; i
< N
; i
++)
176 #pragma acc parallel copy (a[0:N]) copyout (b[0:N])
180 for (ii
= 0; ii
< N
; ii
++)
187 for (i
= 0; i
< N
; i
++)
196 if (acc_is_present (&a
[0], (N
* sizeof (float))))
199 if (acc_is_present (&b
[0], (N
* sizeof (float))))
202 for (i
= 0; i
< N
; i
++)
208 #pragma acc parallel present_or_copy (a[0:N]) present_or_copy (b[0:N])
212 for (ii
= 0; ii
< N
; ii
++)
219 for (i
= 0; i
< N
; i
++)
228 if (acc_is_present (&a
[0], (N
* sizeof (float))))
231 if (acc_is_present (&b
[0], (N
* sizeof (float))))
234 for (i
= 0; i
< N
; i
++)
240 d
= (float *) acc_copyin (&a
[0], N
* sizeof (float));
241 d
= (float *) acc_copyin (&b
[0], N
* sizeof (float));
243 #pragma acc parallel present_or_copy (a[0:N]) present_or_copy (b[0:N])
247 for (ii
= 0; ii
< N
; ii
++)
254 for (i
= 0; i
< N
; i
++)
263 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
266 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
269 d
= (float *) acc_deviceptr (&a
[0]);
270 acc_unmap_data (&a
[0]);
273 d
= (float *) acc_deviceptr (&b
[0]);
274 acc_unmap_data (&b
[0]);
277 for (i
= 0; i
< N
; i
++)
283 #pragma acc parallel copyin (a[0:N]) create (c[0:N]) copyout (b[0:N])
287 for (ii
= 0; ii
< N
; ii
++)
294 for (i
= 0; i
< N
; i
++)
303 if (acc_is_present (&a
[0], (N
* sizeof (float))))
306 if (acc_is_present (&b
[0], (N
* sizeof (float))))
309 if (acc_is_present (&c
[0], (N
* sizeof (float))))
312 for (i
= 0; i
< N
; i
++)
318 #pragma acc parallel copyin (a[0:N]) present_or_create (c[0:N]) copyout (b[0:N])
322 for (ii
= 0; ii
< N
; ii
++)
329 for (i
= 0; i
< N
; i
++)
338 if (acc_is_present (&a
[0], (N
* sizeof (float))))
341 if (acc_is_present (&b
[0], (N
* sizeof (float))))
344 if (acc_is_present (&c
[0], (N
* sizeof (float))))
347 for (i
= 0; i
< N
; i
++)
353 d
= (float *) acc_malloc (N
* sizeof (float));
354 acc_map_data (c
, d
, N
* sizeof (float));
356 #pragma acc parallel copyin (a[0:N]) present_or_create (c[0:N]) copyout (b[0:N])
360 for (ii
= 0; ii
< N
; ii
++)
367 for (i
= 0; i
< N
; i
++)
376 if (acc_is_present (a
, (N
* sizeof (float))))
379 if (acc_is_present (b
, (N
* sizeof (float))))
382 if (!acc_is_present (c
, (N
* sizeof (float))))
385 d
= (float *) acc_deviceptr (c
);
391 for (i
= 0; i
< N
; i
++)
397 d
= (float *) acc_malloc (N
* sizeof (float));
398 acc_map_data (c
, d
, N
* sizeof (float));
400 #pragma acc parallel copyin (a[0:N]) present (c[0:N]) copyout (b[0:N])
404 for (ii
= 0; ii
< N
; ii
++)
411 for (i
= 0; i
< N
; i
++)
420 if (acc_is_present (a
, (N
* sizeof (float))))
423 if (acc_is_present (b
, (N
* sizeof (float))))
426 if (!acc_is_present (c
, (N
* sizeof (float))))
433 for (i
= 0; i
< N
; i
++)
439 acc_copyin (a
, N
* sizeof (float));
441 d
= (float *) acc_malloc (N
* sizeof (float));
442 acc_map_data (b
, d
, N
* sizeof (float));
444 d
= (float *) acc_malloc (N
* sizeof (float));
445 acc_map_data (c
, d
, N
* sizeof (float));
447 #pragma acc parallel present (a[0:N]) present (c[0:N]) present (b[0:N])
451 for (ii
= 0; ii
< N
; ii
++)
458 if (!acc_is_present (a
, (N
* sizeof (float))))
461 if (!acc_is_present (b
, (N
* sizeof (float))))
464 if (!acc_is_present (c
, (N
* sizeof (float))))
467 acc_copyout (b
, N
* sizeof (float));
469 for (i
= 0; i
< N
; i
++)
478 d
= (float *) acc_deviceptr (a
);
484 d
= (float *) acc_deviceptr (c
);
490 for (i
= 0; i
< N
; i
++)
496 d
= (float *) acc_malloc (N
* sizeof (float));
498 #pragma acc parallel copyin (a[0:N]) deviceptr (d) copyout (b[0:N])
502 for (ii
= 0; ii
< N
; ii
++)
509 for (i
= 0; i
< N
; i
++)
518 if (acc_is_present (a
, (N
* sizeof (float))))
521 if (acc_is_present (b
, (N
* sizeof (float))))
526 for (i
= 0; i
< N
; i
++)
532 d
= (float *) acc_copyin (&a
[0], N
* sizeof (float));
534 for (i
= 0; i
< N
; i
++)
539 #pragma acc parallel pcopyin (a[0:N]) copyout (b[0:N])
543 for (ii
= 0; ii
< N
; ii
++)
547 for (i
= 0; i
< N
; i
++)
553 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
556 if (acc_is_present (&b
[0], (N
* sizeof (float))))
561 for (i
= 0; i
< N
; i
++)
567 #pragma acc parallel copyin (a[0:N]) pcopyout (b[0:N])
571 for (ii
= 0; ii
< N
; ii
++)
575 for (i
= 0; i
< N
; i
++)
581 if (acc_is_present (&a
[0], (N
* sizeof (float))))
584 if (acc_is_present (&b
[0], (N
* sizeof (float))))
587 for (i
= 0; i
< N
; i
++)
593 #pragma acc parallel pcopy (a[0:N], b[0:N])
597 for (ii
= 0; ii
< N
; ii
++)
601 for (i
= 0; i
< N
; i
++)
607 if (acc_is_present (&a
[0], (N
* sizeof (float))))
610 if (acc_is_present (&b
[0], (N
* sizeof (float))))
613 for (i
= 0; i
< N
; i
++)
619 #pragma acc parallel copyin (a[0:N]) pcreate (c[0:N]) copyout (b[0:N])
623 for (ii
= 0; ii
< N
; ii
++)
630 for (i
= 0; i
< N
; i
++)
639 if (acc_is_present (&a
[0], (N
* sizeof (float))))
642 if (acc_is_present (&b
[0], (N
* sizeof (float))))
645 if (acc_is_present (&c
[0], (N
* sizeof (float))))