brintos

brintos / llvm-project-archived public Read only

0
0
Text · 679 B · b6005e0 Raw
32 lines · plain
1! Offloading test checking interaction of an enter and exit map of an array of2! scalars3! REQUIRES: flang, amdgpu4 5! RUN: %libomptarget-compile-fortran-run-and-check-generic6program main7    integer :: array(10)8 9    do I = 1, 1010      array(I) = I + I11    end do12 13    !$omp target enter data map(to: array)14    ! Shouldn't overwrite data already locked in15    ! on target via enter, this will then be16    ! overwritten by our exit17    do I = 1, 1018      array(I) = 1019    end do20 21   !$omp target22    do i=1,1023      array(i) = array(i) + i24    end do25  !$omp end target26 27  !$omp target exit data map(from: array)28  print*, array29end program30 31!CHECK: 3 6 9 12 15 18 21 24 27 3032