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

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed May 7 10:05:24 PDT 2025


================
@@ -9820,7 +9822,8 @@ void CGOpenMPRuntime::adjustTargetSpecificDataForLambdas(
 
 void CGOpenMPRuntime::processRequiresDirective(const OMPRequiresDecl *D) {
   for (const OMPClause *Clause : D->clauselists()) {
-    if (Clause->getClauseKind() == OMPC_unified_shared_memory) {
+    if (Clause->getClauseKind() == OMPC_unified_shared_memory ||
+        Clause->getClauseKind() == OMPC_self_maps) {
----------------
jdoerfert wrote:

I don't see why self map requires unified shared memory. Didn't we say it can use pinned memory on a dedicated memory system? There are other ways too that should allow self map w/o unified shared memory available/enabled.

If self map enabled requires USM, it seems we are back to what Alexey said, it should just work.

What I understood is:
A `map(self...)` requires the runtime to make the pointer available on the device, as is, and error out if it cannot.
Assuming that is the case, I don't know what the requires is supposed to do.
At the end of the day, in the runtime, we would try if it's accessible already, if not, pin it and check again, and if that doesn't work, error out, no?

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


More information about the llvm-commits mailing list