MLIR
17.0.0git
|
An attribute that represents a reference to a dense integer vector or tensor object. More...
#include "mlir/IR/BuiltinAttributes.h"
Public Types | |
using | iterator = DenseElementsAttr::IntElementIterator |
DenseIntElementsAttr iterates on APInt, so we can use the raw element iterator directly. More... | |
Public Member Functions | |
DenseElementsAttr | mapValues (Type newElementType, function_ref< APInt(const APInt &)> mapping) const |
Generates a new DenseElementsAttr by mapping each value attribute, and constructing the DenseElementsAttr given the new element type. More... | |
iterator | begin () const |
Iterator access to the integer element values. More... | |
iterator | end () const |
Static Public Member Functions | |
template<typename Arg > | |
static DenseIntElementsAttr | get (const ShapedType &type, Arg &&arg) |
Get an instance of a DenseIntElementsAttr with the given arguments. More... | |
template<typename T > | |
static DenseIntElementsAttr | get (const ShapedType &type, const std::initializer_list< T > &list) |
static bool | classof (Attribute attr) |
Method for supporting type inquiry through isa, cast and dyn_cast. More... | |
An attribute that represents a reference to a dense integer vector or tensor object.
Definition at line 944 of file BuiltinAttributes.h.
DenseIntElementsAttr iterates on APInt, so we can use the raw element iterator directly.
Definition at line 948 of file BuiltinAttributes.h.
|
inline |
Iterator access to the integer element values.
Definition at line 972 of file BuiltinAttributes.h.
|
static |
Method for supporting type inquiry through isa, cast and dyn_cast.
Definition at line 1491 of file BuiltinAttributes.cpp.
References mlir::Attribute::dyn_cast().
|
inline |
Definition at line 973 of file BuiltinAttributes.h.
|
inlinestatic |
Get an instance of a DenseIntElementsAttr with the given arguments.
This simply wraps the DenseElementsAttr::get calls.
Definition at line 955 of file BuiltinAttributes.h.
References mlir::DenseElementsAttr::get().
Referenced by mlir::Builder::getBoolVectorAttr(), mlir::Builder::getI32TensorAttr(), mlir::Builder::getI32VectorAttr(), mlir::Builder::getI64TensorAttr(), mlir::Builder::getI64VectorAttr(), mlir::Builder::getIndexTensorAttr(), mlir::Builder::getIndexVectorAttr(), ConsolidateTransposeOptimization::matchAndRewrite(), parseDataLayoutAlignment(), parseSwitchOpCases(), and vectorizeTensorExtract().
|
inlinestatic |
Definition at line 960 of file BuiltinAttributes.h.
References mlir::DenseElementsAttr::get().
DenseElementsAttr DenseIntElementsAttr::mapValues | ( | Type | newElementType, |
function_ref< APInt(const APInt &)> | mapping | ||
) | const |
Generates a new DenseElementsAttr by mapping each value attribute, and constructing the DenseElementsAttr given the new element type.
Definition at line 1482 of file BuiltinAttributes.cpp.
References mlir::DenseElementsAttr::getType(), and mappingHelper().