File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
include/mlir/Dialect/SparseTensor/IR
lib/Dialect/SparseTensor/IR Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,10 @@ struct LevelType {
360
360
std::string toMLIRString () const {
361
361
std::string lvlStr = toFormatString (getLvlFmt ());
362
362
std::string propStr = " " ;
363
+ if (isa<LevelFormat::NOutOfM>()) {
364
+ lvlStr +=
365
+ " [" + std::to_string (getN ()) + " , " + std::to_string (getM ()) + " ]" ;
366
+ }
363
367
if (isa<LevelPropNonDefault::Nonunique>())
364
368
propStr += toPropString (LevelPropNonDefault::Nonunique);
365
369
Original file line number Diff line number Diff line change @@ -646,28 +646,16 @@ void SparseTensorEncodingAttr::printDimensions(
646
646
}
647
647
}
648
648
649
- std::string getNOutOfMString (LevelType lt) {
650
- if (isNOutOfMLT (lt)) {
651
- unsigned n = getN (lt);
652
- unsigned m = getM (lt);
653
- auto output = " [" + std::to_string (n) + " , " + std::to_string (m) + " ]" ;
654
- return output;
655
- }
656
- return " " ;
657
- }
658
-
659
649
void SparseTensorEncodingAttr::printLevels (AffineMap &map, AsmPrinter &printer,
660
650
ArrayRef<LevelType> lvlTypes) const {
661
651
for (unsigned i = 0 , n = map.getNumResults () - 1 ; i < n; i++) {
662
652
map.getResult (i).print (printer.getStream ());
663
- printer << " : " << toMLIRString (lvlTypes[i])
664
- << getNOutOfMString (lvlTypes[i]) << " , " ;
653
+ printer << " : " << toMLIRString (lvlTypes[i]) << " , " ;
665
654
}
666
655
if (map.getNumResults () >= 1 ) {
667
656
auto lastIndex = map.getNumResults () - 1 ;
668
657
map.getResult (lastIndex).print (printer.getStream ());
669
- printer << " : " << toMLIRString (lvlTypes[lastIndex])
670
- << getNOutOfMString (lvlTypes[lastIndex]);
658
+ printer << " : " << toMLIRString (lvlTypes[lastIndex]);
671
659
}
672
660
}
673
661
You can’t perform that action at this time.
0 commit comments