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.
33 lines
1.1 KiB
Fortran
33 lines
1.1 KiB
Fortran
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s
|
|
|
|
subroutine map_present_target_data
|
|
integer :: x
|
|
!CHECK: %[[MAP:.*]] = omp.map.info {{.*}} map_clauses(present, to) {{.*}} {name = "x"}
|
|
!CHECK: omp.target_data map_entries(%[[MAP]] : {{.*}}) {
|
|
!$omp target data map(present, to: x)
|
|
!$omp end target data
|
|
end subroutine
|
|
|
|
subroutine map_present_update
|
|
integer :: x
|
|
!CHECK: %[[MAP:.*]] = omp.map.info {{.*}} map_clauses(present, to) {{.*}} {name = "x"}
|
|
!CHECK: omp.target_update map_entries(%[[MAP]] : {{.*}})
|
|
!$omp target update to(present: x)
|
|
end subroutine
|
|
|
|
subroutine map_close
|
|
integer :: x
|
|
!CHECK: %[[MAP:.*]] = omp.map.info {{.*}} map_clauses(close, tofrom) {{.*}} {name = "x"}
|
|
!CHECK: omp.target_data map_entries(%[[MAP]] : {{.*}}) {
|
|
!$omp target data map(close, tofrom: x)
|
|
!$omp end target data
|
|
end subroutine
|
|
|
|
subroutine map_ompx_hold
|
|
integer :: x
|
|
!CHECK: %[[MAP:.*]] = omp.map.info {{.*}} map_clauses(ompx_hold, tofrom) {{.*}} {name = "x"}
|
|
!CHECK: omp.target_data map_entries(%[[MAP]] : {{.*}}) {
|
|
!$omp target data map(ompx_hold, tofrom: x)
|
|
!$omp end target data
|
|
end subroutine
|