2 /* { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } } */
11 main (int argc
, char **argv
)
15 float *d_a
, *d_b
, *d_c
;
18 a
= (float *) malloc (N
* sizeof (float));
19 b
= (float *) malloc (N
* sizeof (float));
20 c
= (float *) malloc (N
* sizeof (float));
22 d_a
= (float *) acc_malloc (N
* sizeof (float));
23 d_b
= (float *) acc_malloc (N
* sizeof (float));
24 d_c
= (float *) acc_malloc (N
* sizeof (float));
26 for (i
= 0; i
< N
; i
++)
32 acc_map_data (a
, d_a
, N
* sizeof (float));
33 acc_map_data (b
, d_b
, N
* sizeof (float));
34 acc_map_data (c
, d_c
, N
* sizeof (float));
36 #pragma acc update device (a[0:N], b[0:N])
38 #pragma acc parallel present (a[0:N], b[0:N])
42 for (ii
= 0; ii
< N
; ii
++)
46 #pragma acc update host (a[0:N], b[0:N])
48 for (i
= 0; i
< N
; i
++)
57 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
60 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
63 for (i
= 0; i
< N
; i
++)
69 #pragma acc update device (a[0:N], b[0:N])
71 #pragma acc parallel present (a[0:N], b[0:N])
75 for (ii
= 0; ii
< N
; ii
++)
79 #pragma acc update host (a[0:N], b[0:N])
81 for (i
= 0; i
< N
; i
++)
90 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
93 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
96 for (i
= 0; i
< N
; i
++)
102 #pragma acc update device (a[0:N], b[0:N])
104 #pragma acc parallel present (a[0:N], b[0:N])
108 for (ii
= 0; ii
< N
; ii
++)
112 #pragma acc update self (a[0:N], b[0:N])
114 for (i
= 0; i
< N
; i
++)
123 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
126 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
129 for (i
= 0; i
< N
; i
++)
135 #pragma acc update device (a[0:N], b[0:N])
137 for (i
= 0; i
< N
; i
++)
142 #pragma acc parallel present (a[0:N], b[0:N])
146 for (ii
= 0; ii
< N
; ii
++)
150 #pragma acc update host (a[0:N], b[0:N])
152 for (i
= 0; i
< N
; i
++)
161 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
164 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
167 for (i
= 0; i
< N
; i
++)
173 #pragma acc update device (a[0:N], b[0:N])
175 for (i
= 0; i
< N
; i
++)
180 #pragma acc parallel present (a[0:N], b[0:N])
184 for (ii
= 0; ii
< N
; ii
++)
188 #pragma acc update host (a[0:N], b[0:N])
190 for (i
= 0; i
< N
; i
++)
199 for (i
= 0; i
< N
; i
++)
204 #pragma acc update device (a[0:N])
206 #pragma acc parallel present (a[0:N], b[0:N])
210 for (ii
= 0; ii
< N
; ii
++)
214 #pragma acc update host (a[0:N], b[0:N])
216 for (i
= 0; i
< N
; i
++)
225 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
228 if (!acc_is_present (&b
[0], (N
* sizeof (float))))
231 for (i
= 0; i
< N
; i
++)
236 #pragma acc update device (a[0:N])
238 for (i
= 0; i
< N
; i
++)
243 #pragma acc update device (a[0:N >> 1])
245 #pragma acc parallel present (a[0:N], b[0:N])
249 for (ii
= 0; ii
< N
; ii
++)
253 #pragma acc update host (a[0:N], b[0:N])
255 for (i
= 0; i
< (N
>> 1); i
++)
264 for (i
= (N
>> 1); i
< N
; i
++)
273 if (!acc_is_present (&a
[0], (N
* sizeof (float))))
276 if (!acc_is_present (&b
[0], (N
* sizeof (float))))