[Mlir-commits] [mlir] [mlir][gpu] Add 'cluster_stride' attribute to gpu.subgroup_reduce (PR #107142)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Sep 3 14:16:08 PDT 2024
================
@@ -190,12 +218,9 @@ struct ScalarSubgroupReduceToShuffles final
LogicalResult matchAndRewrite(gpu::SubgroupReduceOp op,
PatternRewriter &rewriter) const override {
- std::optional<uint32_t> clusterSize = op.getClusterSize();
- if (clusterSize && *clusterSize > subgroupSize)
- return op.emitOpError()
- << "cluster size " << *clusterSize
- << " is greater than subgroup size " << subgroupSize;
- unsigned effectiveClusterSize = clusterSize.value_or(subgroupSize);
+ ClusterInfo clusterInfo;
+ if (clusterInfo.getAndValidate(op, subgroupSize).failed())
----------------
kuhar wrote:
prefer free functions for succeeded / failed
https://github.com/llvm/llvm-project/pull/107142
More information about the Mlir-commits
mailing list