MLIR  20.0.0git
Public Member Functions | List of all members
mlir::sparse_tensor::SparsificationAndBufferizationPass Class Reference

A pass that lowers tensor ops to memref ops, regardless of whether they are dense or sparse. More...

+ Inheritance diagram for mlir::sparse_tensor::SparsificationAndBufferizationPass:

Public Member Functions

 SparsificationAndBufferizationPass (const bufferization::OneShotBufferizationOptions &bufferizationOptions, const SparsificationOptions &sparsificationOptions, bool createSparseDeallocs, bool enableRuntimeLibrary, bool enableBufferInitialization)
 
 SparsificationAndBufferizationPass (const bufferization::OneShotBufferizationOptions &bufferizationOptions, const SparsificationOptions &sparsificationOptions, bool createSparseDeallocs, bool enableRuntimeLibrary, bool enableBufferInitialization, unsigned vl, bool vla, bool index32, bool gpu, SparseEmitStrategy emitStrategy, SparseParallelizationStrategy parallelizationStrategy)
 
LogicalResult runDenseBufferization ()
 Bufferize all dense ops. More...
 
void runOnOperation () override
 

Detailed Description

A pass that lowers tensor ops to memref ops, regardless of whether they are dense or sparse.

One-Shot Analysis is used to detect RaW conflicts and to insert buffer copies of the tensor level (insertTensorCopies). Afterwards, the lowering of tensor ops to memref ops follows a different code path depending on whether the op is sparse or dense:

Definition at line 60 of file SparsificationAndBufferizationPass.cpp.

Constructor & Destructor Documentation

◆ SparsificationAndBufferizationPass() [1/2]

mlir::sparse_tensor::SparsificationAndBufferizationPass::SparsificationAndBufferizationPass ( const bufferization::OneShotBufferizationOptions bufferizationOptions,
const SparsificationOptions sparsificationOptions,
bool  createSparseDeallocs,
bool  enableRuntimeLibrary,
bool  enableBufferInitialization 
)
inline

Definition at line 65 of file SparsificationAndBufferizationPass.cpp.

◆ SparsificationAndBufferizationPass() [2/2]

mlir::sparse_tensor::SparsificationAndBufferizationPass::SparsificationAndBufferizationPass ( const bufferization::OneShotBufferizationOptions bufferizationOptions,
const SparsificationOptions sparsificationOptions,
bool  createSparseDeallocs,
bool  enableRuntimeLibrary,
bool  enableBufferInitialization,
unsigned  vl,
bool  vla,
bool  index32,
bool  gpu,
SparseEmitStrategy  emitStrategy,
SparseParallelizationStrategy  parallelizationStrategy 
)
inline

Definition at line 76 of file SparsificationAndBufferizationPass.cpp.

Member Function Documentation

◆ runDenseBufferization()

LogicalResult mlir::sparse_tensor::SparsificationAndBufferizationPass::runDenseBufferization ( )
inline

Bufferize all dense ops.

This assumes that no further analysis is needed and that all required buffer copies were already inserted by insertTensorCopies in the form of bufferization.alloc_tensor ops.

Definition at line 100 of file SparsificationAndBufferizationPass.cpp.

References mlir::bufferization::bufferizeModuleOp(), mlir::sparse_tensor::containsSparseTensor(), mlir::bufferization::OpFilter::denyOperation(), mlir::Operation::getOperands(), mlir::Operation::getResults(), mlir::bufferization::BufferizationOptions::opFilter, and mlir::bufferization::removeBufferizationAttributesInModule().

Referenced by runOnOperation().

◆ runOnOperation()

void mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation ( )
inlineoverride

The documentation for this class was generated from the following file: