@@ -47,6 +47,12 @@ enum class ReinterpretMapScope {
47
47
kExceptGeneric , // reinterprets operation other than linalg.generic
48
48
};
49
49
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
+
50
56
#define GEN_PASS_DECL
51
57
#include " mlir/Dialect/SparseTensor/Transforms/Passes.h.inc"
52
58
@@ -74,11 +80,20 @@ std::unique_ptr<Pass> createPreSparsificationRewritePass();
74
80
75
81
// / Options for the Sparsification pass.
76
82
struct SparsificationOptions {
83
+ SparsificationOptions (SparseParallelizationStrategy p, SparseEmitStrategy d,
84
+ bool enableRT)
85
+ : parallelizationStrategy(p), sparseEmitStrategy(d),
86
+ enableRuntimeLibrary (enableRT) {}
87
+
77
88
SparsificationOptions (SparseParallelizationStrategy p, bool enableRT)
78
- : parallelizationStrategy(p), enableRuntimeLibrary(enableRT) {}
89
+ : SparsificationOptions(p, SparseEmitStrategy::kFunctional , enableRT) {}
90
+
79
91
SparsificationOptions ()
80
- : SparsificationOptions(SparseParallelizationStrategy::kNone , true ) {}
92
+ : SparsificationOptions(SparseParallelizationStrategy::kNone ,
93
+ SparseEmitStrategy::kFunctional , true ) {}
94
+
81
95
SparseParallelizationStrategy parallelizationStrategy;
96
+ SparseEmitStrategy sparseEmitStrategy;
82
97
bool enableRuntimeLibrary;
83
98
};
84
99
0 commit comments