Skip to content

Commit cadc078

Browse files
committed
save work
1 parent 0baef66 commit cadc078

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,15 @@ void XeGPUSubgroupDistributePass::runOnOperation() {
14671467
// Finally, do the SIMD to SIMT distribution.
14681468
RewritePatternSet patterns(&getContext());
14691469
xegpu::populateXeGPUSubgroupDistributePatterns(patterns);
1470-
// TODO: These are not used at this point.
1471-
auto distributionFn = [](Value val) { return AffineMap(); };
1470+
// TODO: distributionFn and shuffleFn are not used at this point.
1471+
auto distributionFn = [](Value val) {
1472+
VectorType vecType = dyn_cast<VectorType>(val.getType());
1473+
int64_t vecRank = vecType ? vecType.getRank() : 0;
1474+
OpBuilder builder(val.getContext());
1475+
if (vecRank == 0)
1476+
return AffineMap::get(val.getContext());
1477+
return AffineMap::getMultiDimIdentityMap(vecRank, val.getContext());
1478+
};
14721479
auto shuffleFn = [](Location loc, OpBuilder &builder, Value val, Value srcIdx,
14731480
int64_t warpSz) { return Value(); };
14741481
vector::populatePropagateWarpVectorDistributionPatterns(

0 commit comments

Comments
 (0)