gcc/libgomp/testsuite/libgomp.oacc-fortran/lib-14.f90
Thomas Schwinge c68ddd5e2a Enable more 'libgomp.oacc-*/lib-*' testcases for non-'openacc_nvidia_accel_selected'
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Enable for all but
	'-DACC_MEM_SHARED=0'.
	* testsuite/libgomp.oacc-c-c++-common/lib-13.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-14.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-15.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-24.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-88.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-89.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-92.c: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-14.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-5.c: Add
	'acc_device_radeon' testing.
	* testsuite/libgomp.oacc-c-c++-common/lib-6.c: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-5.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-7.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Enable for all.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-86.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-87.c: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-10.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-8.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Improve checking
	for non-'openacc_nvidia_accel_selected'.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Clarify that "Not
	all implement this checking".
	* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.
2021-06-08 11:51:45 +02:00

84 lines
1.4 KiB
Fortran

! Exercise the data movement runtime library functions on non-shared memory
! targets.
! { dg-do run }
! { dg-skip-if "" { *-*-* } { "*" } { "-DACC_MEM_SHARED=0" } }
program main
use openacc
implicit none
integer, parameter :: N = 256
integer, allocatable :: h(:)
integer :: i
allocate (h(N))
do i = 1, N
h(i) = i
end do
call acc_present_or_copyin (h)
if (acc_is_present (h) .neqv. .TRUE.) stop 1
call acc_copyout (h)
if (acc_is_present (h) .neqv. .FALSE.) stop 1
do i = 1, N
if (h(i) /= i) stop 1
end do
do i = 1, N
h(i) = i + i
end do
call acc_pcopyin (h, sizeof (h))
if (acc_is_present (h) .neqv. .TRUE.) stop 1
call acc_copyout (h)
if (acc_is_present (h) .neqv. .FALSE.) stop 1
do i = 1, N
if (h(i) /= i + i) stop 1
end do
call acc_create (h)
if (acc_is_present (h) .neqv. .TRUE.) stop 1
!$acc parallel loop
do i = 1, N
h(i) = i
end do
!$end acc parallel
call acc_copyout (h)
if (acc_is_present (h) .neqv. .FALSE.) stop 1
do i = 1, N
if (h(i) /= i) stop 1
end do
call acc_present_or_create (h, sizeof (h))
if (acc_is_present (h) .neqv. .TRUE.) stop 1
call acc_delete (h)
if (acc_is_present (h) .neqv. .FALSE.) stop 1
call acc_pcreate (h)
if (acc_is_present (h) .neqv. .TRUE.) stop 1
call acc_delete (h)
if (acc_is_present (h) .neqv. .FALSE.) stop 1
end program