2 ! { dg-additional-options "-cpp" }
8 integer, parameter :: N
= 8
9 integer, parameter :: one
= 1
10 integer, parameter :: zero
= 0
12 real, allocatable
:: a(:), b(:)
22 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
24 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
39 if (b(i
) .ne
. exp
) call abort
44 !$acc parallel if (0 == 1)
46 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
55 if (b(i
) .ne
. 17.0) call abort
60 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
62 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
77 if (b(i
) .ne
. exp
) call abort
82 !$acc parallel if (zero == 1)
84 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
93 if (b(i
) .ne
. 23.0) call abort
98 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.)
100 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
115 if (b(i
) .ne
. exp
) call abort
120 !$acc parallel if (.FALSE.)
122 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
131 if (b(i
) .ne
. 77.0) call abort
138 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (nn == 1)
140 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
155 if (b(i
) .ne
. exp
) call abort
162 !$acc parallel if (nn == 1)
164 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
173 if (b(i
) .ne
. 19.0) call abort
180 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
182 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
197 if (b(i
) .ne
. exp
) call abort
204 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
206 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
215 if (b(i
) .ne
. 39.0) call abort
220 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0)
222 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
231 if (b(i
) .ne
. 92.0) call abort
236 !$acc parallel copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
238 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
253 if (b(i
) .ne
. exp
) call abort
258 !$acc parallel if (one == 0)
260 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
269 if (b(i
) .ne
. 88.0) call abort
279 call acc_copyin (a
, sizeof (a
))
280 call acc_copyin (b
, sizeof (b
))
285 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
290 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
293 if (a(i
) .ne
. exp
) call abort
294 if (b(i
) .ne
. exp2
) call abort
300 !$acc update device (a(1:N), b(1:N)) if (0 == 1)
305 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
308 if (a(i
) .ne
. exp
) call abort
309 if (b(i
) .ne
. exp2
) call abort
315 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
320 !$acc update host (a(1:N), b(1:N)) if (0 == 1)
323 if (a(i
) .ne
. 0.0) call abort
324 if (b(i
) .ne
. 0.0) call abort
328 call acc_copyout (a
, sizeof (a
))
329 call acc_copyout (b
, sizeof (b
))
335 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
337 !$acc parallel present (a(1:N))
345 if (b(i
) .ne
. 4.0) call abort
351 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
354 if (acc_is_present (a
) .eqv
. .TRUE
.) call abort
355 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
363 !$acc data copyin (a(1:N)) if (1 == 1)
366 if (acc_is_present (a
) .eqv
. .FALSE
.) call abort
369 !$acc data copyout (b(1:N)) if (0 == 1)
371 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
373 !$acc data copyout (b(1:N)) if (1 == 1)
375 !$acc parallel present (a(1:N)) present (b(1:N))
384 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
390 if (b(1) .ne
. 18.0) call abort
393 !$acc enter data copyin (b(1:N)) if (0 == 1)
396 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
399 !$acc exit data delete (b(1:N)) if (0 == 1)
401 !$acc enter data copyin (b(1:N)) if (1 == 1)
404 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
407 !$acc exit data delete (b(1:N)) if (1 == 1)
410 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
413 !$acc enter data copyin (b(1:N)) if (zero == 1)
416 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
419 !$acc exit data delete (b(1:N)) if (zero == 1)
421 !$acc enter data copyin (b(1:N)) if (one == 1)
424 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
427 !$acc exit data delete (b(1:N)) if (one == 1)
430 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
433 !$acc enter data copyin (b(1:N)) if (one == 0)
436 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
439 !$acc exit data delete (b(1:N)) if (one == 0)
441 !$acc enter data copyin (b(1:N)) if (one == 1)
444 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
447 !$acc exit data delete (b(1:N)) if (one == 1)
450 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
455 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
457 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
472 if (b(i
) .ne
. exp
) call abort
477 !$acc kernels if (0 == 1)
479 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
488 if (b(i
) .ne
. 17.0) call abort
493 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
495 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
510 if (b(i
) .ne
. exp
) call abort
515 !$acc kernels if (zero == 1)
517 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
526 if (b(i
) .ne
. 23.0) call abort
531 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (.TRUE.)
533 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
548 if (b(i
) .ne
. exp
) call abort
553 !$acc kernels if (.FALSE.)
555 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
564 if (b(i
) .ne
. 77.0) call abort
571 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (nn == 1)
573 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
588 if (b(i
) .ne
. exp
) call abort
595 !$acc kernels if (nn == 1)
597 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
606 if (b(i
) .ne
. 19.0) call abort
613 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
615 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
630 if (b(i
) .ne
. exp
) call abort
637 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if ((nn + nn) > 0)
639 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
648 if (b(i
) .ne
. 39.0) call abort
653 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (-2 > 0)
655 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
664 if (b(i
) .ne
. 92.0) call abort
669 !$acc kernels copyin (a(1:N)) copyout (b(1:N)) if (one == 1)
671 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
686 if (b(i
) .ne
. exp
) call abort
691 !$acc kernels if (one == 0)
693 if (acc_on_device (acc_device_host
) .eqv
. .TRUE
.) then
702 if (b(i
) .ne
. 88.0) call abort
712 call acc_copyin (a
, sizeof (a
))
713 call acc_copyin (b
, sizeof (b
))
718 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
723 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
726 if (a(i
) .ne
. exp
) call abort
727 if (b(i
) .ne
. exp2
) call abort
733 !$acc update device (a(1:N), b(1:N)) if (0 == 1)
738 !$acc update host (a(1:N), b(1:N)) if (1 == 1)
741 if (a(i
) .ne
. exp
) call abort
742 if (b(i
) .ne
. exp2
) call abort
748 !$acc update device (a(1:N), b(1:N)) if (1 == 1)
753 !$acc update host (a(1:N), b(1:N)) if (0 == 1)
756 if (a(i
) .ne
. 0.0) call abort
757 if (b(i
) .ne
. 0.0) call abort
761 call acc_copyout (a
, sizeof (a
))
762 call acc_copyout (b
, sizeof (b
))
768 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (1 == 1)
770 !$acc kernels present (a(1:N))
778 if (b(i
) .ne
. 4.0) call abort
784 !$acc data copyin (a(1:N)) copyout (b(1:N)) if (0 == 1)
787 if (acc_is_present (a
) .eqv
. .TRUE
.) call abort
788 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
796 !$acc data copyin (a(1:N)) if (1 == 1)
799 if (acc_is_present (a
) .eqv
. .FALSE
.) call abort
802 !$acc data copyout (b(1:N)) if (0 == 1)
804 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
806 !$acc data copyout (b(1:N)) if (1 == 1)
808 !$acc kernels present (a(1:N)) present (b(1:N))
817 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
823 if (b(1) .ne
. 18.0) call abort
826 !$acc enter data copyin (b(1:N)) if (0 == 1)
829 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
832 !$acc exit data delete (b(1:N)) if (0 == 1)
834 !$acc enter data copyin (b(1:N)) if (1 == 1)
837 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
840 !$acc exit data delete (b(1:N)) if (1 == 1)
843 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
846 !$acc enter data copyin (b(1:N)) if (zero == 1)
849 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
852 !$acc exit data delete (b(1:N)) if (zero == 1)
854 !$acc enter data copyin (b(1:N)) if (one == 1)
857 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
860 !$acc exit data delete (b(1:N)) if (one == 1)
863 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
866 !$acc enter data copyin (b(1:N)) if (one == 0)
869 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort
872 !$acc exit data delete (b(1:N)) if (one == 0)
874 !$acc enter data copyin (b(1:N)) if (one == 1)
877 if (acc_is_present (b
) .eqv
. .FALSE
.) call abort
880 !$acc exit data delete (b(1:N)) if (one == 1)
883 if (acc_is_present (b
) .eqv
. .TRUE
.) call abort