brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1021 B · 993ac2e Raw
58 lines · plain
1!REQUIRES: flang, amdgpu2 3!RUN: %libomptarget-compile-fortran-run-and-check-generic4 5subroutine f6  type :: t17    integer :: x, y, z8  end type9 10  integer, parameter :: n = 911  type(t1) :: b(n)12 13  integer :: i14  do i = 1, n15    b(i)%x = 016    b(i)%y = 017    b(i)%z = 018  enddo19 20  !$omp target data map(tofrom: b(1:3)) use_device_addr(b)21  !$omp target has_device_addr(b(2)%x)22    b(2)%x = 123  !$omp end target24  !$omp end target data25  print *, "b1", b26end27 28subroutine g29  type :: t130    integer :: x(3), y(7), z(5)31  end type32 33  integer, parameter :: n = 534  type(t1) :: b(n)35 36  integer :: i37  do i = 1, n38    b(i)%x = 039    b(i)%y = 040    b(i)%z = 041  enddo42 43  !$omp target data map(tofrom: b(1:3)) use_device_addr(b)44  !$omp target has_device_addr(b(2)%x)45    b(2)%x(3) = 146  !$omp end target47  !$omp end target data48  print *, "b2", b49end50 51call f()52call g()53end54 55!CHECK: b1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 056!CHECK: b2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 057 58