MLIR 22.0.0git
mlir::sparse_tensor::SparseTensorLevel Class Referenceabstract

The base class for all types of sparse tensor levels. More...

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

Public Member Functions

virtual ~SparseTensorLevel ()=default
std::string toString () const
virtual Value peekCrdAt (OpBuilder &b, Location l, ValueRange batchPrefix, Value iv) const =0
virtual std::pair< Value, ValuepeekRangeAt (OpBuilder &b, Location l, ValueRange batchPrefix, ValueRange parentPos, Value inPadZone=nullptr) const =0
 Peeks the lower and upper bound to fully traverse the level with the given position parentPos, see SparseTensorIterator::getCurPostion(), that the immediate parent level is current at.
virtual std::pair< Value, ValuecollapseRangeBetween (OpBuilder &b, Location l, ValueRange batchPrefix, std::pair< Value, Value > parentRange) const
Level getLevel () const
LevelType getLT () const
Value getSize () const
virtual ValueRange getLvlBuffers () const =0
bool isUnique () const

Public Attributes

const unsigned tid
const unsigned lvl
const LevelType lt
const Value lvlSize

Protected Member Functions

 SparseTensorLevel (unsigned tid, unsigned lvl, LevelType lt, Value lvlSize)

Detailed Description

The base class for all types of sparse tensor levels.

It provides interfaces to query the loop range (see peekRangeAt) and look up the coordinates (see peekCrdAt).

Definition at line 24 of file SparseTensorIterator.h.

Constructor & Destructor Documentation

◆ ~SparseTensorLevel()

virtual mlir::sparse_tensor::SparseTensorLevel::~SparseTensorLevel ( )
virtualdefault

◆ SparseTensorLevel()

mlir::sparse_tensor::SparseTensorLevel::SparseTensorLevel ( unsigned tid,
unsigned lvl,
LevelType lt,
Value lvlSize )
inlineprotected

Definition at line 73 of file SparseTensorIterator.h.

References lt, lvl, lvlSize, and tid.

Member Function Documentation

◆ collapseRangeBetween()

virtual std::pair< Value, Value > mlir::sparse_tensor::SparseTensorLevel::collapseRangeBetween ( OpBuilder & b,
Location l,
ValueRange batchPrefix,
std::pair< Value, Value > parentRange ) const
inlinevirtual

Definition at line 57 of file SparseTensorIterator.h.

References b.

◆ getLevel()

Level mlir::sparse_tensor::SparseTensorLevel::getLevel ( ) const
inline

Definition at line 62 of file SparseTensorIterator.h.

References lvl.

◆ getLT()

LevelType mlir::sparse_tensor::SparseTensorLevel::getLT ( ) const
inline

Definition at line 63 of file SparseTensorIterator.h.

References lt.

Referenced by mlir::sparse_tensor::makeSimpleIterator().

◆ getLvlBuffers()

virtual ValueRange mlir::sparse_tensor::SparseTensorLevel::getLvlBuffers ( ) const
pure virtual

◆ getSize()

Value mlir::sparse_tensor::SparseTensorLevel::getSize ( ) const
inline

Definition at line 64 of file SparseTensorIterator.h.

References lvlSize.

◆ isUnique()

bool mlir::sparse_tensor::SparseTensorLevel::isUnique ( ) const
inline

Definition at line 70 of file SparseTensorIterator.h.

References mlir::sparse_tensor::isUniqueLT(), and lt.

◆ peekCrdAt()

virtual Value mlir::sparse_tensor::SparseTensorLevel::peekCrdAt ( OpBuilder & b,
Location l,
ValueRange batchPrefix,
Value iv ) const
pure virtual

References b.

◆ peekRangeAt()

virtual std::pair< Value, Value > mlir::sparse_tensor::SparseTensorLevel::peekRangeAt ( OpBuilder & b,
Location l,
ValueRange batchPrefix,
ValueRange parentPos,
Value inPadZone = nullptr ) const
pure virtual

Peeks the lower and upper bound to fully traverse the level with the given position parentPos, see SparseTensorIterator::getCurPostion(), that the immediate parent level is current at.

Returns a pair of values for posLo and loopHi respectively.

For a dense level, the posLo is the linearized position at beginning, while loopHi is the largest coordinate, it also implies that the smallest coordinate to start the loop is 0.

For a sparse level, [posLo, loopHi) specifies the range of index pointer to load coordinate from the coordinate buffer.

References b.

◆ toString()

std::string mlir::sparse_tensor::SparseTensorLevel::toString ( ) const
inline

Definition at line 33 of file SparseTensorIterator.h.

References lt, lvl, tid, and mlir::sparse_tensor::toMLIRString().

Member Data Documentation

◆ lt

const LevelType mlir::sparse_tensor::SparseTensorLevel::lt

Definition at line 78 of file SparseTensorIterator.h.

Referenced by getLT(), isUnique(), SparseTensorLevel(), and toString().

◆ lvl

const unsigned mlir::sparse_tensor::SparseTensorLevel::lvl

Definition at line 77 of file SparseTensorIterator.h.

Referenced by getLevel(), SparseTensorLevel(), and toString().

◆ lvlSize

const Value mlir::sparse_tensor::SparseTensorLevel::lvlSize

Definition at line 79 of file SparseTensorIterator.h.

Referenced by getSize(), and SparseTensorLevel().

◆ tid

const unsigned mlir::sparse_tensor::SparseTensorLevel::tid

Definition at line 77 of file SparseTensorIterator.h.

Referenced by SparseTensorLevel(), and toString().


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