[clang] [llvm] [clang] [OpenMP] New OpenMP 6.0 self_maps clause - CodeGen (PR #134131)

Deepak Eachempati via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 07:58:29 PDT 2025


================
@@ -236,6 +236,8 @@ enum class OpenMPOffloadMappingFlags : uint64_t {
   // dynamic.
   // This is an OpenMP extension for the sake of OpenACC support.
   OMP_MAP_OMPX_HOLD = 0x2000,
+  /// Self directs mapping without creating a separate device copy.
+  OMP_MAP_SELF = 0x4000,
----------------
dreachem wrote:

Will try to recap discussion from LLVM/OpenMP meeting today. We need the separate flag for a self map for a few reasons:
1. Self map may require an extra action to register/pin the host memory to make it accessible. And if it's unable to make it accessible, the spec requires that a runtime error is emitted. Just passing in the host address to the kernel without ensuring that it is accessible isn't sufficient.
2. We need to track self maps in the present table for explicit present checks from the user (through `omp_target_is_present` or a `present` modifier).

https://github.com/llvm/llvm-project/pull/134131


More information about the llvm-commits mailing list