PR target/82855
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / acc_on_device-1-2.f
bloba19045b05638baef04de686f35aa875b19e61a27
1 ! { dg-additional-options "-cpp" }
2 ! TODO: Have to disable the acc_on_device builtin for we want to test
3 ! the libgomp library function? The command line option
4 ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not
5 ! for Fortran.
7 USE OPENACC
8 IMPLICIT NONE
10 !Host.
12 IF (.NOT. ACC_ON_DEVICE (ACC_DEVICE_NONE)) CALL ABORT
13 IF (.NOT. ACC_ON_DEVICE (ACC_DEVICE_HOST)) CALL ABORT
14 IF (ACC_ON_DEVICE (ACC_DEVICE_NOT_HOST)) CALL ABORT
15 IF (ACC_ON_DEVICE (ACC_DEVICE_NVIDIA)) 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 IF (ACC_ON_DEVICE (ACC_DEVICE_NVIDIA)) CALL ABORT
25 !$ACC END PARALLEL
28 #if !ACC_DEVICE_TYPE_host
30 ! Offloaded.
32 !$ACC PARALLEL
33 IF (ACC_ON_DEVICE (ACC_DEVICE_NONE)) CALL ABORT
34 IF (ACC_ON_DEVICE (ACC_DEVICE_HOST)) CALL ABORT
35 IF (.NOT. ACC_ON_DEVICE (ACC_DEVICE_NOT_HOST)) CALL ABORT
36 #if ACC_DEVICE_TYPE_nvidia
37 IF (.NOT. ACC_ON_DEVICE (ACC_DEVICE_NVIDIA)) CALL ABORT
38 #else
39 IF (ACC_ON_DEVICE (ACC_DEVICE_NVIDIA)) CALL ABORT
40 #endif
41 !$ACC END PARALLEL
43 #endif
45 END