Lines Matching defs:dimToLvl

329 SparseTensorEncodingAttr::withDimToLvl(AffineMap dimToLvl) const {
332 getContext(), getLvlTypes(), dimToLvl, AffineMap(), getPosWidth(),
445 const auto dimToLvl = getDimToLvl();
446 return dimToLvl ? dimToLvl.getNumDims() : getLvlRank();
578 AffineMap dimToLvl = {};
630 dimToLvl = dlm.getDimToLvlMap(parser.getContext());
708 lvlToDim = inferLvlToDim(dimToLvl, parser.getContext());
711 parser.getContext(), lvlTypes, dimToLvl, lvlToDim, posWidth, crdWidth,
785 AffineMap dimToLvl, AffineMap lvlToDim, unsigned posWidth,
840 if (dimToLvl && (dimToLvl.getNumDims() != dimToLvl.getNumResults())) {
841 if (!isBlockSparsity(dimToLvl)) {
845 auto sizes = getBlockSize(dimToLvl);
871 const Dimension dimRank = dimToLvl ? dimToLvl.getNumDims() : lvlRank;
872 if (dimToLvl) {
873 if (dimToLvl.getNumResults() != lvlRank)
875 << "level-rank mismatch between dimToLvl and lvlTypes: "
876 << dimToLvl.getNumResults() << " != " << lvlRank;
877 auto inferRes = inferLvlToDim(dimToLvl, dimToLvl.getContext());
879 if (!inferRes && dimToLvl.getNumSymbols() == 0)
880 return emitError() << "failed to infer lvlToDim from dimToLvl";
882 return emitError() << "expected lvlToDim to be an inverse of dimToLvl";
884 return emitError() << "unexpected dimToLvl mapping from " << dimRank
890 << "dimension-rank mismatch between dimSlices and dimToLvl: "
893 // ranks agree. (However, it does allow `dimToLvl` to be a permutation.)
1044 AffineMap mlir::sparse_tensor::inferLvlToDim(AffineMap dimToLvl,
1046 auto map = static_cast<AffineMap>(dimToLvl);
1059 AffineMap mlir::sparse_tensor::inverseBlockSparsity(AffineMap dimToLvl,
1062 auto numLvls = dimToLvl.getNumResults();
1068 auto result = dimToLvl.getResult(i);
1071 // Position of the dimension in dimToLvl.
1109 return dimToLvl.get(dimToLvl.getNumResults(), 0, lvlExprs, context);
1112 SmallVector<unsigned> mlir::sparse_tensor::getBlockSize(AffineMap dimToLvl) {
1113 assert(isBlockSparsity(dimToLvl) &&
1114 "expected dimToLvl to be block sparsity for calling getBlockSize");
1116 for (auto result : dimToLvl.getResults()) {
1129 bool mlir::sparse_tensor::isBlockSparsity(AffineMap dimToLvl) {
1130 if (!dimToLvl)
1134 for (auto result : dimToLvl.getResults()) {
1187 if (const auto dimToLvl = enc.getDimToLvl())
1188 return dimToLvl.getDimPosition(l);
1214 AffineMap(), // dimToLvl (irrelevant to storage specifier)
1845 // dimToLvl, the tmp COO buffer is still unnecessary (e.g, concatenate