MLIR 22.0.0git
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.

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.
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 33 of file BuiltinAttributeInterfaces.h.

Constructor & Destructor Documentation

◆ ElementsAttrIndexer() [1/3]

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

◆ ElementsAttrIndexer() [2/3]

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

Definition at line 37 of file BuiltinAttributeInterfaces.h.

References conState, ElementsAttrIndexer(), nonConState, and rhs.

◆ ElementsAttrIndexer() [3/3]

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

Definition at line 44 of file BuiltinAttributeInterfaces.h.

References conState, ElementsAttrIndexer(), nonConState, and rhs.

◆ ~ElementsAttrIndexer()

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

Definition at line 51 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 79 of file BuiltinAttributeInterfaces.h.

References conState, and nonConState.

◆ contiguous()

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

Definition at line 71 of file BuiltinAttributeInterfaces.h.

References conState, and ElementsAttrIndexer().

◆ nonContiguous()

template<typename IteratorT>
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 60 of file BuiltinAttributeInterfaces.h.

References ElementsAttrIndexer(), and nonConState.

Member Data Documentation

◆ conState

ContiguousState mlir::detail::ElementsAttrIndexer::conState

◆ nonConState

NonContiguousState mlir::detail::ElementsAttrIndexer::nonConState

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