[llvm] [OpenMP][Offload] Add SPMD-No-Loop mode to OpenMP offload runtime (PR #154105)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 09:06:20 PDT 2025


================
@@ -662,6 +662,11 @@ uint32_t GenericKernelTy::getNumBlocks(GenericDeviceTy &GenericDevice,
     return std::min(NumTeamsClause[0], GenericDevice.getBlockLimit());
   }
 
+  // Return the number of teams required to cover the loop iterations.
+  if (isNoLoopMode()) {
+    return LoopTripCount > 0 ? (((LoopTripCount - 1) / NumThreads) + 1) : 1;
+  }
----------------
shiltian wrote:

```suggestion
  if (isNoLoopMode())
    return LoopTripCount > 0 ? (((LoopTripCount - 1) / NumThreads) + 1) : 1;
```

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


More information about the llvm-commits mailing list