CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
72 lines
2.1 KiB
Fortran
72 lines
2.1 KiB
Fortran
! Small regression test that checks that we do not cause a runtime map error in
|
|
! cases where we are required to allocate a local variable for the fortran
|
|
! descriptor to store into and then load from it, done so by reusing the
|
|
! temporary local variable across all maps related to the mapped variable and
|
|
! associated local variable to make sure that each map does as it is intended
|
|
! to do with the original data. This prevents blobs of local descriptor data
|
|
! remaining attached on device long after it's supposed to, which can cause
|
|
! weird map issues later in susbequent function invocations. However, it
|
|
! doesn't avoid a user shooting themselves in the foot by mapping data via
|
|
! enter and then not providing a corresponding exit.
|
|
! REQUIRES: flang, amdgpu
|
|
|
|
! RUN: %libomptarget-compile-fortran-run-and-check-generic
|
|
subroutine launchOne(n1, n2, ret)
|
|
implicit none
|
|
real, intent(out) :: ret
|
|
real(4), dimension(n1,n2) :: sbuf31
|
|
integer :: n1,n2
|
|
!$omp target enter data map(alloc:sbuf31)
|
|
|
|
!$omp target
|
|
sbuf31(2, 2) = 10
|
|
!$omp end target
|
|
|
|
!$omp target update from(sbuf31)
|
|
|
|
ret = sbuf31(2, 2)
|
|
|
|
!$omp target exit data map(delete:sbuf31)
|
|
end subroutine launchOne
|
|
|
|
subroutine launchTwo(N, ret)
|
|
implicit none
|
|
real, intent(inout) :: ret
|
|
integer :: N
|
|
real(4), dimension(N) :: p
|
|
|
|
!$omp target enter data map(to:p)
|
|
|
|
!$omp target
|
|
p(8) = 20
|
|
!$omp end target
|
|
|
|
!$omp target update from(p)
|
|
|
|
ret = ret + p(8)
|
|
|
|
! intentional non-deletion, can trigger an illegal map
|
|
! issue in cases where the local map we store and load
|
|
! from for the variable is different across all maps.
|
|
! Not too sure why this is the thing that triggers the
|
|
! problem in general. It seems like it would be an issue
|
|
! made apparent with and without this statement commented,
|
|
! especially as the issue occurs with the enter and not the
|
|
! corresponding exit (from the runtime trace at least).
|
|
!!$omp target exit data map(delete:p)
|
|
end subroutine launchTwo
|
|
|
|
program reproducer
|
|
implicit none
|
|
integer :: N = 10
|
|
integer :: nr = 10, nt = 10
|
|
real :: output = 0
|
|
|
|
call launchOne(nr, nt, output)
|
|
call launchTwo(N, output)
|
|
|
|
print *, output
|
|
end program reproducer
|
|
|
|
! CHECK: 30
|