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

Using SmallVector for mutable descriptor allows users to reuse it as a tmp buffers to append value for some special cases, though users should be responsible to restore the buffer to legal states after their use. More...

#include "Dialect/SparseTensor/Transforms/Utils/SparseTensorDescriptor.h"

+ Inheritance diagram for mlir::sparse_tensor::MutSparseTensorDescriptor:

Public Member Functions

 MutSparseTensorDescriptor (SparseTensorType stt, SmallVectorImpl< Value > &buffers)
 
 operator SparseTensorDescriptor () const
 
void setMemRefField (SparseTensorFieldKind kind, std::optional< Level > lvl, Value v)
 Adds additional setters for mutable descriptor, update the value for required field. More...
 
void setMemRefField (FieldIndex fidx, Value v)
 
void setField (FieldIndex fidx, Value v)
 
void setSpecifier (Value newSpec)
 
void setSpecifierField (OpBuilder &builder, Location loc, StorageSpecifierKind kind, std::optional< Level > lvl, Value v)
 
void setValMemSize (OpBuilder &builder, Location loc, Value v)
 
void setCrdMemSize (OpBuilder &builder, Location loc, Level lvl, Value v)
 
void setPosMemSize (OpBuilder &builder, Location loc, Level lvl, Value v)
 
void setLvlSize (OpBuilder &builder, Location loc, Level lvl, Value v)
 
- Public Member Functions inherited from mlir::sparse_tensor::SparseTensorDescriptorImpl< SmallVectorImpl< Value > & >
FieldIndex getMemRefFieldIndex (SparseTensorFieldKind kind, std::optional< Level > lvl) const
 
unsigned getNumFields () const
 
Value getSpecifier () const
 Getters: get the value for required field. More...
 
Value getSpecifierField (OpBuilder &builder, Location loc, StorageSpecifierKind kind, std::optional< Level > lvl) const
 
Value getLvlSize (OpBuilder &builder, Location loc, Level lvl) const
 
Value getPosMemRef (Level lvl) const
 
Value getValMemRef () const
 
Value getMemRefField (SparseTensorFieldKind kind, std::optional< Level > lvl) const
 
Value getMemRefField (FieldIndex fidx) const
 
Value getPosMemSize (OpBuilder &builder, Location loc, Level lvl) const
 
Value getCrdMemSize (OpBuilder &builder, Location loc, Level lvl) const
 
Value getValMemSize (OpBuilder &builder, Location loc) const
 
Type getMemRefElementType (SparseTensorFieldKind kind, std::optional< Level > lvl) const
 
Value getField (FieldIndex fidx) const
 
ValueRange getMemRefFields () const
 
std::pair< FieldIndex, unsigned > getCrdMemRefIndexAndStride (Level lvl) const
 
Value getAOSMemRef () const
 
RankedTensorType getRankedTensorType () const
 
SmallVectorImpl< Value > & getFields () const
 
StorageLayout getLayout () const
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::sparse_tensor::SparseTensorDescriptorImpl< SmallVectorImpl< Value > & >
 SparseTensorDescriptorImpl (SparseTensorType stt, SmallVectorImpl< Value > & fields)
 
- Protected Attributes inherited from mlir::sparse_tensor::SparseTensorDescriptorImpl< SmallVectorImpl< Value > & >
SparseTensorType rType
 
SmallVectorImpl< Value > & fields
 
StorageLayout layout
 

Detailed Description

Using SmallVector for mutable descriptor allows users to reuse it as a tmp buffers to append value for some special cases, though users should be responsible to restore the buffer to legal states after their use.

It is probably not a clean way, but it is the most efficient way to avoid copying the fields into another SmallVector. If a more clear way is wanted, we should change it to MutableArrayRef instead.

Definition at line 170 of file SparseTensorDescriptor.h.

Constructor & Destructor Documentation

◆ MutSparseTensorDescriptor()

mlir::sparse_tensor::MutSparseTensorDescriptor::MutSparseTensorDescriptor ( SparseTensorType  stt,
SmallVectorImpl< Value > &  buffers 
)
inline

Definition at line 173 of file SparseTensorDescriptor.h.

Member Function Documentation

◆ operator SparseTensorDescriptor()

mlir::sparse_tensor::MutSparseTensorDescriptor::operator SparseTensorDescriptor ( ) const
inline

◆ setCrdMemSize()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setCrdMemSize ( OpBuilder builder,
Location  loc,
Level  lvl,
Value  v 
)
inline

Definition at line 218 of file SparseTensorDescriptor.h.

References setSpecifierField().

◆ setField()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setField ( FieldIndex  fidx,
Value  v 
)
inline

◆ setLvlSize()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setLvlSize ( OpBuilder builder,
Location  loc,
Level  lvl,
Value  v 
)
inline

Definition at line 226 of file SparseTensorDescriptor.h.

References setSpecifierField().

◆ setMemRefField() [1/2]

void mlir::sparse_tensor::MutSparseTensorDescriptor::setMemRefField ( FieldIndex  fidx,
Value  v 
)
inline

◆ setMemRefField() [2/2]

void mlir::sparse_tensor::MutSparseTensorDescriptor::setMemRefField ( SparseTensorFieldKind  kind,
std::optional< Level lvl,
Value  v 
)
inline

Adds additional setters for mutable descriptor, update the value for required field.

Definition at line 188 of file SparseTensorDescriptor.h.

◆ setPosMemSize()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setPosMemSize ( OpBuilder builder,
Location  loc,
Level  lvl,
Value  v 
)
inline

Definition at line 222 of file SparseTensorDescriptor.h.

References setSpecifierField().

◆ setSpecifier()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setSpecifier ( Value  newSpec)
inline

◆ setSpecifierField()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setSpecifierField ( OpBuilder builder,
Location  loc,
StorageSpecifierKind  kind,
std::optional< Level lvl,
Value  v 
)
inline

Definition at line 205 of file SparseTensorDescriptor.h.

Referenced by setCrdMemSize(), setLvlSize(), setPosMemSize(), and setValMemSize().

◆ setValMemSize()

void mlir::sparse_tensor::MutSparseTensorDescriptor::setValMemSize ( OpBuilder builder,
Location  loc,
Value  v 
)
inline

Definition at line 213 of file SparseTensorDescriptor.h.

References setSpecifierField().


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