[Mlir-commits] [mlir] [mlir][gpu] Add 'cluster_size' attribute to gpu.subgroup_reduce (PR #104851)

Jakub Kuderski llvmlistbot at llvm.org
Tue Aug 20 08:09:28 PDT 2024


================
@@ -620,10 +620,21 @@ LogicalResult gpu::SubgroupReduceOp::verify() {
                        << "` reduction operation is not compatible with type "
                        << getType();
   }
+
+  if (auto clusterSize = getClusterSize()) {
+    uint32_t size = *clusterSize;
+    if (!llvm::isPowerOf2_32(size)) {
+      return emitError() << "cluster size " << size << " is not a power of two";
----------------
kuhar wrote:

I find op errors to be easier to work with because in real models the line number loc doesn't really match anything useful (high level ops get decomposed into dozens/hundreds of simpler instructions all with the same location)

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


More information about the Mlir-commits mailing list