Skip to content

Commit 233c3e6

Browse files
authored
[mlir][sparse] remove sparse2sparse path in library (llvm#69247)
This cleans up all external entry points that will have to deal with non-permutations, making any subsequent refactoring much more local to the lib files.
1 parent 59f69a3 commit 233c3e6

File tree

8 files changed

+3
-364
lines changed

8 files changed

+3
-364
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ enum class Action : uint32_t {
145145
kEmpty = 0,
146146
kEmptyForward = 1,
147147
kFromCOO = 2,
148-
kSparseToSparse = 3,
149148
kFromReader = 4,
150149
kToCOO = 5,
151150
kPack = 7,

mlir/include/mlir/ExecutionEngine/SparseTensor/Storage.h

Lines changed: 2 additions & 262 deletions
Large diffs are not rendered by default.

mlir/include/mlir/ExecutionEngine/SparseTensorRuntime.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ extern "C" {
4747
/// kEmpty - STS, empty
4848
/// kEmptyForward - STS, empty, with forwarding COO
4949
/// kFromCOO COO STS, copied from the COO source
50-
/// kSparseToSparse STS STS, copied from the STS source
5150
/// kToCOO STS COO, copied from the STS source
5251
/// kPack buffers STS, from level buffers
5352
/// kSortCOOInPlace STS STS, sorted in place

mlir/lib/ExecutionEngine/SparseTensor/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
add_mlir_library(MLIRSparseTensorRuntime
99
File.cpp
1010
MapRef.cpp
11-
NNZ.cpp
1211
Storage.cpp
1312

1413
EXCLUDE_FROM_LIBMLIR

mlir/lib/ExecutionEngine/SparseTensor/NNZ.cpp

Lines changed: 0 additions & 79 deletions
This file was deleted.

mlir/lib/ExecutionEngine/SparseTensor/Storage.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,10 @@ SparseTensorStorageBase::SparseTensorStorageBase( // NOLINT
4444
}
4545
}
4646

47-
// Helper macro for generating error messages when some
48-
// `SparseTensorStorage<P,I,V>` is cast to `SparseTensorStorageBase`
49-
// and then the wrong "partial method specialization" is called.
47+
// Helper macro for wrong "partial method specialization" errors.
5048
#define FATAL_PIV(NAME) \
5149
MLIR_SPARSETENSOR_FATAL("<P,I,V> type mismatch for: " #NAME);
5250

53-
#define IMPL_NEWENUMERATOR(VNAME, V) \
54-
void SparseTensorStorageBase::newEnumerator( \
55-
SparseTensorEnumeratorBase<V> **, uint64_t, const uint64_t *, uint64_t, \
56-
const uint64_t *) const { \
57-
FATAL_PIV("newEnumerator" #VNAME); \
58-
}
59-
MLIR_SPARSETENSOR_FOREVERY_V(IMPL_NEWENUMERATOR)
60-
#undef IMPL_NEWENUMERATOR
61-
6251
#define IMPL_GETPOSITIONS(PNAME, P) \
6352
void SparseTensorStorageBase::getPositions(std::vector<P> **, uint64_t) { \
6453
FATAL_PIV("getPositions" #PNAME); \

mlir/lib/ExecutionEngine/SparseTensorRuntime.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,6 @@ extern "C" {
131131
return SparseTensorStorage<P, C, V>::newFromCOO( \
132132
dimRank, dimSizes, lvlRank, lvlTypes, dim2lvl, lvl2dim, coo); \
133133
} \
134-
case Action::kSparseToSparse: { \
135-
assert(ptr && "Received nullptr for SparseTensorStorage object"); \
136-
auto &tensor = *static_cast<SparseTensorStorageBase *>(ptr); \
137-
return SparseTensorStorage<P, C, V>::newFromSparseTensor( \
138-
dimRank, dimSizes, lvlRank, lvlSizes, lvlTypes, dim2lvl, lvl2dim, \
139-
dimRank, tensor); \
140-
} \
141134
case Action::kFromReader: { \
142135
assert(ptr && "Received nullptr for SparseTensorReader object"); \
143136
SparseTensorReader &reader = *static_cast<SparseTensorReader *>(ptr); \

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8795,7 +8795,6 @@ cc_library(
87958795
srcs = [
87968796
"lib/ExecutionEngine/SparseTensor/File.cpp",
87978797
"lib/ExecutionEngine/SparseTensor/MapRef.cpp",
8798-
"lib/ExecutionEngine/SparseTensor/NNZ.cpp",
87998798
"lib/ExecutionEngine/SparseTensor/Storage.cpp",
88008799
],
88018800
hdrs = [

0 commit comments

Comments
 (0)