49 assert(llvm::isPowerOf2_32(subgroupSize));
51 std::optional<uint32_t> clusterSize = op.getClusterSize();
52 assert(!clusterSize ||
53 llvm::isPowerOf2_32(*clusterSize));
54 if (clusterSize && *clusterSize > subgroupSize)
55 return op.emitOpError()
56 <<
"cluster size " << *clusterSize
57 <<
" is greater than subgroup size " << subgroupSize;
58 unsigned effectiveClusterSize = clusterSize.value_or(subgroupSize);
60 auto clusterStride = op.getClusterStride();
61 assert(llvm::isPowerOf2_32(clusterStride));
62 if (clusterStride >= subgroupSize)
63 return op.emitOpError()
64 <<
"cluster stride " << clusterStride
65 <<
" is not less than subgroup size " << subgroupSize;
FailureOr< SubgroupReduceClusterInfo > getSubgroupReduceClusterInfo(SubgroupReduceOp op, unsigned subgroupSize)
Returns the cluster layout of op in a subgroup of subgroupSize lanes, which must be a power of two.