MLIR  19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
mlir::detail::ElementsAttrIndexer Struct Reference

This class provides support for indexing into the element range of an ElementsAttr. More...

#include "mlir/IR/BuiltinAttributeInterfaces.h"

Public Member Functions

 ElementsAttrIndexer ()
 
 ElementsAttrIndexer (ElementsAttrIndexer &&rhs)
 
 ElementsAttrIndexer (const ElementsAttrIndexer &rhs)
 
 ~ElementsAttrIndexer ()
 
template<typename T >
at (uint64_t index) const
 Access the element at the given index. More...
 

Static Public Member Functions

template<typename IteratorT >
static ElementsAttrIndexer nonContiguous (bool isSplat, IteratorT &&iterator)
 Construct an indexer for a non-contiguous range starting at the given iterator. More...
 
template<typename T >
static ElementsAttrIndexer contiguous (bool isSplat, const T *firstEltPtr)
 

Detailed Description

This class provides support for indexing into the element range of an ElementsAttr.

It is used to opaquely wrap either a contiguous range, via ElementsAttrIndexer::contiguous, or a non-contiguous range, via ElementsAttrIndexer::nonContiguous, A contiguous range is an array-like range, where all of the elements are layed out sequentially in memory. A non-contiguous range implies no contiguity, and elements may even be materialized when indexing, such as the case for a mapped_range.

Definition at line 34 of file BuiltinAttributeInterfaces.h.

Constructor & Destructor Documentation

◆ ElementsAttrIndexer() [1/3]

mlir::detail::ElementsAttrIndexer::ElementsAttrIndexer ( )
inline

Definition at line 36 of file BuiltinAttributeInterfaces.h.

◆ ElementsAttrIndexer() [2/3]

mlir::detail::ElementsAttrIndexer::ElementsAttrIndexer ( ElementsAttrIndexer &&  rhs)
inline

Definition at line 38 of file BuiltinAttributeInterfaces.h.

References conState, and nonConState.

◆ ElementsAttrIndexer() [3/3]

mlir::detail::ElementsAttrIndexer::ElementsAttrIndexer ( const ElementsAttrIndexer rhs)
inline

Definition at line 45 of file BuiltinAttributeInterfaces.h.

References conState, and nonConState.

◆ ~ElementsAttrIndexer()

mlir::detail::ElementsAttrIndexer::~ElementsAttrIndexer ( )
inline

Definition at line 52 of file BuiltinAttributeInterfaces.h.

References nonConState.

Member Function Documentation

◆ at()

template<typename T >
T mlir::detail::ElementsAttrIndexer::at ( uint64_t  index) const
inline

Access the element at the given index.

Definition at line 80 of file BuiltinAttributeInterfaces.h.

References conState, and nonConState.

Referenced by mlir::detail::ElementsAttrIterator< T >::operator*().

◆ contiguous()

template<typename T >
static ElementsAttrIndexer mlir::detail::ElementsAttrIndexer::contiguous ( bool  isSplat,
const T *  firstEltPtr 
)
inlinestatic

Definition at line 72 of file BuiltinAttributeInterfaces.h.

References conState.

◆ nonContiguous()

template<typename IteratorT >
static ElementsAttrIndexer mlir::detail::ElementsAttrIndexer::nonContiguous ( bool  isSplat,
IteratorT &&  iterator 
)
inlinestatic

Construct an indexer for a non-contiguous range starting at the given iterator.

A non-contiguous range implies no contiguity, and elements may even be materialized when indexing, such as the case for a mapped_range.

Definition at line 61 of file BuiltinAttributeInterfaces.h.

References nonConState.

Member Data Documentation

◆ conState

ContiguousState mlir::detail::ElementsAttrIndexer::conState

Definition at line 192 of file BuiltinAttributeInterfaces.h.

Referenced by at(), contiguous(), and ElementsAttrIndexer().

◆ nonConState

NonContiguousState mlir::detail::ElementsAttrIndexer::nonConState

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