This PR adds an initial implementation for the map modifiers close, present and ompx_hold, primarily just required adding the appropriate map type flags to the map type bits. In the case of ompx_hold it required adding the map type to the OpenMP dialect. Close has a bit of a problem when utilised with the ALWAYS map type on descriptors, so it is likely we'll have to make sure close and always are not applied to the descriptor simultaneously in the future when we apply always to the descriptors to facilitate movement of descriptor information to device for consistency, however, we may find an alternative to this with further investigation. For the moment, it is a TODO/Note to keep track of it.
30 lines
1.0 KiB
Fortran
30 lines
1.0 KiB
Fortran
! Basic test that checks that when ompx_hold is in use we cannot delete the data
|
|
! until the ompx_hold falls out of scope, and verifies this via the utilisation of
|
|
! present.
|
|
! REQUIRES: flang, amdgpu
|
|
! RUN: %libomptarget-compile-fortran-generic
|
|
! RUN: %libomptarget-run-fail-generic 2>&1 \
|
|
! RUN: | %fcheck-generic
|
|
|
|
program ompx_hold
|
|
implicit none
|
|
integer :: presence_check
|
|
|
|
!CHECK-NOT: omptarget message: device mapping required by 'present' map type modifier does not exist for host address{{.*}}
|
|
!$omp target data map(ompx_hold, tofrom: presence_check)
|
|
!$omp target exit data map(delete: presence_check)
|
|
!$omp target map(present, tofrom: presence_check)
|
|
presence_check = 10
|
|
!$omp end target
|
|
!$omp end target data
|
|
|
|
!CHECK: omptarget message: device mapping required by 'present' map type modifier does not exist for host address{{.*}}
|
|
!$omp target data map(tofrom: presence_check)
|
|
!$omp target exit data map(delete: presence_check)
|
|
!$omp target map(present, tofrom: presence_check)
|
|
presence_check = 20
|
|
!$omp end target
|
|
!$omp end target data
|
|
|
|
end program
|