OpenACC acc_on_device.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / acc_on_device-1-1.f90
blobc4597a60a939138de8bb62a1fca9ea8c0505bc27
1 ! TODO: Remove -DACC_DEVICE_TYPE_host once that is set by the test harness.
2 ! { dg-additional-options "-cpp -DACC_DEVICE_TYPE_host" }
3 ! TODO: Have to disable the acc_on_device builtin for we want to test the
4 ! libgomp library function? The command line option
5 ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not for
6 ! Fortran.
8 use openacc
9 implicit none
11 ! Host.
13 if (.not. acc_on_device (acc_device_none)) call abort
14 if (.not. acc_on_device (acc_device_host)) call abort
15 if (acc_on_device (acc_device_not_host)) call abort
18 ! Host via offloading fallback mode.
20 !$acc parallel if(.false.)
21 if (.not. acc_on_device (acc_device_none)) call abort
22 if (.not. acc_on_device (acc_device_host)) call abort
23 if (acc_on_device (acc_device_not_host)) call abort
24 !$acc end parallel
27 #if !ACC_DEVICE_TYPE_host
29 ! Offloaded.
31 !$acc parallel
32 if (acc_on_device (acc_device_none)) call abort
33 if (acc_on_device (acc_device_host)) call abort
34 if (.not. acc_on_device (acc_device_not_host)) call abort
35 !$acc end parallel
37 #endif
39 end