Skip to content

Commit 84695f5

Browse files
toMLIRString
1 parent d69031a commit 84695f5

File tree

1 file changed

+4
-5
lines changed
  • mlir/include/mlir/Dialect/SparseTensor/IR

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ constexpr bool isValidNOutOfMLT(LevelType lt, uint64_t n, uint64_t m) {
233233
}
234234

235235
/// Returns string representation of the given dimension level type.
236-
constexpr const char *toMLIRString(LevelType lt) {
236+
constexpr const char *toMLIRString(LevelType lvlType) {
237+
auto lt = static_cast<LevelType>(static_cast<uint64_t>(lvlType) & 0xffffffff);
237238
switch (lt) {
238239
case LevelType::Undef:
239240
return "undef";
@@ -263,10 +264,8 @@ constexpr const char *toMLIRString(LevelType lt) {
263264
return "loose_compressed(nonordered)";
264265
case LevelType::LooseCompressedNuNo:
265266
return "loose_compressed(nonunique, nonordered)";
266-
default:
267-
if (isNOutOfMLT(lt)) {
268-
return "structured";
269-
}
267+
case LevelType::NOutOfM:
268+
return "structured";
270269
}
271270
return "";
272271
}

0 commit comments

Comments
 (0)