Projet_SETI_RISC-V/riscv-gnu-toolchain/gcc/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-1.f90

36 lines
500 B
Fortran
Raw Normal View History

2023-03-06 14:48:14 +01:00
! { dg-do run }
! Test of attach/detach with "acc data".
program dtype
implicit none
integer, parameter :: n = 512
type mytype
integer, allocatable :: a(:)
end type mytype
integer i
type(mytype) :: var
allocate(var%a(1:n))
!$acc data copy(var)
!$acc data copy(var%a)
!$acc parallel loop
do i = 1,n
var%a(i) = i
end do
!$acc end parallel loop
!$acc end data
!$acc end data
do i = 1,n
if (i .ne. var%a(i)) stop 1
end do
deallocate(var%a)
end program dtype