MLIR  19.0.0git
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
mlir::sparse_tensor::SparseIterator Class Referenceabstract

Helper class that generates loop conditions, etc, to traverse a sparse tensor level. More...

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

Public Member Functions

virtual ~SparseIterator ()=default
 
void setSparseEmitStrategy (SparseEmitStrategy strategy)
 
virtual std::string getDebugInterfacePrefix () const =0
 
virtual SmallVector< TypegetCursorValTypes (OpBuilder &b) const =0
 
Value getCrd () const
 
ValueRange getBatchCrds () const
 
ValueRange getCursor () const
 
void seek (ValueRange vals)
 
virtual bool isBatchIterator () const =0
 
virtual bool randomAccessible () const =0
 
virtual bool iteratableByFor () const
 
virtual Value upperBound (OpBuilder &b, Location l) const =0
 
virtual SmallVector< Valueserialize () const
 
virtual void deserialize (ValueRange vs)
 
void genInit (OpBuilder &b, Location l, const SparseIterator *p)
 
ValueRange forward (OpBuilder &b, Location l)
 
void locate (OpBuilder &b, Location l, Value crd)
 
Value genNotEnd (OpBuilder &b, Location l)
 
Value deref (OpBuilder &b, Location l)
 
virtual void genInitImpl (OpBuilder &, Location, const SparseIterator *)=0
 
virtual ValueRange forwardImpl (OpBuilder &b, Location l)=0
 
virtual void locateImpl (OpBuilder &b, Location l, Value crd)
 
virtual Value genNotEndImpl (OpBuilder &b, Location l)=0
 
virtual Value derefImpl (OpBuilder &b, Location l)=0
 
virtual ValueRange getCurPosition () const
 
virtual std::pair< Value, ValuegenForCond (OpBuilder &b, Location l)
 
std::pair< Value, ValueRangegenWhileCond (OpBuilder &b, Location l, ValueRange vs)
 
virtual ValueRange forwardIf (OpBuilder &b, Location l, Value cond)
 
ValueRange linkNewScope (ValueRange pos)
 

Public Attributes

const IterKind kind
 
const unsigned tid
 
const unsigned lvl
 

Protected Member Functions

 SparseIterator (IterKind kind, unsigned tid, unsigned lvl, unsigned cursorValsCnt, SmallVectorImpl< Value > &cursorValStorage)
 
 SparseIterator (IterKind kind, unsigned cursorValsCnt, SmallVectorImpl< Value > &cursorValStorage, const SparseIterator &delegate)
 
 SparseIterator (IterKind kind, const SparseIterator &wrap, unsigned extraCursorCnt=0)
 
void updateCrd (Value crd)
 
MutableArrayRef< ValuegetMutCursorVals ()
 
void inherentBatch (const SparseIterator &parent)
 

Protected Attributes

SparseEmitStrategy emitStrategy
 
SmallVector< ValuebatchCrds
 

Detailed Description

Helper class that generates loop conditions, etc, to traverse a sparse tensor level.

Definition at line 142 of file SparseTensorIterator.h.

Constructor & Destructor Documentation

◆ SparseIterator() [1/3]

mlir::sparse_tensor::SparseIterator::SparseIterator ( IterKind  kind,
unsigned  tid,
unsigned  lvl,
unsigned  cursorValsCnt,
SmallVectorImpl< Value > &  cursorValStorage 
)
inlineprotected

Definition at line 149 of file SparseTensorIterator.h.

◆ SparseIterator() [2/3]

mlir::sparse_tensor::SparseIterator::SparseIterator ( IterKind  kind,
unsigned  cursorValsCnt,
SmallVectorImpl< Value > &  cursorValStorage,
const SparseIterator delegate 
)
inlineprotected

Definition at line 155 of file SparseTensorIterator.h.

◆ SparseIterator() [3/3]

mlir::sparse_tensor::SparseIterator::SparseIterator ( IterKind  kind,
const SparseIterator wrap,
unsigned  extraCursorCnt = 0 
)
inlineprotected

Definition at line 161 of file SparseTensorIterator.h.

References wrap().

◆ ~SparseIterator()

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

Member Function Documentation

◆ deref()

Value SparseIterator::deref ( OpBuilder b,
Location  l 
)

◆ derefImpl()

virtual Value mlir::sparse_tensor::SparseIterator::derefImpl ( OpBuilder b,
Location  l 
)
pure virtual

Referenced by deref().

◆ deserialize()

virtual void mlir::sparse_tensor::SparseIterator::deserialize ( ValueRange  vs)
inlinevirtual

Definition at line 226 of file SparseTensorIterator.h.

◆ forward()

ValueRange SparseIterator::forward ( OpBuilder b,
Location  l 
)

◆ forwardIf()

ValueRange SparseIterator::forwardIf ( OpBuilder b,
Location  l,
Value  cond 
)
virtual

◆ forwardImpl()

virtual ValueRange mlir::sparse_tensor::SparseIterator::forwardImpl ( OpBuilder b,
Location  l 
)
pure virtual

Referenced by forward().

◆ genForCond()

virtual std::pair<Value, Value> mlir::sparse_tensor::SparseIterator::genForCond ( OpBuilder b,
Location  l 
)
inlinevirtual

Definition at line 272 of file SparseTensorIterator.h.

References getCrd(), randomAccessible(), and upperBound().

◆ genInit()

void SparseIterator::genInit ( OpBuilder b,
Location  l,
const SparseIterator p 
)

◆ genInitImpl()

virtual void mlir::sparse_tensor::SparseIterator::genInitImpl ( OpBuilder ,
Location  ,
const SparseIterator  
)
pure virtual

Referenced by genInit().

◆ genNotEnd()

Value SparseIterator::genNotEnd ( OpBuilder b,
Location  l 
)

◆ genNotEndImpl()

virtual Value mlir::sparse_tensor::SparseIterator::genNotEndImpl ( OpBuilder b,
Location  l 
)
pure virtual

Referenced by genNotEnd().

◆ genWhileCond()

std::pair<Value, ValueRange> mlir::sparse_tensor::SparseIterator::genWhileCond ( OpBuilder b,
Location  l,
ValueRange  vs 
)
inline

Definition at line 279 of file SparseTensorIterator.h.

References genNotEnd(), and linkNewScope().

◆ getBatchCrds()

ValueRange mlir::sparse_tensor::SparseIterator::getBatchCrds ( ) const
inline

Definition at line 182 of file SparseTensorIterator.h.

References batchCrds.

◆ getCrd()

Value mlir::sparse_tensor::SparseIterator::getCrd ( ) const
inline

◆ getCurPosition()

virtual ValueRange mlir::sparse_tensor::SparseIterator::getCurPosition ( ) const
inlinevirtual

Definition at line 269 of file SparseTensorIterator.h.

References getCursor().

◆ getCursor()

ValueRange mlir::sparse_tensor::SparseIterator::getCursor ( ) const
inline

Definition at line 183 of file SparseTensorIterator.h.

Referenced by deref(), forward(), forwardIf(), genNotEnd(), getCurPosition(), and locate().

◆ getCursorValTypes()

virtual SmallVector<Type> mlir::sparse_tensor::SparseIterator::getCursorValTypes ( OpBuilder b) const
pure virtual

Referenced by forward(), genInit(), and locate().

◆ getDebugInterfacePrefix()

virtual std::string mlir::sparse_tensor::SparseIterator::getDebugInterfacePrefix ( ) const
pure virtual

◆ getMutCursorVals()

MutableArrayRef<Value> mlir::sparse_tensor::SparseIterator::getMutCursorVals ( )
inlineprotected

Definition at line 310 of file SparseTensorIterator.h.

◆ inherentBatch()

void mlir::sparse_tensor::SparseIterator::inherentBatch ( const SparseIterator parent)
inlineprotected

Definition at line 315 of file SparseTensorIterator.h.

References batchCrds.

Referenced by genInit().

◆ isBatchIterator()

virtual bool mlir::sparse_tensor::SparseIterator::isBatchIterator ( ) const
pure virtual

◆ iteratableByFor()

virtual bool mlir::sparse_tensor::SparseIterator::iteratableByFor ( ) const
inlinevirtual

Definition at line 207 of file SparseTensorIterator.h.

◆ linkNewScope()

ValueRange mlir::sparse_tensor::SparseIterator::linkNewScope ( ValueRange  pos)
inline

Definition at line 300 of file SparseTensorIterator.h.

References randomAccessible(), and seek().

Referenced by genWhileCond().

◆ locate()

void SparseIterator::locate ( OpBuilder b,
Location  l,
Value  crd 
)

◆ locateImpl()

virtual void mlir::sparse_tensor::SparseIterator::locateImpl ( OpBuilder b,
Location  l,
Value  crd 
)
inlinevirtual

Definition at line 254 of file SparseTensorIterator.h.

Referenced by locate().

◆ randomAccessible()

virtual bool mlir::sparse_tensor::SparseIterator::randomAccessible ( ) const
pure virtual

◆ seek()

void mlir::sparse_tensor::SparseIterator::seek ( ValueRange  vals)
inline

Definition at line 188 of file SparseTensorIterator.h.

References copy().

Referenced by forward(), forwardIf(), genInit(), linkNewScope(), and locate().

◆ serialize()

virtual SmallVector<Value> mlir::sparse_tensor::SparseIterator::serialize ( ) const
inlinevirtual

Definition at line 223 of file SparseTensorIterator.h.

◆ setSparseEmitStrategy()

void mlir::sparse_tensor::SparseIterator::setSparseEmitStrategy ( SparseEmitStrategy  strategy)
inline

Definition at line 174 of file SparseTensorIterator.h.

References emitStrategy.

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

◆ updateCrd()

void mlir::sparse_tensor::SparseIterator::updateCrd ( Value  crd)
inlineprotected

Definition at line 308 of file SparseTensorIterator.h.

Referenced by deref(), and locate().

◆ upperBound()

virtual Value mlir::sparse_tensor::SparseIterator::upperBound ( OpBuilder b,
Location  l 
) const
pure virtual

Referenced by genForCond().

Member Data Documentation

◆ batchCrds

SmallVector<Value> mlir::sparse_tensor::SparseIterator::batchCrds
protected

Definition at line 320 of file SparseTensorIterator.h.

Referenced by getBatchCrds(), and inherentBatch().

◆ emitStrategy

SparseEmitStrategy mlir::sparse_tensor::SparseIterator::emitStrategy
protected

◆ kind

const IterKind mlir::sparse_tensor::SparseIterator::kind

◆ lvl

const unsigned mlir::sparse_tensor::SparseIterator::lvl

◆ tid

const unsigned mlir::sparse_tensor::SparseIterator::tid

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