In a nutshell, this moves our libomptarget code to populate the offload subproject. With this commit, users need to enable the new LLVM/Offload subproject as a runtime in their cmake configuration. No further changes are expected for downstream code. Tests and other components still depend on OpenMP and have also not been renamed. The results below are for a build in which OpenMP and Offload are enabled runtimes. In addition to the pure `git mv`, we needed to adjust some CMake files. Nothing is intended to change semantics. ``` ninja check-offload ``` Works with the X86 and AMDGPU offload tests ``` ninja check-openmp ``` Still works but doesn't build offload tests anymore. ``` ls install/lib ``` Shows all expected libraries, incl. - `libomptarget.devicertl.a` - `libomptarget-nvptx-sm_90.bc` - `libomptarget.rtl.amdgpu.so` -> `libomptarget.rtl.amdgpu.so.18git` - `libomptarget.so` -> `libomptarget.so.18git` Fixes: https://github.com/llvm/llvm-project/issues/75124 --------- Co-authored-by: Saiyedul Islam <Saiyedul.Islam@amd.com>
47 lines
1.0 KiB
Fortran
47 lines
1.0 KiB
Fortran
! Offloading test checking interaction of a
|
|
! two 1-D allocatable arrays with a target region
|
|
! while providing the map upper and lower bounds
|
|
! REQUIRES: flang, amdgcn-amd-amdhsa
|
|
! UNSUPPORTED: nvptx64-nvidia-cuda
|
|
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
|
|
! UNSUPPORTED: aarch64-unknown-linux-gnu
|
|
! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
|
|
! UNSUPPORTED: x86_64-pc-linux-gnu
|
|
! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
|
|
|
|
! RUN: %libomptarget-compile-fortran-run-and-check-generic
|
|
program main
|
|
integer, allocatable :: sp_read(:), sp_write(:)
|
|
allocate(sp_read(10))
|
|
allocate(sp_write(10))
|
|
|
|
do i = 1, 10
|
|
sp_read(i) = i
|
|
sp_write(i) = 0
|
|
end do
|
|
|
|
!$omp target map(tofrom:sp_read(2:6)) map(tofrom:sp_write(2:6))
|
|
do i = 1, 10
|
|
sp_write(i) = sp_read(i)
|
|
end do
|
|
!$omp end target
|
|
|
|
do i = 1, 10
|
|
print *, sp_write(i)
|
|
end do
|
|
|
|
deallocate(sp_read)
|
|
deallocate(sp_write)
|
|
end program
|
|
|
|
! CHECK: 0
|
|
! CHECK: 2
|
|
! CHECK: 3
|
|
! CHECK: 4
|
|
! CHECK: 5
|
|
! CHECK: 6
|
|
! CHECK: 0
|
|
! CHECK: 0
|
|
! CHECK: 0
|
|
! CHECK: 0
|