MLIR  17.0.0git
Functions
BuiltinAttributes.cpp File Reference
#include "mlir-c/BuiltinAttributes.h"
#include "mlir-c/Support.h"
#include "mlir/CAPI/AffineMap.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Support.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinTypes.h"

Go to the source code of this file.

Functions

MlirAttribute mlirAttributeGetNull ()
 Returns an empty attribute. More...
 
bool mlirAttributeIsALocation (MlirAttribute attr)
 
bool mlirAttributeIsAAffineMap (MlirAttribute attr)
 Checks whether the given attribute is an affine map attribute. More...
 
MlirAttribute mlirAffineMapAttrGet (MlirAffineMap map)
 Creates an affine map attribute wrapping the given map. More...
 
MlirAffineMap mlirAffineMapAttrGetValue (MlirAttribute attr)
 Returns the affine map wrapped in the given affine map attribute. More...
 
bool mlirAttributeIsAArray (MlirAttribute attr)
 Checks whether the given attribute is an array attribute. More...
 
MlirAttribute mlirArrayAttrGet (MlirContext ctx, intptr_t numElements, MlirAttribute const *elements)
 Creates an array element containing the given list of elements in the given context. More...
 
intptr_t mlirArrayAttrGetNumElements (MlirAttribute attr)
 Returns the number of elements stored in the given array attribute. More...
 
MlirAttribute mlirArrayAttrGetElement (MlirAttribute attr, intptr_t pos)
 Returns pos-th element stored in the given array attribute. More...
 
bool mlirAttributeIsADictionary (MlirAttribute attr)
 Checks whether the given attribute is a dictionary attribute. More...
 
MlirAttribute mlirDictionaryAttrGet (MlirContext ctx, intptr_t numElements, MlirNamedAttribute const *elements)
 Creates a dictionary attribute containing the given list of elements in the provided context. More...
 
intptr_t mlirDictionaryAttrGetNumElements (MlirAttribute attr)
 Returns the number of attributes contained in a dictionary attribute. More...
 
MlirNamedAttribute mlirDictionaryAttrGetElement (MlirAttribute attr, intptr_t pos)
 Returns pos-th element of the given dictionary attribute. More...
 
MlirAttribute mlirDictionaryAttrGetElementByName (MlirAttribute attr, MlirStringRef name)
 Returns the dictionary attribute element with the given name or NULL if the given name does not exist in the dictionary. More...
 
bool mlirAttributeIsAFloat (MlirAttribute attr)
 Checks whether the given attribute is a floating point attribute. More...
 
MlirAttribute mlirFloatAttrDoubleGet (MlirContext ctx, MlirType type, double value)
 Creates a floating point attribute in the given context with the given double value and double-precision FP semantics. More...
 
MlirAttribute mlirFloatAttrDoubleGetChecked (MlirLocation loc, MlirType type, double value)
 Same as "mlirFloatAttrDoubleGet", but if the type is not valid for a construction of a FloatAttr, returns a null MlirAttribute. More...
 
double mlirFloatAttrGetValueDouble (MlirAttribute attr)
 Returns the value stored in the given floating point attribute, interpreting the value as double. More...
 
bool mlirAttributeIsAInteger (MlirAttribute attr)
 Checks whether the given attribute is an integer attribute. More...
 
MlirAttribute mlirIntegerAttrGet (MlirType type, int64_t value)
 Creates an integer attribute of the given type with the given integer value. More...
 
int64_t mlirIntegerAttrGetValueInt (MlirAttribute attr)
 Returns the value stored in the given integer attribute, assuming the value is of signless type and fits into a signed 64-bit integer. More...
 
int64_t mlirIntegerAttrGetValueSInt (MlirAttribute attr)
 Returns the value stored in the given integer attribute, assuming the value is of signed type and fits into a signed 64-bit integer. More...
 
uint64_t mlirIntegerAttrGetValueUInt (MlirAttribute attr)
 Returns the value stored in the given integer attribute, assuming the value is of unsigned type and fits into an unsigned 64-bit integer. More...
 
bool mlirAttributeIsABool (MlirAttribute attr)
 Checks whether the given attribute is a bool attribute. More...
 
MlirAttribute mlirBoolAttrGet (MlirContext ctx, int value)
 Creates a bool attribute in the given context with the given value. More...
 
bool mlirBoolAttrGetValue (MlirAttribute attr)
 Returns the value stored in the given bool attribute. More...
 
bool mlirAttributeIsAIntegerSet (MlirAttribute attr)
 Checks whether the given attribute is an integer set attribute. More...
 
bool mlirAttributeIsAOpaque (MlirAttribute attr)
 Checks whether the given attribute is an opaque attribute. More...
 
MlirAttribute mlirOpaqueAttrGet (MlirContext ctx, MlirStringRef dialectNamespace, intptr_t dataLength, const char *data, MlirType type)
 Creates an opaque attribute in the given context associated with the dialect identified by its namespace. More...
 
MlirStringRef mlirOpaqueAttrGetDialectNamespace (MlirAttribute attr)
 Returns the namespace of the dialect with which the given opaque attribute is associated. More...
 
MlirStringRef mlirOpaqueAttrGetData (MlirAttribute attr)
 Returns the raw data as a string reference. More...
 
bool mlirAttributeIsAString (MlirAttribute attr)
 Checks whether the given attribute is a string attribute. More...
 
MlirAttribute mlirStringAttrGet (MlirContext ctx, MlirStringRef str)
 Creates a string attribute in the given context containing the given string. More...
 
MlirAttribute mlirStringAttrTypedGet (MlirType type, MlirStringRef str)
 Creates a string attribute in the given context containing the given string. More...
 
MlirStringRef mlirStringAttrGetValue (MlirAttribute attr)
 Returns the attribute values as a string reference. More...
 
bool mlirAttributeIsASymbolRef (MlirAttribute attr)
 Checks whether the given attribute is a symbol reference attribute. More...
 
MlirAttribute mlirSymbolRefAttrGet (MlirContext ctx, MlirStringRef symbol, intptr_t numReferences, MlirAttribute const *references)
 Creates a symbol reference attribute in the given context referencing a symbol identified by the given string inside a list of nested references. More...
 
MlirStringRef mlirSymbolRefAttrGetRootReference (MlirAttribute attr)
 Returns the string reference to the root referenced symbol. More...
 
MlirStringRef mlirSymbolRefAttrGetLeafReference (MlirAttribute attr)
 Returns the string reference to the leaf referenced symbol. More...
 
intptr_t mlirSymbolRefAttrGetNumNestedReferences (MlirAttribute attr)
 Returns the number of references nested in the given symbol reference attribute. More...
 
MlirAttribute mlirSymbolRefAttrGetNestedReference (MlirAttribute attr, intptr_t pos)
 Returns pos-th reference nested in the given symbol reference attribute. More...
 
bool mlirAttributeIsAFlatSymbolRef (MlirAttribute attr)
 Checks whether the given attribute is a flat symbol reference attribute. More...
 
MlirAttribute mlirFlatSymbolRefAttrGet (MlirContext ctx, MlirStringRef symbol)
 Creates a flat symbol reference attribute in the given context referencing a symbol identified by the given string. More...
 
MlirStringRef mlirFlatSymbolRefAttrGetValue (MlirAttribute attr)
 Returns the referenced symbol as a string reference. More...
 
bool mlirAttributeIsAType (MlirAttribute attr)
 Checks whether the given attribute is a type attribute. More...
 
MlirAttribute mlirTypeAttrGet (MlirType type)
 Creates a type attribute wrapping the given type in the same context as the type. More...
 
MlirType mlirTypeAttrGetValue (MlirAttribute attr)
 Returns the type stored in the given type attribute. More...
 
bool mlirAttributeIsAUnit (MlirAttribute attr)
 Checks whether the given attribute is a unit attribute. More...
 
MlirAttribute mlirUnitAttrGet (MlirContext ctx)
 Creates a unit attribute in the given context. More...
 
bool mlirAttributeIsAElements (MlirAttribute attr)
 Checks whether the given attribute is an elements attribute. More...
 
MlirAttribute mlirElementsAttrGetValue (MlirAttribute attr, intptr_t rank, uint64_t *idxs)
 Returns the element at the given rank-dimensional index. More...
 
bool mlirElementsAttrIsValidIndex (MlirAttribute attr, intptr_t rank, uint64_t *idxs)
 Checks whether the given rank-dimensional index is valid in the given elements attribute. More...
 
int64_t mlirElementsAttrGetNumElements (MlirAttribute attr)
 Gets the total number of elements in the given elements attribute. More...
 
bool mlirAttributeIsADenseBoolArray (MlirAttribute attr)
 Checks whether the given attribute is a dense array attribute. More...
 
bool mlirAttributeIsADenseI8Array (MlirAttribute attr)
 
bool mlirAttributeIsADenseI16Array (MlirAttribute attr)
 
bool mlirAttributeIsADenseI32Array (MlirAttribute attr)
 
bool mlirAttributeIsADenseI64Array (MlirAttribute attr)
 
bool mlirAttributeIsADenseF32Array (MlirAttribute attr)
 
bool mlirAttributeIsADenseF64Array (MlirAttribute attr)
 
MlirAttribute mlirDenseBoolArrayGet (MlirContext ctx, intptr_t size, int const *values)
 Create a dense array attribute with the given elements. More...
 
MlirAttribute mlirDenseI8ArrayGet (MlirContext ctx, intptr_t size, int8_t const *values)
 
MlirAttribute mlirDenseI16ArrayGet (MlirContext ctx, intptr_t size, int16_t const *values)
 
MlirAttribute mlirDenseI32ArrayGet (MlirContext ctx, intptr_t size, int32_t const *values)
 
MlirAttribute mlirDenseI64ArrayGet (MlirContext ctx, intptr_t size, int64_t const *values)
 
MlirAttribute mlirDenseF32ArrayGet (MlirContext ctx, intptr_t size, float const *values)
 
MlirAttribute mlirDenseF64ArrayGet (MlirContext ctx, intptr_t size, double const *values)
 
intptr_t mlirDenseArrayGetNumElements (MlirAttribute attr)
 Get the size of a dense array. More...
 
bool mlirDenseBoolArrayGetElement (MlirAttribute attr, intptr_t pos)
 Get an element of a dense array. More...
 
int8_t mlirDenseI8ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
int16_t mlirDenseI16ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
int32_t mlirDenseI32ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
int64_t mlirDenseI64ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
float mlirDenseF32ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
double mlirDenseF64ArrayGetElement (MlirAttribute attr, intptr_t pos)
 
bool mlirAttributeIsADenseElements (MlirAttribute attr)
 Checks whether the given attribute is a dense elements attribute. More...
 
bool mlirAttributeIsADenseIntElements (MlirAttribute attr)
 
bool mlirAttributeIsADenseFPElements (MlirAttribute attr)
 
MlirAttribute mlirDenseElementsAttrGet (MlirType shapedType, intptr_t numElements, MlirAttribute const *elements)
 Creates a dense elements attribute with the given Shaped type and elements in the same context as the type. More...
 
MlirAttribute mlirDenseElementsAttrRawBufferGet (MlirType shapedType, size_t rawBufferSize, const void *rawBuffer)
 Creates a dense elements attribute with the given Shaped type and elements populated from a packed, row-major opaque buffer of contents. More...
 
MlirAttribute mlirDenseElementsAttrSplatGet (MlirType shapedType, MlirAttribute element)
 Creates a dense elements attribute with the given Shaped type containing a single replicated element (splat). More...
 
MlirAttribute mlirDenseElementsAttrBoolSplatGet (MlirType shapedType, bool element)
 
MlirAttribute mlirDenseElementsAttrUInt8SplatGet (MlirType shapedType, uint8_t element)
 
MlirAttribute mlirDenseElementsAttrInt8SplatGet (MlirType shapedType, int8_t element)
 
MlirAttribute mlirDenseElementsAttrUInt32SplatGet (MlirType shapedType, uint32_t element)
 
MlirAttribute mlirDenseElementsAttrInt32SplatGet (MlirType shapedType, int32_t element)
 
MlirAttribute mlirDenseElementsAttrUInt64SplatGet (MlirType shapedType, uint64_t element)
 
MlirAttribute mlirDenseElementsAttrInt64SplatGet (MlirType shapedType, int64_t element)
 
MlirAttribute mlirDenseElementsAttrFloatSplatGet (MlirType shapedType, float element)
 
MlirAttribute mlirDenseElementsAttrDoubleSplatGet (MlirType shapedType, double element)
 
MlirAttribute mlirDenseElementsAttrBoolGet (MlirType shapedType, intptr_t numElements, const int *elements)
 Creates a dense elements attribute with the given shaped type from elements of a specific type. More...
 
template<typename T >
static MlirAttribute getDenseAttribute (MlirType shapedType, intptr_t numElements, const T *elements)
 Creates a dense attribute with elements of the type deduced by templates. More...
 
MlirAttribute mlirDenseElementsAttrUInt8Get (MlirType shapedType, intptr_t numElements, const uint8_t *elements)
 
MlirAttribute mlirDenseElementsAttrInt8Get (MlirType shapedType, intptr_t numElements, const int8_t *elements)
 
MlirAttribute mlirDenseElementsAttrUInt16Get (MlirType shapedType, intptr_t numElements, const uint16_t *elements)
 
MlirAttribute mlirDenseElementsAttrInt16Get (MlirType shapedType, intptr_t numElements, const int16_t *elements)
 
MlirAttribute mlirDenseElementsAttrUInt32Get (MlirType shapedType, intptr_t numElements, const uint32_t *elements)
 
MlirAttribute mlirDenseElementsAttrInt32Get (MlirType shapedType, intptr_t numElements, const int32_t *elements)
 
MlirAttribute mlirDenseElementsAttrUInt64Get (MlirType shapedType, intptr_t numElements, const uint64_t *elements)
 
MlirAttribute mlirDenseElementsAttrInt64Get (MlirType shapedType, intptr_t numElements, const int64_t *elements)
 
MlirAttribute mlirDenseElementsAttrFloatGet (MlirType shapedType, intptr_t numElements, const float *elements)
 
MlirAttribute mlirDenseElementsAttrDoubleGet (MlirType shapedType, intptr_t numElements, const double *elements)
 
MlirAttribute mlirDenseElementsAttrBFloat16Get (MlirType shapedType, intptr_t numElements, const uint16_t *elements)
 
MlirAttribute mlirDenseElementsAttrFloat16Get (MlirType shapedType, intptr_t numElements, const uint16_t *elements)
 
MlirAttribute mlirDenseElementsAttrStringGet (MlirType shapedType, intptr_t numElements, MlirStringRef *strs)
 Creates a dense elements attribute with the given shaped type from string elements. More...
 
MlirAttribute mlirDenseElementsAttrReshapeGet (MlirAttribute attr, MlirType shapedType)
 Creates a dense elements attribute that has the same data as the given dense elements attribute and a different shaped type. More...
 
bool mlirDenseElementsAttrIsSplat (MlirAttribute attr)
 Checks whether the given dense elements attribute contains a single replicated value (splat). More...
 
MlirAttribute mlirDenseElementsAttrGetSplatValue (MlirAttribute attr)
 Returns the single replicated value (splat) of a specific type contained by the given dense elements attribute. More...
 
int mlirDenseElementsAttrGetBoolSplatValue (MlirAttribute attr)
 
int8_t mlirDenseElementsAttrGetInt8SplatValue (MlirAttribute attr)
 
uint8_t mlirDenseElementsAttrGetUInt8SplatValue (MlirAttribute attr)
 
int32_t mlirDenseElementsAttrGetInt32SplatValue (MlirAttribute attr)
 
uint32_t mlirDenseElementsAttrGetUInt32SplatValue (MlirAttribute attr)
 
int64_t mlirDenseElementsAttrGetInt64SplatValue (MlirAttribute attr)
 
uint64_t mlirDenseElementsAttrGetUInt64SplatValue (MlirAttribute attr)
 
float mlirDenseElementsAttrGetFloatSplatValue (MlirAttribute attr)
 
double mlirDenseElementsAttrGetDoubleSplatValue (MlirAttribute attr)
 
MlirStringRef mlirDenseElementsAttrGetStringSplatValue (MlirAttribute attr)
 
bool mlirDenseElementsAttrGetBoolValue (MlirAttribute attr, intptr_t pos)
 Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense elements attribute. More...
 
int8_t mlirDenseElementsAttrGetInt8Value (MlirAttribute attr, intptr_t pos)
 
uint8_t mlirDenseElementsAttrGetUInt8Value (MlirAttribute attr, intptr_t pos)
 
int16_t mlirDenseElementsAttrGetInt16Value (MlirAttribute attr, intptr_t pos)
 
uint16_t mlirDenseElementsAttrGetUInt16Value (MlirAttribute attr, intptr_t pos)
 
int32_t mlirDenseElementsAttrGetInt32Value (MlirAttribute attr, intptr_t pos)
 
uint32_t mlirDenseElementsAttrGetUInt32Value (MlirAttribute attr, intptr_t pos)
 
int64_t mlirDenseElementsAttrGetInt64Value (MlirAttribute attr, intptr_t pos)
 
uint64_t mlirDenseElementsAttrGetUInt64Value (MlirAttribute attr, intptr_t pos)
 
float mlirDenseElementsAttrGetFloatValue (MlirAttribute attr, intptr_t pos)
 
double mlirDenseElementsAttrGetDoubleValue (MlirAttribute attr, intptr_t pos)
 
MlirStringRef mlirDenseElementsAttrGetStringValue (MlirAttribute attr, intptr_t pos)
 
const void * mlirDenseElementsAttrGetRawData (MlirAttribute attr)
 Returns the raw data of the given dense elements attribute. More...
 
template<typename U , typename T >
static MlirAttribute getDenseResource (MlirType shapedType, MlirStringRef name, intptr_t numElements, const T *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseBoolResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const int *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt8ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const uint8_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt16ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const uint16_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt32ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const uint32_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt64ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const uint64_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt8ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const int8_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt16ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const int16_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt32ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const int32_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt64ResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const int64_t *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseFloatResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const float *elements)
 
MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseDoubleResourceElementsAttrGet (MlirType shapedType, MlirStringRef name, intptr_t numElements, const double *elements)
 
template<typename U , typename T >
static T getDenseResourceVal (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED bool mlirDenseBoolResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense resource elements attribute. More...
 
MLIR_CAPI_EXPORTED uint8_t mlirDenseUInt8ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED uint16_t mlirDenseUInt16ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED uint32_t mlirDenseUInt32ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED uint64_t mlirDenseUInt64ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED int8_t mlirDenseInt8ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED int16_t mlirDenseInt16ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED int32_t mlirDenseInt32ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED int64_t mlirDenseInt64ResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED float mlirDenseFloatResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
MLIR_CAPI_EXPORTED double mlirDenseDoubleResourceElementsAttrGetValue (MlirAttribute attr, intptr_t pos)
 
bool mlirAttributeIsASparseElements (MlirAttribute attr)
 Checks whether the given attribute is a sparse elements attribute. More...
 
MlirAttribute mlirSparseElementsAttribute (MlirType shapedType, MlirAttribute denseIndices, MlirAttribute denseValues)
 Creates a sparse elements attribute of the given shape from a list of indices and a list of associated values. More...
 
MlirAttribute mlirSparseElementsAttrGetIndices (MlirAttribute attr)
 Returns the dense elements attribute containing 64-bit integer indices of non-null elements in the given sparse elements attribute. More...
 
MlirAttribute mlirSparseElementsAttrGetValues (MlirAttribute attr)
 Returns the dense elements attribute containing the non-null elements in the given sparse elements attribute. More...
 
bool mlirAttributeIsAStridedLayout (MlirAttribute attr)
 
MlirAttribute mlirStridedLayoutAttrGet (MlirContext ctx, int64_t offset, intptr_t numStrides, const int64_t *strides)
 
int64_t mlirStridedLayoutAttrGetOffset (MlirAttribute attr)
 
intptr_t mlirStridedLayoutAttrGetNumStrides (MlirAttribute attr)
 
int64_t mlirStridedLayoutAttrGetStride (MlirAttribute attr, intptr_t pos)
 

Function Documentation

◆ getDenseAttribute()

template<typename T >
static MlirAttribute getDenseAttribute ( MlirType  shapedType,
intptr_t  numElements,
const T *  elements 
)
static

◆ getDenseResource()

template<typename U , typename T >
static MlirAttribute getDenseResource ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const T *  elements 
)
static

◆ getDenseResourceVal()

template<typename U , typename T >
static T getDenseResourceVal ( MlirAttribute  attr,
intptr_t  pos 
)
static

Definition at line 802 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAffineMapAttrGet()

MlirAttribute mlirAffineMapAttrGet ( MlirAffineMap  map)

Creates an affine map attribute wrapping the given map.

The attribute belongs to the same context as the affine map.

Definition at line 39 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirAffineMapAttrGetValue()

MlirAffineMap mlirAffineMapAttrGetValue ( MlirAttribute  attr)

Returns the affine map wrapped in the given affine map attribute.

Definition at line 43 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirArrayAttrGet()

MlirAttribute mlirArrayAttrGet ( MlirContext  ctx,
intptr_t  numElements,
MlirAttribute const *  elements 
)

Creates an array element containing the given list of elements in the given context.

Definition at line 55 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), unwrapList(), and wrap().

◆ mlirArrayAttrGetElement()

MlirAttribute mlirArrayAttrGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Returns pos-th element stored in the given array attribute.

Definition at line 67 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirArrayAttrGetNumElements()

intptr_t mlirArrayAttrGetNumElements ( MlirAttribute  attr)

Returns the number of elements stored in the given array attribute.

Definition at line 63 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeGetNull()

MlirAttribute mlirAttributeGetNull ( void  )

◆ mlirAttributeIsAAffineMap()

bool mlirAttributeIsAAffineMap ( MlirAttribute  attr)

Checks whether the given attribute is an affine map attribute.

Definition at line 35 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAArray()

bool mlirAttributeIsAArray ( MlirAttribute  attr)

Checks whether the given attribute is an array attribute.

Definition at line 51 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsABool()

bool mlirAttributeIsABool ( MlirAttribute  attr)

Checks whether the given attribute is a bool attribute.

Definition at line 155 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseBoolArray()

bool mlirAttributeIsADenseBoolArray ( MlirAttribute  attr)

Checks whether the given attribute is a dense array attribute.

Definition at line 335 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseElements()

bool mlirAttributeIsADenseElements ( MlirAttribute  attr)

Checks whether the given attribute is a dense elements attribute.

Definition at line 435 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseF32Array()

bool mlirAttributeIsADenseF32Array ( MlirAttribute  attr)

Definition at line 350 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseF64Array()

bool mlirAttributeIsADenseF64Array ( MlirAttribute  attr)

Definition at line 353 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseFPElements()

bool mlirAttributeIsADenseFPElements ( MlirAttribute  attr)

Definition at line 441 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseI16Array()

bool mlirAttributeIsADenseI16Array ( MlirAttribute  attr)

Definition at line 341 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseI32Array()

bool mlirAttributeIsADenseI32Array ( MlirAttribute  attr)

Definition at line 344 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseI64Array()

bool mlirAttributeIsADenseI64Array ( MlirAttribute  attr)

Definition at line 347 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseI8Array()

bool mlirAttributeIsADenseI8Array ( MlirAttribute  attr)

Definition at line 338 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADenseIntElements()

bool mlirAttributeIsADenseIntElements ( MlirAttribute  attr)

Definition at line 438 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsADictionary()

bool mlirAttributeIsADictionary ( MlirAttribute  attr)

Checks whether the given attribute is a dictionary attribute.

Definition at line 75 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAElements()

bool mlirAttributeIsAElements ( MlirAttribute  attr)

Checks whether the given attribute is an elements attribute.

Definition at line 308 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAFlatSymbolRef()

bool mlirAttributeIsAFlatSymbolRef ( MlirAttribute  attr)

Checks whether the given attribute is a flat symbol reference attribute.

Definition at line 264 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAFloat()

bool mlirAttributeIsAFloat ( MlirAttribute  attr)

Checks whether the given attribute is a floating point attribute.

Definition at line 109 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAInteger()

bool mlirAttributeIsAInteger ( MlirAttribute  attr)

Checks whether the given attribute is an integer attribute.

Definition at line 131 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAIntegerSet()

bool mlirAttributeIsAIntegerSet ( MlirAttribute  attr)

Checks whether the given attribute is an integer set attribute.

Definition at line 171 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsALocation()

bool mlirAttributeIsALocation ( MlirAttribute  attr)

Definition at line 27 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAOpaque()

bool mlirAttributeIsAOpaque ( MlirAttribute  attr)

Checks whether the given attribute is an opaque attribute.

Definition at line 179 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsASparseElements()

bool mlirAttributeIsASparseElements ( MlirAttribute  attr)

Checks whether the given attribute is a sparse elements attribute.

Definition at line 858 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAStridedLayout()

bool mlirAttributeIsAStridedLayout ( MlirAttribute  attr)

Definition at line 883 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAString()

bool mlirAttributeIsAString ( MlirAttribute  attr)

Checks whether the given attribute is a string attribute.

Definition at line 204 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsASymbolRef()

bool mlirAttributeIsASymbolRef ( MlirAttribute  attr)

Checks whether the given attribute is a symbol reference attribute.

Definition at line 224 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAType()

bool mlirAttributeIsAType ( MlirAttribute  attr)

Checks whether the given attribute is a type attribute.

Definition at line 280 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirAttributeIsAUnit()

bool mlirAttributeIsAUnit ( MlirAttribute  attr)

Checks whether the given attribute is a unit attribute.

Definition at line 296 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirBoolAttrGet()

MlirAttribute mlirBoolAttrGet ( MlirContext  ctx,
int  value 
)

Creates a bool attribute in the given context with the given value.

Definition at line 159 of file BuiltinAttributes.cpp.

References mlir::BoolAttr::get(), unwrap(), and wrap().

◆ mlirBoolAttrGetValue()

bool mlirBoolAttrGetValue ( MlirAttribute  attr)

Returns the value stored in the given bool attribute.

Definition at line 163 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseArrayGetNumElements()

intptr_t mlirDenseArrayGetNumElements ( MlirAttribute  attr)

Get the size of a dense array.

Definition at line 399 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseBoolArrayGet()

MlirAttribute mlirDenseBoolArrayGet ( MlirContext  ctx,
intptr_t  size,
int const *  values 
)

Create a dense array attribute with the given elements.

Definition at line 360 of file BuiltinAttributes.cpp.

References mlir::detail::DenseArrayAttrImpl< T >::get(), unwrap(), and wrap().

◆ mlirDenseBoolArrayGetElement()

bool mlirDenseBoolArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Get an element of a dense array.

Definition at line 406 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseBoolResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED bool mlirDenseBoolResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense resource elements attribute.

Definition at line 807 of file BuiltinAttributes.cpp.

◆ mlirDenseDoubleResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED double mlirDenseDoubleResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 850 of file BuiltinAttributes.cpp.

◆ mlirDenseElementsAttrBFloat16Get()

MlirAttribute mlirDenseElementsAttrBFloat16Get ( MlirType  shapedType,
intptr_t  numElements,
const uint16_t *  elements 
)

Definition at line 588 of file BuiltinAttributes.cpp.

References mlirDenseElementsAttrRawBufferGet().

◆ mlirDenseElementsAttrBoolGet()

MlirAttribute mlirDenseElementsAttrBoolGet ( MlirType  shapedType,
intptr_t  numElements,
const int *  elements 
)

Creates a dense elements attribute with the given shaped type from elements of a specific type.

Expects the element type of the shaped type to match the data element type.

Definition at line 521 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrBoolSplatGet()

MlirAttribute mlirDenseElementsAttrBoolSplatGet ( MlirType  shapedType,
bool  element 
)

Definition at line 475 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrDoubleGet()

MlirAttribute mlirDenseElementsAttrDoubleGet ( MlirType  shapedType,
intptr_t  numElements,
const double *  elements 
)

Definition at line 583 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrDoubleSplatGet()

MlirAttribute mlirDenseElementsAttrDoubleSplatGet ( MlirType  shapedType,
double  element 
)

Definition at line 515 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrFloat16Get()

MlirAttribute mlirDenseElementsAttrFloat16Get ( MlirType  shapedType,
intptr_t  numElements,
const uint16_t *  elements 
)

Definition at line 595 of file BuiltinAttributes.cpp.

References mlirDenseElementsAttrRawBufferGet().

◆ mlirDenseElementsAttrFloatGet()

MlirAttribute mlirDenseElementsAttrFloatGet ( MlirType  shapedType,
intptr_t  numElements,
const float *  elements 
)

Definition at line 578 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrFloatSplatGet()

MlirAttribute mlirDenseElementsAttrFloatSplatGet ( MlirType  shapedType,
float  element 
)

Definition at line 510 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrGet()

MlirAttribute mlirDenseElementsAttrGet ( MlirType  shapedType,
intptr_t  numElements,
MlirAttribute const *  elements 
)

Creates a dense elements attribute with the given Shaped type and elements in the same context as the type.

Definition at line 448 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), unwrapList(), and wrap().

◆ mlirDenseElementsAttrGetBoolSplatValue()

int mlirDenseElementsAttrGetBoolSplatValue ( MlirAttribute  attr)

Definition at line 632 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetBoolValue()

bool mlirDenseElementsAttrGetBoolValue ( MlirAttribute  attr,
intptr_t  pos 
)

Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense elements attribute.

Definition at line 667 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetDoubleSplatValue()

double mlirDenseElementsAttrGetDoubleSplatValue ( MlirAttribute  attr)

Definition at line 656 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetDoubleValue()

double mlirDenseElementsAttrGetDoubleValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 697 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetFloatSplatValue()

float mlirDenseElementsAttrGetFloatSplatValue ( MlirAttribute  attr)

Definition at line 653 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetFloatValue()

float mlirDenseElementsAttrGetFloatValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 694 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt16Value()

int16_t mlirDenseElementsAttrGetInt16Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 676 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt32SplatValue()

int32_t mlirDenseElementsAttrGetInt32SplatValue ( MlirAttribute  attr)

Definition at line 641 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt32Value()

int32_t mlirDenseElementsAttrGetInt32Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 682 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt64SplatValue()

int64_t mlirDenseElementsAttrGetInt64SplatValue ( MlirAttribute  attr)

Definition at line 647 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt64Value()

int64_t mlirDenseElementsAttrGetInt64Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 688 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt8SplatValue()

int8_t mlirDenseElementsAttrGetInt8SplatValue ( MlirAttribute  attr)

Definition at line 635 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetInt8Value()

int8_t mlirDenseElementsAttrGetInt8Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 670 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetRawData()

const void* mlirDenseElementsAttrGetRawData ( MlirAttribute  attr)

Returns the raw data of the given dense elements attribute.

Definition at line 709 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetSplatValue()

MlirAttribute mlirDenseElementsAttrGetSplatValue ( MlirAttribute  attr)

Returns the single replicated value (splat) of a specific type contained by the given dense elements attribute.

Definition at line 628 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirDenseElementsAttrGetStringSplatValue()

MlirStringRef mlirDenseElementsAttrGetStringSplatValue ( MlirAttribute  attr)

Definition at line 659 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirDenseElementsAttrGetStringValue()

MlirStringRef mlirDenseElementsAttrGetStringValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 700 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirDenseElementsAttrGetUInt16Value()

uint16_t mlirDenseElementsAttrGetUInt16Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 679 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt32SplatValue()

uint32_t mlirDenseElementsAttrGetUInt32SplatValue ( MlirAttribute  attr)

Definition at line 644 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt32Value()

uint32_t mlirDenseElementsAttrGetUInt32Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 685 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt64SplatValue()

uint64_t mlirDenseElementsAttrGetUInt64SplatValue ( MlirAttribute  attr)

Definition at line 650 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt64Value()

uint64_t mlirDenseElementsAttrGetUInt64Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 691 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt8SplatValue()

uint8_t mlirDenseElementsAttrGetUInt8SplatValue ( MlirAttribute  attr)

Definition at line 638 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrGetUInt8Value()

uint8_t mlirDenseElementsAttrGetUInt8Value ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 673 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrInt16Get()

MlirAttribute mlirDenseElementsAttrInt16Get ( MlirType  shapedType,
intptr_t  numElements,
const int16_t *  elements 
)

Definition at line 553 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrInt32Get()

MlirAttribute mlirDenseElementsAttrInt32Get ( MlirType  shapedType,
intptr_t  numElements,
const int32_t *  elements 
)

Definition at line 563 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrInt32SplatGet()

MlirAttribute mlirDenseElementsAttrInt32SplatGet ( MlirType  shapedType,
int32_t  element 
)

Definition at line 495 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrInt64Get()

MlirAttribute mlirDenseElementsAttrInt64Get ( MlirType  shapedType,
intptr_t  numElements,
const int64_t *  elements 
)

Definition at line 573 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrInt64SplatGet()

MlirAttribute mlirDenseElementsAttrInt64SplatGet ( MlirType  shapedType,
int64_t  element 
)

Definition at line 505 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrInt8Get()

MlirAttribute mlirDenseElementsAttrInt8Get ( MlirType  shapedType,
intptr_t  numElements,
const int8_t *  elements 
)

Definition at line 543 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrInt8SplatGet()

MlirAttribute mlirDenseElementsAttrInt8SplatGet ( MlirType  shapedType,
int8_t  element 
)

Definition at line 485 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrIsSplat()

bool mlirDenseElementsAttrIsSplat ( MlirAttribute  attr)

Checks whether the given dense elements attribute contains a single replicated value (splat).

Definition at line 624 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseElementsAttrRawBufferGet()

MlirAttribute mlirDenseElementsAttrRawBufferGet ( MlirType  shapedType,
size_t  rawBufferSize,
const void *  rawBuffer 
)

Creates a dense elements attribute with the given Shaped type and elements populated from a packed, row-major opaque buffer of contents.

The format of the raw buffer is a densely packed array of values that can be bitcast to the storage format of the element type specified. Types that are not byte aligned will be:

  • For bitwidth > 1: Rounded up to the next byte.
  • For bitwidth = 1: Packed into 8bit bytes with bits corresponding to the linear order of the shape type from MSB to LSB, padded to on the right.

A raw buffer of a single element (or for 1-bit, a byte of value 0 or 255) will be interpreted as a splat. User code should be prepared for additional, conformant patterns to be identified as splats in the future.

Definition at line 457 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::getFromRawBuffer(), mlir::DenseElementsAttr::isValidRawBuffer(), mlirAttributeGetNull(), unwrap(), and wrap().

Referenced by mlirDenseElementsAttrBFloat16Get(), and mlirDenseElementsAttrFloat16Get().

◆ mlirDenseElementsAttrReshapeGet()

MlirAttribute mlirDenseElementsAttrReshapeGet ( MlirAttribute  attr,
MlirType  shapedType 
)

Creates a dense elements attribute that has the same data as the given dense elements attribute and a different shaped type.

The new type must have the same total number of elements.

Definition at line 615 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirDenseElementsAttrSplatGet()

MlirAttribute mlirDenseElementsAttrSplatGet ( MlirType  shapedType,
MlirAttribute  element 
)

Creates a dense elements attribute with the given Shaped type containing a single replicated element (splat).

Definition at line 470 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrStringGet()

MlirAttribute mlirDenseElementsAttrStringGet ( MlirType  shapedType,
intptr_t  numElements,
MlirStringRef strs 
)

Creates a dense elements attribute with the given shaped type from string elements.

Definition at line 603 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrUInt16Get()

MlirAttribute mlirDenseElementsAttrUInt16Get ( MlirType  shapedType,
intptr_t  numElements,
const uint16_t *  elements 
)

Definition at line 548 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrUInt32Get()

MlirAttribute mlirDenseElementsAttrUInt32Get ( MlirType  shapedType,
intptr_t  numElements,
const uint32_t *  elements 
)

Definition at line 558 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrUInt32SplatGet()

MlirAttribute mlirDenseElementsAttrUInt32SplatGet ( MlirType  shapedType,
uint32_t  element 
)

Definition at line 490 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrUInt64Get()

MlirAttribute mlirDenseElementsAttrUInt64Get ( MlirType  shapedType,
intptr_t  numElements,
const uint64_t *  elements 
)

Definition at line 568 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrUInt64SplatGet()

MlirAttribute mlirDenseElementsAttrUInt64SplatGet ( MlirType  shapedType,
uint64_t  element 
)

Definition at line 500 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseElementsAttrUInt8Get()

MlirAttribute mlirDenseElementsAttrUInt8Get ( MlirType  shapedType,
intptr_t  numElements,
const uint8_t *  elements 
)

Definition at line 538 of file BuiltinAttributes.cpp.

References getDenseAttribute().

◆ mlirDenseElementsAttrUInt8SplatGet()

MlirAttribute mlirDenseElementsAttrUInt8SplatGet ( MlirType  shapedType,
uint8_t  element 
)

Definition at line 480 of file BuiltinAttributes.cpp.

References mlir::DenseElementsAttr::get(), unwrap(), and wrap().

◆ mlirDenseF32ArrayGet()

MlirAttribute mlirDenseF32ArrayGet ( MlirContext  ctx,
intptr_t  size,
float const *  values 
)

◆ mlirDenseF32ArrayGetElement()

float mlirDenseF32ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 421 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseF64ArrayGet()

MlirAttribute mlirDenseF64ArrayGet ( MlirContext  ctx,
intptr_t  size,
double const *  values 
)

◆ mlirDenseF64ArrayGetElement()

double mlirDenseF64ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 424 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseFloatResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED float mlirDenseFloatResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 846 of file BuiltinAttributes.cpp.

◆ mlirDenseI16ArrayGet()

MlirAttribute mlirDenseI16ArrayGet ( MlirContext  ctx,
intptr_t  size,
int16_t const *  values 
)

◆ mlirDenseI16ArrayGetElement()

int16_t mlirDenseI16ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 412 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseI32ArrayGet()

MlirAttribute mlirDenseI32ArrayGet ( MlirContext  ctx,
intptr_t  size,
int32_t const *  values 
)

◆ mlirDenseI32ArrayGetElement()

int32_t mlirDenseI32ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 415 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseI64ArrayGet()

MlirAttribute mlirDenseI64ArrayGet ( MlirContext  ctx,
intptr_t  size,
int64_t const *  values 
)

◆ mlirDenseI64ArrayGetElement()

int64_t mlirDenseI64ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 418 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseI8ArrayGet()

MlirAttribute mlirDenseI8ArrayGet ( MlirContext  ctx,
intptr_t  size,
int8_t const *  values 
)

◆ mlirDenseI8ArrayGetElement()

int8_t mlirDenseI8ArrayGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 409 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirDenseInt16ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED int16_t mlirDenseInt16ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 834 of file BuiltinAttributes.cpp.

◆ mlirDenseInt32ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED int32_t mlirDenseInt32ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 838 of file BuiltinAttributes.cpp.

◆ mlirDenseInt64ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED int64_t mlirDenseInt64ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 842 of file BuiltinAttributes.cpp.

◆ mlirDenseInt8ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED int8_t mlirDenseInt8ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 830 of file BuiltinAttributes.cpp.

◆ mlirDenseUInt16ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED uint16_t mlirDenseUInt16ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 815 of file BuiltinAttributes.cpp.

◆ mlirDenseUInt32ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED uint32_t mlirDenseUInt32ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 820 of file BuiltinAttributes.cpp.

◆ mlirDenseUInt64ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED uint64_t mlirDenseUInt64ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 825 of file BuiltinAttributes.cpp.

◆ mlirDenseUInt8ResourceElementsAttrGetValue()

MLIR_CAPI_EXPORTED uint8_t mlirDenseUInt8ResourceElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 811 of file BuiltinAttributes.cpp.

◆ mlirDictionaryAttrGet()

MlirAttribute mlirDictionaryAttrGet ( MlirContext  ctx,
intptr_t  numElements,
MlirNamedAttribute const *  elements 
)

Creates a dictionary attribute containing the given list of elements in the provided context.

Definition at line 79 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirDictionaryAttrGetElement()

MlirNamedAttribute mlirDictionaryAttrGetElement ( MlirAttribute  attr,
intptr_t  pos 
)

Returns pos-th element of the given dictionary attribute.

Definition at line 93 of file BuiltinAttributes.cpp.

References mlir::NamedAttribute::getName(), mlir::NamedAttribute::getValue(), unwrap(), and wrap().

◆ mlirDictionaryAttrGetElementByName()

MlirAttribute mlirDictionaryAttrGetElementByName ( MlirAttribute  attr,
MlirStringRef  name 
)

Returns the dictionary attribute element with the given name or NULL if the given name does not exist in the dictionary.

Definition at line 100 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirDictionaryAttrGetNumElements()

intptr_t mlirDictionaryAttrGetNumElements ( MlirAttribute  attr)

Returns the number of attributes contained in a dictionary attribute.

Definition at line 89 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirElementsAttrGetNumElements()

int64_t mlirElementsAttrGetNumElements ( MlirAttribute  attr)

Gets the total number of elements in the given elements attribute.

In order to iterate over the attribute, obtain its type, which must be a statically shaped type and use its sizes to build a multi-dimensional index.

Definition at line 324 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirElementsAttrGetValue()

MlirAttribute mlirElementsAttrGetValue ( MlirAttribute  attr,
intptr_t  rank,
uint64_t *  idxs 
)

Returns the element at the given rank-dimensional index.

Definition at line 312 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirElementsAttrIsValidIndex()

bool mlirElementsAttrIsValidIndex ( MlirAttribute  attr,
intptr_t  rank,
uint64_t *  idxs 
)

Checks whether the given rank-dimensional index is valid in the given elements attribute.

Definition at line 318 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirFlatSymbolRefAttrGet()

MlirAttribute mlirFlatSymbolRefAttrGet ( MlirContext  ctx,
MlirStringRef  symbol 
)

Creates a flat symbol reference attribute in the given context referencing a symbol identified by the given string.

Definition at line 268 of file BuiltinAttributes.cpp.

References mlir::FlatSymbolRefAttr::get(), unwrap(), and wrap().

◆ mlirFlatSymbolRefAttrGetValue()

MlirStringRef mlirFlatSymbolRefAttrGetValue ( MlirAttribute  attr)

Returns the referenced symbol as a string reference.

The data remains live as long as the context in which the attribute lives.

Definition at line 272 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirFloatAttrDoubleGet()

MlirAttribute mlirFloatAttrDoubleGet ( MlirContext  ctx,
MlirType  type,
double  value 
)

Creates a floating point attribute in the given context with the given double value and double-precision FP semantics.

Definition at line 113 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirFloatAttrDoubleGetChecked()

MlirAttribute mlirFloatAttrDoubleGetChecked ( MlirLocation  loc,
MlirType  type,
double  value 
)

Same as "mlirFloatAttrDoubleGet", but if the type is not valid for a construction of a FloatAttr, returns a null MlirAttribute.

Definition at line 118 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirFloatAttrGetValueDouble()

double mlirFloatAttrGetValueDouble ( MlirAttribute  attr)

Returns the value stored in the given floating point attribute, interpreting the value as double.

Definition at line 123 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirIntegerAttrGet()

MlirAttribute mlirIntegerAttrGet ( MlirType  type,
int64_t  value 
)

Creates an integer attribute of the given type with the given integer value.

Definition at line 135 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirIntegerAttrGetValueInt()

int64_t mlirIntegerAttrGetValueInt ( MlirAttribute  attr)

Returns the value stored in the given integer attribute, assuming the value is of signless type and fits into a signed 64-bit integer.

Definition at line 139 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirIntegerAttrGetValueSInt()

int64_t mlirIntegerAttrGetValueSInt ( MlirAttribute  attr)

Returns the value stored in the given integer attribute, assuming the value is of signed type and fits into a signed 64-bit integer.

Definition at line 143 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirIntegerAttrGetValueUInt()

uint64_t mlirIntegerAttrGetValueUInt ( MlirAttribute  attr)

Returns the value stored in the given integer attribute, assuming the value is of unsigned type and fits into an unsigned 64-bit integer.

Definition at line 147 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirOpaqueAttrGet()

MlirAttribute mlirOpaqueAttrGet ( MlirContext  ctx,
MlirStringRef  dialectNamespace,
intptr_t  dataLength,
const char *  data,
MlirType  type 
)

Creates an opaque attribute in the given context associated with the dialect identified by its namespace.

The attribute contains opaque byte data of the specified length (data need not be null-terminated).

Definition at line 183 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirOpaqueAttrGetData()

MlirStringRef mlirOpaqueAttrGetData ( MlirAttribute  attr)

Returns the raw data as a string reference.

The data remains live as long as the context in which the attribute lives.

Definition at line 196 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirOpaqueAttrGetDialectNamespace()

MlirStringRef mlirOpaqueAttrGetDialectNamespace ( MlirAttribute  attr)

Returns the namespace of the dialect with which the given opaque attribute is associated.

The namespace string is owned by the context.

Definition at line 191 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirSparseElementsAttrGetIndices()

MlirAttribute mlirSparseElementsAttrGetIndices ( MlirAttribute  attr)

Returns the dense elements attribute containing 64-bit integer indices of non-null elements in the given sparse elements attribute.

Definition at line 871 of file BuiltinAttributes.cpp.

References getIndices(), unwrap(), and wrap().

◆ mlirSparseElementsAttrGetValues()

MlirAttribute mlirSparseElementsAttrGetValues ( MlirAttribute  attr)

Returns the dense elements attribute containing the non-null elements in the given sparse elements attribute.

Definition at line 875 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirSparseElementsAttribute()

MlirAttribute mlirSparseElementsAttribute ( MlirType  shapedType,
MlirAttribute  denseIndices,
MlirAttribute  denseValues 
)

Creates a sparse elements attribute of the given shape from a list of indices and a list of associated values.

Both lists are expected to be dense elements attributes with the same number of elements. The list of indices is expected to contain 64-bit integers. The attribute is created in the same context as the type.

Definition at line 862 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirStridedLayoutAttrGet()

MlirAttribute mlirStridedLayoutAttrGet ( MlirContext  ctx,
int64_t  offset,
intptr_t  numStrides,
const int64_t *  strides 
)

Definition at line 887 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirStridedLayoutAttrGetNumStrides()

intptr_t mlirStridedLayoutAttrGetNumStrides ( MlirAttribute  attr)

Definition at line 898 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirStridedLayoutAttrGetOffset()

int64_t mlirStridedLayoutAttrGetOffset ( MlirAttribute  attr)

Definition at line 894 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirStridedLayoutAttrGetStride()

int64_t mlirStridedLayoutAttrGetStride ( MlirAttribute  attr,
intptr_t  pos 
)

Definition at line 903 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirStringAttrGet()

MlirAttribute mlirStringAttrGet ( MlirContext  ctx,
MlirStringRef  str 
)

Creates a string attribute in the given context containing the given string.

Definition at line 208 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

Referenced by mlir::python::PySymbolTable::setSymbolName(), and mlir::python::PySymbolTable::setVisibility().

◆ mlirStringAttrGetValue()

MlirStringRef mlirStringAttrGetValue ( MlirAttribute  attr)

Returns the attribute values as a string reference.

The data remains live as long as the context in which the attribute lives.

Definition at line 216 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirStringAttrTypedGet()

MlirAttribute mlirStringAttrTypedGet ( MlirType  type,
MlirStringRef  str 
)

Creates a string attribute in the given context containing the given string.

Additionally, the attribute has the given type.

Definition at line 212 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirSymbolRefAttrGet()

MlirAttribute mlirSymbolRefAttrGet ( MlirContext  ctx,
MlirStringRef  symbol,
intptr_t  numReferences,
MlirAttribute const *  references 
)

Creates a symbol reference attribute in the given context referencing a symbol identified by the given string inside a list of nested references.

Each of the references in the list must not be nested.

Definition at line 228 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirSymbolRefAttrGetLeafReference()

MlirStringRef mlirSymbolRefAttrGetLeafReference ( MlirAttribute  attr)

Returns the string reference to the leaf referenced symbol.

The data remains live as long as the context in which the attribute lives.

Definition at line 244 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirSymbolRefAttrGetNestedReference()

MlirAttribute mlirSymbolRefAttrGetNestedReference ( MlirAttribute  attr,
intptr_t  pos 
)

Returns pos-th reference nested in the given symbol reference attribute.

Definition at line 254 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirSymbolRefAttrGetNumNestedReferences()

intptr_t mlirSymbolRefAttrGetNumNestedReferences ( MlirAttribute  attr)

Returns the number of references nested in the given symbol reference attribute.

Definition at line 249 of file BuiltinAttributes.cpp.

References unwrap().

◆ mlirSymbolRefAttrGetRootReference()

MlirStringRef mlirSymbolRefAttrGetRootReference ( MlirAttribute  attr)

Returns the string reference to the root referenced symbol.

The data remains live as long as the context in which the attribute lives.

Definition at line 239 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirTypeAttrGet()

MlirAttribute mlirTypeAttrGet ( MlirType  type)

Creates a type attribute wrapping the given type in the same context as the type.

Definition at line 284 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirTypeAttrGetValue()

MlirType mlirTypeAttrGetValue ( MlirAttribute  attr)

Returns the type stored in the given type attribute.

Definition at line 288 of file BuiltinAttributes.cpp.

References unwrap(), and wrap().

◆ mlirUnitAttrGet()

MlirAttribute mlirUnitAttrGet ( MlirContext  ctx)

Creates a unit attribute in the given context.

Definition at line 300 of file BuiltinAttributes.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirUnmanagedDenseBoolResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseBoolResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const int *  elements 
)

Definition at line 726 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseDoubleResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseDoubleResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const double *  elements 
)

Definition at line 793 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseFloatResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseFloatResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const float *  elements 
)

Definition at line 786 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseInt16ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt16ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const int16_t *  elements 
)

Definition at line 768 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseInt32ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt32ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const int32_t *  elements 
)

Definition at line 774 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseInt64ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt64ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const int64_t *  elements 
)

Definition at line 780 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseInt8ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseInt8ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const int8_t *  elements 
)

Definition at line 762 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseUInt16ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt16ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const uint16_t *  elements 
)

Definition at line 739 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseUInt32ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt32ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const uint32_t *  elements 
)

Definition at line 747 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseUInt64ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt64ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const uint64_t *  elements 
)

Definition at line 755 of file BuiltinAttributes.cpp.

◆ mlirUnmanagedDenseUInt8ResourceElementsAttrGet()

MLIR_CAPI_EXPORTED MlirAttribute mlirUnmanagedDenseUInt8ResourceElementsAttrGet ( MlirType  shapedType,
MlirStringRef  name,
intptr_t  numElements,
const uint8_t *  elements 
)

Definition at line 732 of file BuiltinAttributes.cpp.