[Mlir-commits] [mlir] [mlir][sparse] support sparsifying batch levels (PR #83898)

Yinying Li llvmlistbot at llvm.org
Mon Mar 4 13:58:49 PST 2024


================
@@ -62,26 +65,35 @@ class SparseLevel : public SparseTensorLevel {
 
 class DenseLevel : public SparseTensorLevel {
 public:
-  DenseLevel(unsigned tid, Level lvl, Value lvlSize, bool encoded)
-      : SparseTensorLevel(tid, lvl, LevelFormat::Dense, lvlSize),
-        encoded(encoded) {}
+  DenseLevel(unsigned tid, Level lvl, Value lvlSize)
+      : SparseTensorLevel(tid, lvl, LevelFormat::Dense, lvlSize) {}
 
-  Value peekCrdAt(OpBuilder &, Location, Value pos) const override {
-    return pos;
+  Value peekCrdAt(OpBuilder &, Location, ValueRange, Value) const override {
+    llvm_unreachable("locate dense level instead");
----------------
yinying-lisa-li wrote:

I understand that the error message for BatchLevel is `locate dense level instead`. But why is it the same message in DenseLevel as well?

https://github.com/llvm/llvm-project/pull/83898


More information about the Mlir-commits mailing list