PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / acc_on_device-1-1.f90
blobd6c67a0c31aad7ee010ba5c677c42edae521e803
1 ! { dg-additional-options "-cpp" }
2 ! TODO: Have to disable the acc_on_device builtin for we want to test the
3 ! libgomp library function? The command line option
4 ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not for
5 ! Fortran.
7 use openacc
8 implicit none
10 ! Host.
12 if (.not. acc_on_device (acc_device_none)) STOP 1
13 if (.not. acc_on_device (acc_device_host)) STOP 2
14 if (acc_on_device (acc_device_not_host)) STOP 3
15 if (acc_on_device (acc_device_nvidia)) STOP 4
18 ! Host via offloading fallback mode.
20 !$acc parallel if(.false.)
21 if (.not. acc_on_device (acc_device_none)) STOP 5
22 if (.not. acc_on_device (acc_device_host)) STOP 6
23 if (acc_on_device (acc_device_not_host)) STOP 7
24 if (acc_on_device (acc_device_nvidia)) STOP 8
25 !$acc end parallel
28 #if !ACC_DEVICE_TYPE_host
30 ! Offloaded.
32 !$acc parallel
33 if (acc_on_device (acc_device_none)) STOP 9
34 if (acc_on_device (acc_device_host)) STOP 10
35 if (.not. acc_on_device (acc_device_not_host)) STOP 11
36 #if ACC_DEVICE_TYPE_nvidia
37 if (.not. acc_on_device (acc_device_nvidia)) STOP 12
38 #else
39 if (acc_on_device (acc_device_nvidia)) STOP 13
40 #endif
41 !$acc end parallel
43 #endif
45 end