40 lines · plain
1! Offloading test checking interaction of an local array2! sized utilising an input parameter and the size intrinsic3! when being mapped to device.4! REQUIRES: flang, amdgpu5 6! RUN: %libomptarget-compile-fortran-run-and-check-generic7module mod8 use iso_fortran_env, only: real649 implicit none10contains11 subroutine test(a)12 implicit none13 integer :: i14 real(kind=real64), dimension(:) :: a15 real(kind=real64), dimension(size(a, 1)) :: b16 17!$omp target map(tofrom: b)18 do i = 1, 1019 b(i) = i20 end do21!$omp end target22 23 print *, b24 end subroutine25end module mod26 27program main28 use mod29 real(kind=real64), allocatable :: a(:)30 allocate(a(10))31 32 do i = 1, 1033 a(i) = i34 end do35 36 call test(a)37end program main38 39!CHECK: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.40