Skip to content

Commit 86c6037

Browse files
committed
The width argument cannot exceed the subgroup limit.
1 parent 632c897 commit 86c6037

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,12 @@ LogicalResult GPUShuffleConversion::matchAndRewrite(
430430
unsigned subgroupSize =
431431
targetEnv.getAttr().getResourceLimits().getSubgroupSize();
432432
IntegerAttr widthAttr;
433+
// The width argument specifies the number of lanes that participate in the
434+
// shuffle. The width value should not exceed the subgroup limit.
433435
if (!matchPattern(shuffleOp.getWidth(), m_Constant(&widthAttr)) ||
434-
widthAttr.getValue().getZExtValue() != subgroupSize)
436+
widthAttr.getValue().getZExtValue() <= subgroupSize)
435437
return rewriter.notifyMatchFailure(
436-
shuffleOp, "shuffle width and target subgroup size mismatch");
438+
shuffleOp, "shuffle width is larger than target subgroup size");
437439

438440
Location loc = shuffleOp.getLoc();
439441
Value trueVal = spirv::ConstantOp::getOne(rewriter.getI1Type(),

0 commit comments

Comments
 (0)