gcc/libgomp/testsuite/libgomp.oacc-fortran/lib-10.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

79 lines
1.7 KiB
Fortran

! { dg-do run }
program main
implicit none
include "openacc_lib.h"
integer, target :: a_3d_i(10, 10, 10)
complex a_3d_c(10, 10, 10)
real a_3d_r(10, 10, 10)
integer i, j, k
complex c
real r
integer, parameter :: i_size = sizeof (i)
integer, parameter :: c_size = sizeof (c)
integer, parameter :: r_size = sizeof (r)
call acc_init (acc_device_default)
call set3d (.FALSE., a_3d_i, a_3d_c, a_3d_r)
call acc_copyin (a_3d_i)
call acc_copyin (a_3d_c)
call acc_copyin (a_3d_r)
if (acc_is_present (a_3d_i) .neqv. .TRUE.) STOP 1
if (acc_is_present (a_3d_c) .neqv. .TRUE.) STOP 2
if (acc_is_present (a_3d_r) .neqv. .TRUE.) STOP 3
do i = 1, 10
do j = 1, 10
do k = 1, 10
if (acc_is_present (a_3d_i(i, j, k), i_size) .neqv. .TRUE.) STOP 4
if (acc_is_present (a_3d_c(i, j, k), i_size) .neqv. .TRUE.) STOP 5
if (acc_is_present (a_3d_r(i, j, k), i_size) .neqv. .TRUE.) STOP 6
end do
end do
end do
contains
subroutine set3d (clear, a_i, a_c, a_r)
logical clear
integer, dimension (:,:,:), intent (inout) :: a_i
complex, dimension (:,:,:), intent (inout) :: a_c
real, dimension (:,:,:), intent (inout) :: a_r
integer i, j, k
integer lb1, ub1, lb2, ub2, lb3, ub3
lb1 = lbound (a_i, 1)
ub1 = ubound (a_i, 1)
lb2 = lbound (a_i, 2)
ub2 = ubound (a_i, 2)
lb3 = lbound (a_i, 3)
ub3 = ubound (a_i, 3)
do i = lb1, ub1
do j = lb2, ub2
do k = lb3, ub3
if (clear) then
a_i(i, j, k) = 0
a_c(i, j, k) = cmplx (0.0, 0.0)
a_r(i, j, k) = 0.0
else
a_i(i, j, k) = i
a_c(i, j, k) = cmplx (i, j)
a_r(i, j, k) = i
end if
end do
end do
end do
end subroutine
end program