Skip to content

Commit 1758aa2

Browse files
committed
Move out the definition of getDefaultIndexingMaps() function into related CPP file.
1 parent 881675e commit 1758aa2

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -658,15 +658,7 @@ def MatmulOp : LinalgStructuredBase_Op<"matmul", [
658658
Block &block, ArrayRef<NamedAttribute> attrs);
659659

660660
/// Returns a list of AffineMap with the typical matmul indexing charactristic.
661-
static SmallVector<AffineMap> getDefaultIndexingMaps(MLIRContext *context){
662-
AffineExpr d0, d1, d2;
663-
SmallVector<AffineMap, 3> indexingMaps;
664-
bindDims(context, d0, d1, d2);
665-
indexingMaps.push_back(AffineMap::get(3, 0, {d0, d2}, context));
666-
indexingMaps.push_back(AffineMap::get(3, 0, {d2, d1}, context));
667-
indexingMaps.push_back(AffineMap::get(3, 0, {d0, d1}, context));
668-
return indexingMaps;
669-
}
661+
static SmallVector<AffineMap> getDefaultIndexingMaps(MLIRContext *context);
670662

671663
/// Returns true if the given broadcast map \p bcastMap is valid for this op.
672664
bool isValidLhsRhsBroadcastMap(AffineMap bcastMap);

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3457,6 +3457,17 @@ namespace linalg {
34573457
// MatMulOp
34583458
//===----------------------------------------------------------------------===//
34593459

3460+
/// Returns a list of AffineMap with the typical matmul indexing charactristic.
3461+
SmallVector<AffineMap> MatmulOp::getDefaultIndexingMaps(MLIRContext *context) {
3462+
AffineExpr d0, d1, d2;
3463+
SmallVector<AffineMap, 3> indexingMaps;
3464+
bindDims(context, d0, d1, d2);
3465+
indexingMaps.push_back(AffineMap::get(3, 0, {d0, d2}, context));
3466+
indexingMaps.push_back(AffineMap::get(3, 0, {d2, d1}, context));
3467+
indexingMaps.push_back(AffineMap::get(3, 0, {d0, d1}, context));
3468+
return indexingMaps;
3469+
}
3470+
34603471
SmallVector<utils::IteratorType> MatmulOp::getIteratorTypesArray() {
34613472
return SmallVector<utils::IteratorType>{utils::IteratorType::parallel,
34623473
utils::IteratorType::parallel,

0 commit comments

Comments
 (0)