Skip to content

Commit 36e3e3d

Browse files
committed
update comments
1 parent 9ae490c commit 36e3e3d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ getSgShapeAndCount(ArrayRef<int64_t> shape,
7676
return std::make_pair(sgShape, count);
7777
}
7878

79-
// An util helper to generate elementwise addition ops for index computing.
80-
// lhs and rhs are vectors of Values. If the rank of lhs and rhs doesn't match.
81-
// left-alignment is performed.
79+
/// Generates element-wise addition ops of two arrays with automatic alignment.
80+
/// When the input arrays have different sizes, the shorter array is right-aligned
81+
/// with the longer array, and the unmatched leading elements from the longer array
82+
/// are preserved unchanged. This is commonly used for offset computation where
83+
/// higher-dimensional offsets need to be added to lower-dimensional adjustments.
84+
///
85+
/// Example:
86+
/// lhs = [10, 20, 30], rhs = [5, 7]
87+
/// Result: [10, 25, 37] (20+5, 30+7, with 10 preserved)
8288
static SmallVector<OpFoldResult>
8389
genIndexAdds(ConversionPatternRewriter &rewriter, Location loc,
8490
ArrayRef<OpFoldResult> lhs, ArrayRef<OpFoldResult> rhs) {

0 commit comments

Comments
 (0)