[PATCH] D141233: [OpenMP][GPU] Introduce the `ompx_dyn_cgroup_mem(<N>)` clause

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 13:20:17 PST 2023


jdoerfert added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15929
+    case OMPD_target_teams_loop:
+      CaptureRegion = OMPD_target;
+      break;
----------------
ABataev wrote:
> Try to use OMPD_task here and check if it works. I rather doubt you need to capture the expression and pass it to the target region. Also, check how device clause is implemented, most probably you need to do something similar. There is an implicit task created for nowait target, where need to allocate the space and pass the value.
I found it. See below. Works now, with target and with task here. I leave target to match num_teams, device is needed in the outer call as well.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:23801
+  return new (Context) OMPXDynCGroupMemClause(
+      Size, HelperValStmt, CaptureRegion, StartLoc, LParenLoc, EndLoc);
+}
----------------
I used Size here not ValExpr. Fixed it locally.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141233/new/

https://reviews.llvm.org/D141233



More information about the llvm-commits mailing list