2 /* { dg-additional-options "-fno-builtin-acc_on_device" } */
11 main(int argc
, char **argv
)
13 float *a
, *b
, *d_a
, *d_b
, exp
, exp2
;
19 a
= (float *) malloc (N
* sizeof (float));
20 b
= (float *) malloc (N
* sizeof (float));
21 d_a
= (float *) acc_malloc (N
* sizeof (float));
22 d_b
= (float *) acc_malloc (N
* sizeof (float));
24 for (i
= 0; i
< N
; i
++)
27 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(1)
31 for (ii
= 0; ii
< N
; ii
++)
33 if (acc_on_device (acc_device_host
))
46 for (i
= 0; i
< N
; i
++)
52 for (i
= 0; i
< N
; i
++)
55 #pragma acc parallel if(0)
59 for (ii
= 0; ii
< N
; ii
++)
61 if (acc_on_device (acc_device_host
))
68 for (i
= 0; i
< N
; i
++)
74 for (i
= 0; i
< N
; i
++)
77 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(one)
81 for (ii
= 0; ii
< N
; ii
++)
83 if (acc_on_device (acc_device_host
))
96 for (i
= 0; i
< N
; i
++)
102 for (i
= 0; i
< N
; i
++)
105 #pragma acc parallel if(zero)
109 for (ii
= 0; ii
< N
; ii
++)
111 if (acc_on_device (acc_device_host
))
118 for (i
= 0; i
< N
; i
++)
124 for (i
= 0; i
< N
; i
++)
127 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(true)
131 for (ii
= 0; ii
< N
; ii
++)
133 if (acc_on_device (acc_device_host
))
146 for (i
= 0; i
< N
; i
++)
152 for (i
= 0; i
< N
; i
++)
155 #pragma acc parallel if(false)
159 for (ii
= 0; ii
< N
; ii
++)
161 if (acc_on_device (acc_device_host
))
168 for (i
= 0; i
< N
; i
++)
174 for (i
= 0; i
< N
; i
++)
179 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(n)
183 for (ii
= 0; ii
< N
; ii
++)
185 if (acc_on_device (acc_device_host
))
198 for (i
= 0; i
< N
; i
++)
204 for (i
= 0; i
< N
; i
++)
209 #pragma acc parallel if(n)
213 for (ii
= 0; ii
< N
; ii
++)
215 if (acc_on_device (acc_device_host
))
222 for (i
= 0; i
< N
; i
++)
228 for (i
= 0; i
< N
; i
++)
233 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(n + n)
237 for (ii
= 0; ii
< N
; ii
++)
239 if (acc_on_device (acc_device_host
))
252 for (i
= 0; i
< N
; i
++)
258 for (i
= 0; i
< N
; i
++)
263 #pragma acc parallel if(n + n)
267 for (ii
= 0; ii
< N
; ii
++)
269 if (acc_on_device (acc_device_host
))
276 for (i
= 0; i
< N
; i
++)
282 for (i
= 0; i
< N
; i
++)
285 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(-2)
289 for (ii
= 0; ii
< N
; ii
++)
291 if (acc_on_device (acc_device_host
))
304 for (i
= 0; i
< N
; i
++)
310 for (i
= 0; i
< N
; i
++)
313 #pragma acc parallel copyin(a[0:N]) copyout(b[0:N]) if(one == 1)
317 for (ii
= 0; ii
< N
; ii
++)
319 if (acc_on_device (acc_device_host
))
332 for (i
= 0; i
< N
; i
++)
338 for (i
= 0; i
< N
; i
++)
341 #pragma acc parallel if(one == 0)
345 for (ii
= 0; ii
< N
; ii
++)
347 if (acc_on_device (acc_device_host
))
354 for (i
= 0; i
< N
; i
++)
360 for (i
= 0; i
< N
; i
++)
370 acc_map_data (a
, d_a
, N
* sizeof (float));
371 acc_map_data (b
, d_b
, N
* sizeof (float));
376 #pragma acc update device(a[0:N], b[0:N]) if(1)
378 for (i
= 0; i
< N
; i
++)
384 #pragma acc update host(a[0:N], b[0:N]) if(1)
386 for (i
= 0; i
< N
; i
++)
395 for (i
= 0; i
< N
; i
++)
401 #pragma acc update device(a[0:N], b[0:N]) if(0)
403 for (i
= 0; i
< N
; i
++)
409 #pragma acc update host(a[0:N], b[0:N]) if(1)
411 for (i
= 0; i
< N
; i
++)
420 for (i
= 0; i
< N
; i
++)
426 #pragma acc update device(a[0:N], b[0:N]) if(1)
428 for (i
= 0; i
< N
; i
++)
434 #pragma acc update host(a[0:N], b[0:N]) if(0)
436 for (i
= 0; i
< N
; i
++)
453 for (i
= 0; i
< N
; i
++)
459 #pragma acc data copyin(a[0:N]) copyout(b[0:N]) if(1)
461 #pragma acc parallel present(a[0:N])
465 for (ii
= 0; ii
< N
; ii
++)
472 for (i
= 0; i
< N
; i
++)
478 for (i
= 0; i
< N
; i
++)
484 #pragma acc data copyin(a[0:N]) copyout(b[0:N]) if(0)
487 if (acc_is_present (a
, N
* sizeof (float)))
492 if (acc_is_present (b
, N
* sizeof (float)))
497 for (i
= 0; i
< N
; i
++)
503 #pragma acc data copyin(a[0:N]) if(1)
506 if (!acc_is_present (a
, N
* sizeof (float)))
510 #pragma acc data copyout(b[0:N]) if(0)
513 if (acc_is_present (b
, N
* sizeof (float)))
517 #pragma acc data copyout(b[0:N]) if(1)
519 #pragma acc parallel present(a[0:N]) present(b[0:N])
523 for (ii
= 0; ii
< N
; ii
++)
531 if (acc_is_present (b
, N
* sizeof (float)))
537 for (i
= 0; i
< N
; i
++)
543 #ifdef XXX_TODO_ENTER_END_DATA