brintos

brintos / llvm-project-archived public Read only

0
0
Text · 587 B · 1eb52ca Raw
26 lines · plain
1! Offloading test for target nested inside a target data region2! REQUIRES: flang, amdgpu3 4! RUN: %libomptarget-compile-fortran-run-and-check-generic5program main6   integer :: A(10), B(10), C(10)7 8   do I = 1, 109      A(I) = 110      B(I) = 211   end do12   !$omp target data map(to: A, B) map(alloc: C)13   !$omp target map(from: C)14   do I = 1, 1015      C(I) = A(I) + B(I) ! assigns 3, A:1 + B:216   end do17   !$omp end target18   !$omp target update from(C) ! updates C device -> host19   !$omp end target data20 21   print *, C ! should be all 3's22 23end program24 25! CHECK: 3 3 3 3 3 3 3 3 3 326