Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90
2023-03-06 14:48:14 +01:00

27 lines
475 B
Fortran

! { dg-do run }
program main
integer, parameter :: n = 40
integer, allocatable :: ar(:,:,:)
integer :: i
allocate (ar(1:n,0:n-1,0:n-1))
!$acc enter data copyin (ar)
!$acc update host (ar)
!$acc update device (ar)
call update_ar (ar, n)
!$acc exit data copyout (ar)
end program main
subroutine update_ar (ar, n)
integer :: n
integer, dimension (1:n,0:n-1,0:n-1) :: ar
!$acc update host (ar)
!$acc update device (ar)
end subroutine update_ar