[Mlir-commits] [mlir] [mlir][sparse] refactoring sparse runtime lib into less paths (PR #85332)

Aart Bik llvmlistbot at llvm.org
Thu Mar 14 17:06:30 PDT 2024


================
@@ -244,16 +229,14 @@ class SparseTensorStorage final : public SparseTensorStorageBase {
   newFromCOO(uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
              const uint64_t *lvlSizes, const LevelType *lvlTypes,
              const uint64_t *dim2lvl, const uint64_t *lvl2dim,
-             SparseTensorCOO<V> &lvlCOO);
+             SparseTensorCOO<V> *lvlCOO);
 
-  /// Allocates a new sparse tensor and initialize it with the data stored level
-  /// buffers directly.
+  /// Allocates a new sparse tensor and initialize it from the given buffers.
   static SparseTensorStorage<P, C, V> *
-  packFromLvlBuffers(uint64_t dimRank, const uint64_t *dimSizes,
-                     uint64_t lvlRank, const uint64_t *lvlSizes,
-                     const LevelType *lvlTypes, const uint64_t *dim2lvl,
-                     const uint64_t *lvl2dim, uint64_t srcRank,
-                     const intptr_t *buffers);
+  newFromBuffers(uint64_t dimRank, const uint64_t *dimSizes, uint64_t lvlRank,
+                 const uint64_t *lvlSizes, const LevelType *lvlTypes,
+                 const uint64_t *dim2lvl, const uint64_t *lvl2dim,
----------------
aartbik wrote:

yeah, right after adding that you changed the code that made the whole path obsolete again
removing that is a slightly bigger refactoring, still planned!

(note that right now, having dim2lvl and lvl2dim is at least good for debugging to make sure they are indeed each others inverse)

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


More information about the Mlir-commits mailing list