MLIR
20.0.0git
|
Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below. More...
#include "mlir/IR/BuiltinAttributes.h"
Public Member Functions | |
operator ArrayRef< T > () const | |
Implicit conversion to ArrayRef<T>. More... | |
ArrayRef< T > | asArrayRef () const |
T | operator[] (std::size_t index) const |
Random access to elements. More... | |
void | print (AsmPrinter &printer) const |
Print the short form [42, 100, -1] without any type prefix. More... | |
void | print (raw_ostream &os) const |
void | printWithoutBraces (raw_ostream &os) const |
Print the short form 42, 100, -1 without any braces or type prefix. More... | |
Static Public Member Functions | |
static DenseArrayAttrImpl | get (MLIRContext *context, ArrayRef< T > content) |
Builder from ArrayRef<T>. More... | |
static Attribute | parse (AsmParser &parser, Type type) |
Parse the short form [42, 100, -1] without any type prefix. More... | |
static Attribute | parseWithoutBraces (AsmParser &parser, Type type) |
Parse the short form 42, 100, -1 without any type prefix or braces. More... | |
static bool | classof (Attribute attr) |
Support for isa<>/cast<>. More... | |
Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below.
Definition at line 725 of file BuiltinAttributes.h.
|
inline |
Definition at line 731 of file BuiltinAttributes.h.
Referenced by mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::begin(), mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::end(), mlir::gpu::index_lowering::OpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), mlir::detail::DenseArrayAttrImpl< T >::operator[](), parseInsertExtractValueElementType(), printSwitchCases(), mlir::transform::printTransformMatchDims(), mlir::LLVM::ModuleTranslation::setBranchWeightsMetadata(), and verifyDeviceTypeAndSegmentCountMatch().
|
static |
Support for isa<>/cast<>.
Definition at line 870 of file BuiltinAttributes.cpp.
|
static |
Builder from ArrayRef<T>.
Builds a DenseArrayAttr<T> from an ArrayRef<T>.
Definition at line 860 of file BuiltinAttributes.cpp.
References mlir::get(), and getElementType().
Referenced by mlir::convertToAttribute(), fromArrayOfVector(), mlir::mesh::MeshSharding::get(), mlir::Builder::getDenseBoolArrayAttr(), mlir::Builder::getDenseF32ArrayAttr(), mlir::Builder::getDenseF64ArrayAttr(), mlir::Builder::getDenseI16ArrayAttr(), mlir::Builder::getDenseI64ArrayAttr(), mlir::Builder::getDenseI8ArrayAttr(), makeDenseBoolArrayAttr(), mlirDenseBoolArrayGet(), mlirDenseF32ArrayGet(), mlirDenseF64ArrayGet(), mlirDenseI16ArrayGet(), mlirDenseI64ArrayGet(), mlirDenseI8ArrayGet(), mlir::parseDimensionList(), mlir::mesh::targetShardingInMoveLastAxis(), mlir::mesh::targetShardingInSplitLastAxis(), and mlir::mesh::targetShardingInUnsplitLastAxis().
DenseArrayAttrImpl::operator ArrayRef< T > |
Implicit conversion to ArrayRef<T>.
Conversion from DenseArrayAttr<T> to ArrayRef<T>.
Definition at line 851 of file BuiltinAttributes.cpp.
References mlir::DenseElementsAttr::getRawData().
|
inline |
Random access to elements.
Definition at line 734 of file BuiltinAttributes.h.
References mlir::detail::DenseArrayAttrImpl< T >::asArrayRef().
Parse the short form [42, 100, -1]
without any type prefix.
Parse a DenseArrayAttr: [ 1, 2, 3 ]
Definition at line 837 of file BuiltinAttributes.cpp.
References mlir::DenseElementsAttr::get(), mlir::AsmParser::getContext(), mlir::AsmParser::parseLSquare(), mlir::AsmParser::parseOptionalRSquare(), and mlir::AsmParser::parseRSquare().
Referenced by parseDenseI64ArrayAttr().
|
static |
Parse the short form 42, 100, -1
without any type prefix or braces.
Parse a DenseArrayAttr without the braces: 1, 2, 3
Definition at line 821 of file BuiltinAttributes.cpp.
References mlir::DenseElementsAttr::get(), mlir::AsmParser::getContext(), and mlir::AsmParser::parseCommaSeparatedList().
void DenseArrayAttrImpl::print | ( | AsmPrinter & | printer | ) | const |
Print the short form [42, 100, -1]
without any type prefix.
Definition at line 801 of file BuiltinAttributes.cpp.
References mlir::AsmPrinter::getStream(), and mlir::Attribute::print().
void DenseArrayAttrImpl::print | ( | raw_ostream & | os | ) | const |
Definition at line 813 of file BuiltinAttributes.cpp.
void DenseArrayAttrImpl::printWithoutBraces | ( | raw_ostream & | os | ) | const |
Print the short form 42, 100, -1
without any braces or type prefix.
Definition at line 806 of file BuiltinAttributes.cpp.