brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 424dec2 Raw
39 lines · plain
1! Offloading test with runtime call to ompx_dump_mapping_tables Fortran array2! writing some values and printing the variable mapped to device correctly3! receives the updates made on the device.4! REQUIRES: flang5! UNSUPPORTED: nvptx64-nvidia-cuda-LTO6! UNSUPPORTED: aarch64-unknown-linux-gnu7! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO8! UNSUPPORTED: x86_64-unknown-linux-gnu9! UNSUPPORTED: x86_64-unknown-linux-gnu-LTO10 11! RUN: %libomptarget-compile-fortran-run-and-check-generic12 13program map_dump_example14  INTERFACE15    SUBROUTINE ompx_dump_mapping_tables() BIND(C)16    END SUBROUTINE ompx_dump_mapping_tables17  END INTERFACE18 19  integer i,j,k,N20  integer async_q(4)21  real :: A(5000000)22  N=500000023  do i=1, N24    A(i)=025  enddo26! clang-format off27! CHECK: omptarget device 0 info: OpenMP Host-Device pointer mappings after block28! CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration29! CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}}  20000000 1 0 {{.*}} at a(:n):21:1130! clang-format on31!$omp target enter data map(to:A(:N))32  call ompx_dump_mapping_tables()33!$omp target parallel do34  do i=1, N35    A(i)=A(i)*236  enddo37!$omp target exit data map(from:A)38end program39