LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::array::ArrayIndexGen Class Reference

Helper for converting between linear and multi-dimensional indexing with checks to ensure indices are in range for the ArrayType. More...

#include <ArrayTypeHelper.h>

Public Member Functions

 ~ArrayIndexGen ()=default
 
 ArrayIndexGen (ArrayIndexGen &&)=default
 
ArrayIndexGenoperator= (ArrayIndexGen &&)=default
 
 ArrayIndexGen (const ArrayIndexGen &)=delete
 
ArrayIndexGenoperator= (const ArrayIndexGen &)=delete
 
std::optional< llvm::SmallVector< mlir::Value > > delinearize (int64_t, mlir::Location, mlir::OpBuilder &) const
 
std::optional< llvm::SmallVector< mlir::Attribute > > delinearize (int64_t, mlir::MLIRContext *) const
 
template<typename InListType>
std::optional< int64_t > linearize (InListType multiDimIndex) const
 
template<typename InListType>
std::optional< llvm::SmallVector< mlir::Attribute > > checkAndConvert (InListType multiDimIndex)
 
template<>
std::optional< int64_t > linearize (ArrayRef< int64_t > multiDimIndex) const
 
template<>
std::optional< int64_t > linearize (ArrayRef< Attribute > multiDimIndex) const
 
template<>
std::optional< int64_t > linearize (ArrayRef< Operation * > multiDimIndex) const
 
template<>
std::optional< int64_t > linearize (ArrayRef< Value > multiDimIndex) const
 
template<typename InListType>
std::optional< SmallVector< Attribute > > checkAndConvert (InListType)
 
template<>
std::optional< SmallVector< Attribute > > checkAndConvert (OperandRange multiDimIndex)
 

Static Public Member Functions

static ArrayIndexGen from (ArrayType)
 Construct new ArrayIndexGen. Will assert if hasStaticShape() is false.
 

Detailed Description

Helper for converting between linear and multi-dimensional indexing with checks to ensure indices are in range for the ArrayType.

Definition at line 30 of file ArrayTypeHelper.h.

Constructor & Destructor Documentation

◆ ~ArrayIndexGen()

llzk::array::ArrayIndexGen::~ArrayIndexGen ( )
default

◆ ArrayIndexGen() [1/2]

llzk::array::ArrayIndexGen::ArrayIndexGen ( ArrayIndexGen && )
default

◆ ArrayIndexGen() [2/2]

llzk::array::ArrayIndexGen::ArrayIndexGen ( const ArrayIndexGen & )
delete

Member Function Documentation

◆ checkAndConvert() [1/3]

template<typename InListType>
std::optional< llvm::SmallVector< mlir::Attribute > > llzk::array::ArrayIndexGen::checkAndConvert ( InListType multiDimIndex)

◆ checkAndConvert() [2/3]

template<typename InListType>
std::optional< SmallVector< Attribute > > llzk::array::ArrayIndexGen::checkAndConvert ( InListType )

Definition at line 182 of file ArrayTypeHelper.cpp.

◆ checkAndConvert() [3/3]

template<>
std::optional< SmallVector< Attribute > > llzk::array::ArrayIndexGen::checkAndConvert ( OperandRange multiDimIndex)

Definition at line 188 of file ArrayTypeHelper.cpp.

◆ delinearize() [1/2]

std::optional< llvm::SmallVector< mlir::Value > > llzk::array::ArrayIndexGen::delinearize ( int64_t ,
mlir::Location ,
mlir::OpBuilder &  ) const

◆ delinearize() [2/2]

std::optional< llvm::SmallVector< mlir::Attribute > > llzk::array::ArrayIndexGen::delinearize ( int64_t ,
mlir::MLIRContext *  ) const

◆ from()

ArrayIndexGen ArrayIndexGen::from ( ArrayType t)
static

Construct new ArrayIndexGen. Will assert if hasStaticShape() is false.

Definition at line 33 of file ArrayTypeHelper.cpp.

◆ linearize() [1/5]

template<>
std::optional< int64_t > llzk::array::ArrayIndexGen::linearize ( ArrayRef< Attribute > multiDimIndex) const

Definition at line 168 of file ArrayTypeHelper.cpp.

◆ linearize() [2/5]

template<>
std::optional< int64_t > llzk::array::ArrayIndexGen::linearize ( ArrayRef< int64_t > multiDimIndex) const

Definition at line 163 of file ArrayTypeHelper.cpp.

◆ linearize() [3/5]

template<>
std::optional< int64_t > llzk::array::ArrayIndexGen::linearize ( ArrayRef< Operation * > multiDimIndex) const

Definition at line 173 of file ArrayTypeHelper.cpp.

◆ linearize() [4/5]

template<>
std::optional< int64_t > llzk::array::ArrayIndexGen::linearize ( ArrayRef< Value > multiDimIndex) const

Definition at line 177 of file ArrayTypeHelper.cpp.

◆ linearize() [5/5]

template<typename InListType>
std::optional< int64_t > ArrayIndexGen::linearize ( InListType multiDimIndex) const

Definition at line 158 of file ArrayTypeHelper.cpp.

◆ operator=() [1/2]

ArrayIndexGen & llzk::array::ArrayIndexGen::operator= ( ArrayIndexGen && )
default

◆ operator=() [2/2]

ArrayIndexGen & llzk::array::ArrayIndexGen::operator= ( const ArrayIndexGen & )
delete

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