Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yinying-lisa-li committed Oct 17, 2023
1 parent 8d28731 commit 808d878
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,13 @@ inline bool hasAnySparseOperandOrResult(Operation *op) {
// Inference.
//

/// Given the dimToLvl map, infers the lvlToDim map, or returns
/// empty Affine map when inference fails.
AffineMap inferLvlToDim(AffineMap dimToLvl, MLIRContext *context);

/// Returns the lvlToDim map for the given dimToLvl map specific
/// to the block sparse cases.
/// Asserts on failure (so only use when known to succeed).
AffineMap inverseBlockSparsity(AffineMap dimToLvl, MLIRContext *context);

//
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ AffineMap mlir::sparse_tensor::inferLvlToDim(AffineMap dimToLvl,
} else if (map.isPermutation()) {
lvlToDim = inversePermutation(map);
} else {
// TODO: check if it's block sparsity
lvlToDim = inverseBlockSparsity(map, context);
}
return lvlToDim;
Expand Down

0 comments on commit 808d878

Please sign in to comment.