view libgomp/testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line source

! { dg-additional-options "-cpp" }
! TODO: Have to disable the acc_on_device builtin for we want to test the
! libgomp library function?  The command line option
! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not for
! Fortran.

use openacc
implicit none

! Host.

if (.not. acc_on_device (acc_device_none)) STOP 1
if (.not. acc_on_device (acc_device_host)) STOP 2
if (acc_on_device (acc_device_not_host)) STOP 3
if (acc_on_device (acc_device_nvidia)) STOP 4


! Host via offloading fallback mode.

!$acc parallel if(.false.)
if (.not. acc_on_device (acc_device_none)) STOP 5
if (.not. acc_on_device (acc_device_host)) STOP 6
if (acc_on_device (acc_device_not_host)) STOP 7
if (acc_on_device (acc_device_nvidia)) STOP 8
!$acc end parallel


#if !ACC_DEVICE_TYPE_host

! Offloaded.

!$acc parallel
if (acc_on_device (acc_device_none)) STOP 9
if (acc_on_device (acc_device_host)) STOP 10
if (.not. acc_on_device (acc_device_not_host)) STOP 11
#if ACC_DEVICE_TYPE_nvidia
if (.not. acc_on_device (acc_device_nvidia)) STOP 12
#else
if (acc_on_device (acc_device_nvidia)) STOP 13
#endif
!$acc end parallel

#endif

end