[Mlir-commits] [mlir] [mlir][gpu] Add 'cluster_size' attribute to gpu.subgroup_reduce (PR #104851)
Jakub Kuderski
llvmlistbot at llvm.org
Mon Aug 19 13:59:59 PDT 2024
================
@@ -183,6 +190,13 @@ 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.emitError()
+ << "cluster size " << *clusterSize
+ << " is greater than subgroup size " << subgroupSize;
+ unsigned effectiveClusterSize = clusterSize ? *clusterSize : subgroupSize;
----------------
kuhar wrote:
We can use `clusterSize.value_or(subgroup_size)`
https://github.com/llvm/llvm-project/pull/104851
More information about the Mlir-commits
mailing list