MLIR  20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef > Class Template Reference

A helper class around an array of values that corresponds to a sparse tensor. More...

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

+ Inheritance diagram for mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >:

Public Member Functions

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
 
ValueArrayRef getFields () const
 
StorageLayout getLayout () const
 

Protected Member Functions

 SparseTensorDescriptorImpl (SparseTensorType stt, ValueArrayRef fields)
 

Protected Attributes

SparseTensorType rType
 
ValueArrayRef fields
 
StorageLayout layout
 

Detailed Description

template<typename ValueArrayRef>
class mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >

A helper class around an array of values that corresponds to a sparse tensor.

This class provides a set of meaningful APIs to query and update a particular field in a consistent way. Users should not make assumptions on how a sparse tensor is laid out but instead rely on this class to access the right value for the right field.

Definition at line 51 of file SparseTensorDescriptor.h.

Constructor & Destructor Documentation

◆ SparseTensorDescriptorImpl()

template<typename ValueArrayRef >
mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::SparseTensorDescriptorImpl ( SparseTensorType  stt,
ValueArrayRef  fields 
)
inlineprotected

Member Function Documentation

◆ getAOSMemRef()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getAOSMemRef ( ) const
inline

◆ getCrdMemRefIndexAndStride()

template<typename ValueArrayRef >
std::pair<FieldIndex, unsigned> mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getCrdMemRefIndexAndStride ( Level  lvl) const
inline

◆ getCrdMemSize()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getCrdMemSize ( OpBuilder builder,
Location  loc,
Level  lvl 
) const
inline

◆ getField()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getField ( FieldIndex  fidx) const
inline

◆ getFields()

template<typename ValueArrayRef >
ValueArrayRef mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getFields ( ) const
inline

◆ getLayout()

template<typename ValueArrayRef >
StorageLayout mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getLayout ( ) const
inline

◆ getLvlSize()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getLvlSize ( OpBuilder builder,
Location  loc,
Level  lvl 
) const
inline

◆ getMemRefElementType()

template<typename ValueArrayRef >
Type mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getMemRefElementType ( SparseTensorFieldKind  kind,
std::optional< Level lvl 
) const
inline

◆ getMemRefField() [1/2]

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getMemRefField ( FieldIndex  fidx) const
inline

◆ getMemRefField() [2/2]

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getMemRefField ( SparseTensorFieldKind  kind,
std::optional< Level lvl 
) const
inline

◆ getMemRefFieldIndex()

template<typename ValueArrayRef >
FieldIndex mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getMemRefFieldIndex ( SparseTensorFieldKind  kind,
std::optional< Level lvl 
) const
inline

◆ getMemRefFields()

template<typename ValueArrayRef >
ValueRange mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getMemRefFields ( ) const
inline

◆ getNumFields()

template<typename ValueArrayRef >
unsigned mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getNumFields ( ) const
inline

◆ getPosMemRef()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getPosMemRef ( Level  lvl) const
inline

◆ getPosMemSize()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getPosMemSize ( OpBuilder builder,
Location  loc,
Level  lvl 
) const
inline

◆ getRankedTensorType()

template<typename ValueArrayRef >
RankedTensorType mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getRankedTensorType ( ) const
inline

◆ getSpecifier()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getSpecifier ( ) const
inline

Getters: get the value for required field.

Definition at line 75 of file SparseTensorDescriptor.h.

References mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::fields.

◆ getSpecifierField()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getSpecifierField ( OpBuilder builder,
Location  loc,
StorageSpecifierKind  kind,
std::optional< Level lvl 
) const
inline

◆ getValMemRef()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getValMemRef ( ) const
inline

◆ getValMemSize()

template<typename ValueArrayRef >
Value mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::getValMemSize ( OpBuilder builder,
Location  loc 
) const
inline

Member Data Documentation

◆ fields

template<typename ValueArrayRef >
ValueArrayRef mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::fields
protected

◆ layout

template<typename ValueArrayRef >
StorageLayout mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::layout
protected

◆ rType

template<typename ValueArrayRef >
SparseTensorType mlir::sparse_tensor::SparseTensorDescriptorImpl< ValueArrayRef >::rType
protected

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