My Project
|
#include <Attributes.h>
Public Types | |
template<typename T > | |
using | iterator = detail::ElementsAttrIterator< T > |
template<typename T > | |
using | iterator_range = detail::ElementsAttrRange< T > |
![]() | |
enum | Kind { DEFINE_SYM_KIND_RANGE, DEFINE_SYM_KIND_RANGE } |
Integer identifier for all the concrete attribute kinds. More... | |
template<typename ConcreteType , typename BaseType = Attribute, typename StorageType = AttributeStorage> | |
using | AttrBase = detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::AttributeUniquer > |
Utility class for implementing attributes. More... | |
using | ImplType = AttributeStorage |
using | ValueType = void |
Public Member Functions | |
ShapedType | getType () const |
Attribute | getValue (ArrayRef< uint64_t > index) const |
template<typename T > | |
T | getValue (ArrayRef< uint64_t > index) const |
template<typename T > | |
iterator_range< T > | getValues () const |
bool | isValidIndex (ArrayRef< uint64_t > index) const |
Return if the given 'index' refers to a valid element in this attribute. More... | |
int64_t | getNumElements () const |
Returns the number of elements held by this attribute. More... | |
ElementsAttr | mapValues (Type newElementType, function_ref< APInt(const APInt &)> mapping) const |
ElementsAttr | mapValues (Type newElementType, function_ref< APInt(const APFloat &)> mapping) const |
template<typename T > | |
auto | getValues () const -> iterator_range< T > |
Return the elements of this attribute as a value of type 'T'. More... | |
![]() | |
Attribute () | |
Attribute (const ImplType *impl) | |
Attribute (const Attribute &other)=default | |
Attribute & | operator= (const Attribute &other)=default |
bool | operator== (Attribute other) const |
bool | operator!= (Attribute other) const |
operator bool () const | |
bool | operator! () const |
template<typename U > | |
bool | isa () const |
template<typename U > | |
U | dyn_cast () const |
template<typename U > | |
U | dyn_cast_or_null () const |
template<typename U > | |
U | cast () const |
unsigned | getKind () const |
Return the classification for this attribute. More... | |
Type | getType () const |
Return the type of this attribute. More... | |
MLIRContext * | getContext () const |
Return the context this attribute belongs to. More... | |
Dialect & | getDialect () const |
Get the dialect this attribute is registered to. More... | |
void | print (raw_ostream &os) const |
Print the attribute. More... | |
void | dump () const |
const void * | getAsOpaquePointer () const |
Get an opaque pointer to the attribute. More... | |
Static Public Member Functions | |
static bool | classof (Attribute attr) |
Method for support type inquiry through isa, cast and dyn_cast. More... | |
![]() | |
static bool | classof (Attribute) |
static Attribute | getFromOpaquePointer (const void *ptr) |
Construct an attribute from the opaque pointer representation. More... | |
Protected Member Functions | |
uint64_t | getFlattenedIndex (ArrayRef< uint64_t > index) const |
Additional Inherited Members | |
![]() | |
ImplType * | impl |
A base attribute that represents a reference to a static shaped tensor or vector constant.
using mlir::ElementsAttr::iterator = detail::ElementsAttrIterator<T> |
using mlir::ElementsAttr::iterator_range = detail::ElementsAttrRange<T> |
|
inlinestatic |
Method for support type inquiry through isa, cast and dyn_cast.
|
protected |
Returns the 1 dimensional flattened row-major index from the given multi-dimensional index.
int64_t ElementsAttr::getNumElements | ( | ) | const |
Returns the number of elements held by this attribute.
ShapedType ElementsAttr::getType | ( | ) | const |
Return the type of this ElementsAttr, guaranteed to be a vector or tensor with static shape.
Return the value at the given index. The index is expected to refer to a valid element.
Return the value at the given index. If index does not refer to a valid element, then a null attribute is returned.
|
inline |
Return the value of type 'T' at the given index, where 'T' corresponds to an Attribute type.
iterator_range<T> mlir::ElementsAttr::getValues | ( | ) | const |
Return the elements of this attribute as a value of type 'T'. Note: Aborts if the subclass is OpaqueElementsAttrs, these attrs do not support iteration.
auto mlir::ElementsAttr::getValues | ( | ) | const -> iterator_range<T> |
Return the elements of this attribute as a value of type 'T'.
bool ElementsAttr::isValidIndex | ( | ArrayRef< uint64_t > | index | ) | const |
Return if the given 'index' refers to a valid element in this attribute.
ElementsAttr ElementsAttr::mapValues | ( | Type | newElementType, |
function_ref< APInt(const APInt &)> | mapping | ||
) | const |
Generates a new ElementsAttr by mapping each int value to a new underlying APInt. The new values can represent either a integer or float. This ElementsAttr should contain integers.
ElementsAttr ElementsAttr::mapValues | ( | Type | newElementType, |
function_ref< APInt(const APFloat &)> | mapping | ||
) | const |
Generates a new ElementsAttr by mapping each float value to a new underlying APInt. The new values can represent either a integer or float. This ElementsAttr should contain floats.