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

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 09:29:12 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 {
----------------
rajatbajpai wrote:

Thanks, good to know. I find it a bit harder to read without curly braces after clang-format.

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


More information about the llvm-commits mailing list