13 #ifndef MLIR_DIALECT_SPARSETENSOR_PIPELINES_PASSES_H_
14 #define MLIR_DIALECT_SPARSETENSOR_PIPELINES_PASSES_H_
24 namespace sparse_tensor {
35 *
this,
"parallelization-strategy",
36 ::llvm::cl::desc(
"Set the parallelization strategy"),
40 "Turn off sparse parallelization."),
43 "Enable dense outer loop sparse parallelization."),
45 "any-storage-outer-loop",
46 "Enable sparse parallelization regardless of storage for "
50 "Enable dense parallelization for any loop."),
53 "any-storage-any-loop",
54 "Enable sparse parallelization for any storage and loop."))};
56 *
this,
"gpu-data-transfer-strategy",
58 "Set the data transfer strategy between the host and the GPUs"),
62 "Default option: malloc on host without additional "
63 "options or care and then use DMA to copy the data"),
65 "Based on the default option, pin the host memory to "
66 "accelerate the data transfer"),
68 "Use zero-copy to perform the data transfer from the host "
72 *
this,
"enable-index-reduction",
73 desc(
"Enable dependent index reduction based algorithm to handle "
74 "non-trivial index expressions on sparse inputs (experimental "
79 *
this,
"enable-runtime-library",
80 desc(
"Enable runtime library for manipulating sparse tensors"),
84 *
this,
"test-bufferization-analysis-only",
85 desc(
"Run only the inplacability analysis"), init(
false)};
88 *
this,
"enable-buffer-initialization",
89 desc(
"Enable zero-initialization of memory buffers"), init(
false)};
92 *
this,
"create-sparse-deallocs",
93 desc(
"Specify if the temporary buffers created by the sparse "
94 "compiler should be deallocated. For compatibility with core "
95 "bufferization passes. "
96 "This option is only used when enable-runtime-library=false."),
100 *
this,
"vl", desc(
"Set the vector length (0 disables vectorization)"),
105 *
this,
"s2s-strategy",
106 desc(
"Set the strategy for sparse-to-sparse conversion"), init(0)};
111 *
this,
"reassociate-fp-reductions",
112 desc(
"Allows llvm to reassociate floating-point reductions for speed"),
115 *
this,
"enable-index-optimizations",
116 desc(
"Allows compiler to assume indices fit in 32-bit if that yields "
121 desc(
"Enables the use of AMX dialect while lowering the vector dialect"),
124 *
this,
"enable-arm-neon",
125 desc(
"Enables the use of ArmNeon dialect while lowering the vector "
129 *
this,
"enable-arm-sve",
130 desc(
"Enables the use of ArmSVE dialect while lowering the vector "
134 *
this,
"enable-x86vector",
135 desc(
"Enables the use of X86Vector dialect while lowering the vector "
141 desc(
"GPU target triple")};
143 desc(
"GPU target architecture")};
145 desc(
"GPU target features")};
162 *
this,
"gpu-format", desc(
"GPU compilation format"), init(
"fatbin")};
166 *
this,
"enable-gpu-libgen",
167 desc(
"Enables GPU acceleration by means of direct library calls (like "
173 enableIndexReduction, enableGPULibgen,
174 enableRuntimeLibrary);
185 ConvertVectorToLLVMPassOptions opts{};
186 opts.reassociateFPReductions = reassociateFPReductions;
187 opts.force32BitVectorIndices = force32BitVectorIndices;
188 opts.armNeon = armNeon;
189 opts.armSVE = armSVE;
191 opts.x86Vector = x86Vector;
205 const SparseCompilerOptions &
options);
static llvm::ManagedStatic< PassManagerOptions > options
This class represents a pass manager that runs passes on either a specific operation type,...
Subclasses of PassPipelineOptions provide a set of options that can be used to initialize a pass pipe...
Detect if any of the given parameter types has a sub-element handler.
void registerSparseTensorPipelines()
Registers all pipelines for the sparse_tensor dialect.
void buildSparseCompiler(OpPassManager &pm, const SparseCompilerOptions &options)
Adds the "sparse-compiler" pipeline to the OpPassManager.
This header declares functions that assist transformations in the MemRef dialect.
SparseToSparseConversionStrategy sparseToSparseConversionStrategy(int32_t flag)
Converts command-line sparse2sparse flag to the strategy enum.
SparseTensorConversion options.
Options for the Sparsification pass.
Options for the "sparse-compiler" pipeline.
ConvertVectorToLLVMPassOptions lowerVectorToLLVMOptions() const
Projects out the options for createConvertVectorToLLVMPass.
SparseTensorConversionOptions sparseTensorConversionOptions() const
Projects out the options for createSparseTensorConversionPass.
SparsificationOptions sparsificationOptions() const
Projects out the options for createSparsificationPass.