Skip to content

Commit 808d878

Browse files
added docs
1 parent 8d28731 commit 808d878

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,13 @@ inline bool hasAnySparseOperandOrResult(Operation *op) {
164164
// Inference.
165165
//
166166

167+
/// Given the dimToLvl map, infers the lvlToDim map, or returns
168+
/// empty Affine map when inference fails.
167169
AffineMap inferLvlToDim(AffineMap dimToLvl, MLIRContext *context);
170+
171+
/// Returns the lvlToDim map for the given dimToLvl map specific
172+
/// to the block sparse cases.
173+
/// Asserts on failure (so only use when known to succeed).
168174
AffineMap inverseBlockSparsity(AffineMap dimToLvl, MLIRContext *context);
169175

170176
//

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ AffineMap mlir::sparse_tensor::inferLvlToDim(AffineMap dimToLvl,
759759
} else if (map.isPermutation()) {
760760
lvlToDim = inversePermutation(map);
761761
} else {
762+
// TODO: check if it's block sparsity
762763
lvlToDim = inverseBlockSparsity(map, context);
763764
}
764765
return lvlToDim;

0 commit comments

Comments
 (0)