brintos

brintos / llvm-project-archived public Read only

0
0
Text · 867 B · 2e1c6a6 Raw
40 lines · plain
1! Basic offloading test of a regular array explicitly passed within a target2! region3! REQUIRES: flang, amdgpu4 5! RUN: %libomptarget-compile-fortran-run-and-check-generic6program main7    implicit none8    integer :: inArray(3,3,3)9    integer :: outArray(3,3,3)10    integer :: i, j, k11    integer :: j2 = 3, k2 = 312 13    do i = 1, 314      do j = 1, 315        do k = 1, 316            inArray(i, j, k) = 4217            outArray(i, j, k) = 018        end do19       end do20    end do21 22j = 123k = 124!$omp target map(tofrom:inArray(1:3, 1:3, 2:2), outArray(1:3, 1:3, 1:3), j, k, j2, k2)25    do while (j <= j2)26      k = 127      do while (k <= k2)28        outArray(k, j, 2) = inArray(k, j, 2)29        k = k + 130      end do31      j = j + 132    end do33!$omp end target34 35 print *, outArray36 37end program38 39! CHECK:  0 0 0 0 0 0 0 0 0 42 42 42 42 42 42 42 42 42 0 0 0 0 0 0 0 0 040