@@ -47,6 +47,12 @@ enum class ReinterpretMapScope {
4747 kExceptGeneric , // reinterprets operation other than linalg.generic
4848};
4949
50+ // / Defines a scope for reinterpret map pass.
51+ enum class SparseEmitStrategy {
52+ kFunctional , // generate fully inlined (and functional) sparse iteration
53+ kDebugInterface , // generate only place-holder for sparse iteration
54+ };
55+
5056#define GEN_PASS_DECL
5157#include " mlir/Dialect/SparseTensor/Transforms/Passes.h.inc"
5258
@@ -74,11 +80,20 @@ std::unique_ptr<Pass> createPreSparsificationRewritePass();
7480
7581// / Options for the Sparsification pass.
7682struct SparsificationOptions {
83+ SparsificationOptions (SparseParallelizationStrategy p, SparseEmitStrategy d,
84+ bool enableRT)
85+ : parallelizationStrategy(p), sparseEmitStrategy(d),
86+ enableRuntimeLibrary (enableRT) {}
87+
7788 SparsificationOptions (SparseParallelizationStrategy p, bool enableRT)
78- : parallelizationStrategy(p), enableRuntimeLibrary(enableRT) {}
89+ : SparsificationOptions(p, SparseEmitStrategy::kFunctional , enableRT) {}
90+
7991 SparsificationOptions ()
80- : SparsificationOptions(SparseParallelizationStrategy::kNone , true ) {}
92+ : SparsificationOptions(SparseParallelizationStrategy::kNone ,
93+ SparseEmitStrategy::kFunctional , true ) {}
94+
8195 SparseParallelizationStrategy parallelizationStrategy;
96+ SparseEmitStrategy sparseEmitStrategy;
8297 bool enableRuntimeLibrary;
8398};
8499
0 commit comments