[PATCH] D106460: [OpenMP] Add new execution mode for SPMD execution with Generic semantics

Giorgis Georgakoudis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 10:52:55 PDT 2021


ggeorgakoudis added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/OpenMPOpt.cpp:2860
+      ExecMode->setInitializer(
+          ConstantInt::get(ExecMode->getInitializer()->getType(), 2));
 
----------------
Nit, add a const/constexpr that semantically defines 2, e..g, `const int SPMDGeneric =2 `


================
Comment at: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp:134
+  GENERIC,      // everything else
+  GENERIC_SPMD, // Generic kernel with SPMD execution
   NONE
----------------
Nit, rename SPMD_GENERIC or SPMDIZED to show affinity to SPMD. Other suggestions to naming welcome.


================
Comment at: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp:1973
+          num_groups = loop_tripcount;
         } else {
+          // This is a generic kernel that was transformed to use SPMD-mode
----------------
Nit, comment /* ExecutionMode == SPMD_GENERIC */


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:1064
           CudaBlocksPerGrid = LoopTripCount;
+        } else {
+          // If we reach this point, then we are executing a kernel that was
----------------
Nit, comment /* KernelInfo->ExecutionMode == SPMD_GENERIC */


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:1096
          CudaBlocksPerGrid, CudaThreadsPerBlock,
-         (KernelInfo->ExecutionMode == SPMD) ? "SPMD" : "Generic");
+         (KernelInfo->ExecutionMode == SPMD ||
+          KernelInfo->ExecutionMode == GENERIC_SPMD)
----------------
print explicitly "SPMD_GENERIC" when the mode is such


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106460



More information about the llvm-commits mailing list