[llvm] [NVPTX] Add support for "blocksareclusters" kernel attr (PR #152265)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 20:02:57 PDT 2025


================
@@ -452,6 +456,19 @@ void NVPTXAsmPrinter::emitKernelFunctionDirectives(const Function &F,
                "should be 0 as well");
       }
     }
+
+    if (BlocksAreClusters) {
+      LLVMContext &Ctx = F.getContext();
+      if (ReqNTID.empty() || ClusterDim.empty()) {
+        Ctx.emitError(
+            "blocksareclusters requires reqntid and cluster_dim attributes");
+      } else if (STI->getPTXVersion() < 90) {
+        Ctx.emitError("blocksareclusters requires PTX version >= 9.0");
+      } else {
----------------
AlexMaclean wrote:

Nit: remove {} for these if/else blocks

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


More information about the llvm-commits mailing list