[Mlir-commits] [mlir] [mlir][AMDGPU] Set uniform-work-group-size=true by default (PR #79077)

Krzysztof Drewniak llvmlistbot at llvm.org
Tue Feb 13 11:02:36 PST 2024


================
@@ -100,6 +100,12 @@ class ROCDLDialectLLVMIRTranslationInterface
         llvmFunc->addFnAttr("amdgpu-flat-work-group-size", "1,256");
       }
 
+      // MLIR's GPU kernel APIs all assume and produce uniformly-sized
+      // workgroups, so the lowering of the `rocdl.kernel` marker encodes this
+      // assumption. This assumption may be overridden by setting
+      // `rocdl.uniform_work_group_size` on a given function.
+      if (!llvmFunc->hasFnAttribute("uniform-work-group-size"))
----------------
krzysz00 wrote:

I don't have guarantees about whether we'll process `rocdl.kernel` or `rocdl.uniform_work_group_size` first, so if I've already encountered a manual definition of uniform work group size, I don't want to overwrite it with the default

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


More information about the Mlir-commits mailing list