diff --git a/previews/PR62/api/index.html b/previews/PR62/api/index.html index 595120da..d09d41b9 100644 --- a/previews/PR62/api/index.html +++ b/previews/PR62/api/index.html @@ -1,2 +1,2 @@ -API · MLIR.jl

API

Types and constants

Functions and macros

Documentation

MLIR.API.MlirDiagnosticType
MlirDiagnostic

An opaque reference to a diagnostic, always owned by the diagnostics engine (context). Must not be stored outside of the diagnostic handler.

source
MLIR.API.MlirDiagnosticHandlerType

Diagnostic handler type. Accepts a reference to a diagnostic, which is only guaranteed to be live during the call. The handler is passed the userData that was provided when the handler was attached to a context. If the handler processed the diagnostic completely, it is expected to return success. Otherwise, it is expected to return failure to indicate that other handlers should attempt to process the diagnostic.

source
MLIR.API.MlirExternalPassCallbacksType
MlirExternalPassCallbacks

Structure of external MlirPass callbacks. All callbacks are required to be set unless otherwise specified.

FieldNote
constructThis callback is called from the pass is created. This is analogous to a C++ pass constructor.
destructThis callback is called when the pass is destroyed This is analogous to a C++ pass destructor.
initializeThis callback is optional. The callback is called before the pass is run, allowing a chance to initialize any complex state necessary for running the pass. See Pass::initialize(MLIRContext *).
cloneThis callback is called when the pass is cloned. See Pass::clonePass().
runThis callback is called when the pass is run. See Pass::runOnOperation().
source
MLIR.API.MlirLogicalResultType
MlirLogicalResult

A logical result value, essentially a boolean with named states. LLVM convention for using boolean values to designate success or failure of an operation is a moving target, so MLIR opted for an explicit class. Instances of MlirLogicalResult must only be inspected using the associated functions.

source
MLIR.API.MlirNamedAttributeType
MlirNamedAttribute

Named MLIR attribute.

A named attribute is essentially a (name, attribute) pair where the name is a string.

source
MLIR.API.MlirOperationStateType
MlirOperationState

An auxiliary class for constructing operations.

This class contains all the information necessary to construct the operation. It owns the MlirRegions it has pointers to and does not own anything else. By default, the state can be constructed from a name and location, the latter being also used to access the context, and has no other components. These components can be added progressively until the operation is constructed. Users are not expected to rely on the internals of this class and should use mlirOperationState* functions instead.

source
MLIR.API.MlirSparseTensorDimLevelTypeType
MlirSparseTensorDimLevelType

Dimension level types that define sparse tensors: - MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE - dimension is dense, every entry is stored - MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED - dimension is sparse, only nonzeros are stored. - MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON - dimension contains single coordinate, no siblings.

These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API. If updating, keep them in sync and update the static_assert in the impl file.

source
MLIR.API.MlirStringCallbackType

A callback for returning string references.

This function is called back by the functions that need to return a reference to the portion of the string with the following arguments: - an MlirStringRef representing the current portion of the string - a pointer to user data forwarded from the printing call.

source
MLIR.API.MlirStringRefType
MlirStringRef

A pointer to a sized fragment of a string, not necessarily null-terminated. Does not own the underlying string. This is equivalent to llvm::StringRef.

FieldNote
dataPointer to the first symbol.
lengthLength of the fragment.
source
MLIR.API.MlirTypesCallbackType

These callbacks are used to return multiple types from functions while transferring ownership to the caller. The first argument is the number of consecutive elements pointed to by the second argument. The third argument is an opaque pointer forwarded to the callback by the caller.

source
MLIR.API.mlirAffineExprIsNullMethod
mlirAffineExprIsNull(affineExpr)

Returns true if the given affine expression is a null expression. Note constant zero is not a null expression.

source
MLIR.API.mlirAffineExprIsPureAffineMethod
mlirAffineExprIsPureAffine(affineExpr)

Checks whether the given affine expression is a pure affine expression, i.e. mul, floordiv, ceildic, and mod is only allowed w.r.t constants.

source
MLIR.API.mlirAffineExprPrintMethod
mlirAffineExprPrint(affineExpr, callback, userData)

Prints an affine expression by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirAffineMapAttrGetMethod
mlirAffineMapAttrGet(map)

Creates an affine map attribute wrapping the given map. The attribute belongs to the same context as the affine map.

source
MLIR.API.mlirAffineMapCompressUnusedSymbolsMethod
mlirAffineMapCompressUnusedSymbols(affineMaps, size, result, populateResult)

Returns the simplified affine map resulting from dropping the symbols that do not appear in any of the individual maps in affineMaps. Asserts that all maps in affineMaps are normalized to the same number of dims and symbols. Takes a callback populateResult to fill the res container with value m at entry idx. This allows returning without worrying about ownership considerations.

source
MLIR.API.mlirAffineMapEmptyGetMethod
mlirAffineMapEmptyGet(ctx)

Creates a zero result affine map with no dimensions or symbols in the context. The affine map is owned by the context.

source
MLIR.API.mlirAffineMapGetMethod
mlirAffineMapGet(ctx, dimCount, symbolCount, nAffineExprs, affineExprs)

Creates an affine map with results defined by the given list of affine expressions. The map resulting map also has the requested number of input dimensions and symbols, regardless of them being used in the results.

source
MLIR.API.mlirAffineMapGetMajorSubMapMethod
mlirAffineMapGetMajorSubMap(affineMap, numResults)

Returns the affine map consisting of the most major numResults results. Returns the null AffineMap if the numResults is equal to zero. Returns the affineMap if numResults is greater or equals to number of results of the given affine map.

source
MLIR.API.mlirAffineMapGetMinorSubMapMethod
mlirAffineMapGetMinorSubMap(affineMap, numResults)

Returns the affine map consisting of the most minor numResults results. Returns the null AffineMap if the numResults is equal to zero. Returns the affineMap if numResults is greater or equals to number of results of the given affine map.

source
MLIR.API.mlirAffineMapIsIdentityMethod
mlirAffineMapIsIdentity(affineMap)

Checks whether the given affine map is an identity affine map. The function asserts that the number of dimensions is greater or equal to the number of results.

source
MLIR.API.mlirAffineMapMinorIdentityGetMethod
mlirAffineMapMinorIdentityGet(ctx, dims, results)

Creates an identity affine map on the most minor dimensions in the context. The affine map is owned by the context. The function asserts that the number of dimensions is greater or equal to the number of results.

source
MLIR.API.mlirAffineMapPermutationGetMethod
mlirAffineMapPermutationGet(ctx, size, permutation)

Creates an affine map with a permutation expression and its size in the context. The permutation expression is a non-empty vector of integers. The elements of the permutation vector must be continuous from 0 and cannot be repeated (i.e. [1,2,0] is a valid permutation. [2,0] or [1,1,2] is an invalid invalid permutation.) The affine map is owned by the context.

source
MLIR.API.mlirAffineMapPrintMethod
mlirAffineMapPrint(affineMap, callback, userData)

Prints an affine map by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirAffineMapReplaceMethod
mlirAffineMapReplace(affineMap, expression, replacement, numResultDims, numResultSyms)

Apply AffineExpr::replace(map) to each of the results and return a new new AffineMap with the new results and the specified number of dims and symbols.

source
MLIR.API.mlirAffineMapZeroResultGetMethod
mlirAffineMapZeroResultGet(ctx, dimCount, symbolCount)

Creates a zero result affine map of the given dimensions and symbols in the context. The affine map is owned by the context.

source
MLIR.API.mlirAnyQuantizedTypeGetMethod
mlirAnyQuantizedTypeGet(flags, storageType, expressedType, storageTypeMin, storageTypeMax)

Creates an instance of AnyQuantizedType with the given parameters in the same context as storageType and returns it. The instance is owned by the context.

source
MLIR.API.mlirArrayAttrGetMethod
mlirArrayAttrGet(ctx, numElements, elements)

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

source
MLIR.API.mlirAttributePrintMethod
mlirAttributePrint(attr, callback, userData)

Prints an attribute by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirBlockCreateMethod
mlirBlockCreate(nArgs, args, locs)

Creates a new empty block with the given argument types and transfers ownership to the caller.

source
MLIR.API.mlirBlockEqualMethod
mlirBlockEqual(block, other)

Checks whether two blocks handles point to the same block. This does not perform deep comparison.

source
MLIR.API.mlirBlockInsertOwnedOperationMethod
mlirBlockInsertOwnedOperation(block, pos, operation)

Takes an operation owned by the caller and inserts it as pos to the block. This is an expensive operation that scans the block linearly, prefer insertBefore/After instead.

source
MLIR.API.mlirBlockInsertOwnedOperationAfterMethod
mlirBlockInsertOwnedOperationAfter(block, reference, operation)

Takes an operation owned by the caller and inserts it after the (non-owned) reference operation in the given block. If the reference is null, prepends the operation. Otherwise, the reference must belong to the block.

source
MLIR.API.mlirBlockInsertOwnedOperationBeforeMethod
mlirBlockInsertOwnedOperationBefore(block, reference, operation)

Takes an operation owned by the caller and inserts it before the (non-owned) reference operation in the given block. If the reference is null, appends the operation. Otherwise, the reference must belong to the block.

source
MLIR.API.mlirBlockPrintMethod
mlirBlockPrint(block, callback, userData)

Prints a block by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirCalibratedQuantizedTypeGetMethod
mlirCalibratedQuantizedTypeGet(expressedType, min, max)

Creates an instance of CalibratedQuantizedType with the given parameters in the same context as expressedType and returns it. The instance is owned by the context.

source
MLIR.API.mlirComplexTypeGetMethod
mlirComplexTypeGet(elementType)

Creates a complex type with the given element type in the same context as the element type. The type is owned by the context.

source
MLIR.API.mlirContextAttachDiagnosticHandlerMethod
mlirContextAttachDiagnosticHandler(context, handler, userData, deleteUserData)

Attaches the diagnostic handler to the context. Handlers are invoked in the reverse order of attachment until one of them processes the diagnostic completely. When a handler is invoked it is passed the userData that was provided when it was attached. If non-NULL, deleteUserData is called once the system no longer needs to call the handler (for instance after the handler is detached or the context is destroyed). Returns an identifier that can be used to detach the handler.

source
MLIR.API.mlirContextGetOrLoadDialectMethod
mlirContextGetOrLoadDialect(context, name)

Gets the dialect instance owned by the given context using the dialect namespace to identify it, loads (i.e., constructs the instance of) the dialect if necessary. If the dialect is not registered with the context, returns null. Use mlirContextLoad<Name>Dialect to load an unregistered dialect.

source
MLIR.API.mlirContextIsRegisteredOperationMethod
mlirContextIsRegisteredOperation(context, name)

Returns whether the given fully-qualified operation (i.e. 'dialect.operation') is registered with the context. This will return true if the dialect is loaded and the operation is registered within the dialect.

source
MLIR.API.mlirCreateExternalPassMethod
mlirCreateExternalPass(passID, name, argument, description, opName, nDependentDialects, dependentDialects, callbacks, userData)

Creates an external MlirPass that calls the supplied callbacks using the supplied userData. If opName is empty, the pass is a generic operation pass. Otherwise it is an operation pass specific to the specified pass name.

source
MLIR.API.mlirDenseElementsAttrBoolGetMethod
mlirDenseElementsAttrBoolGet(shapedType, numElements, 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.

source
MLIR.API.mlirDenseElementsAttrGetMethod
mlirDenseElementsAttrGet(shapedType, numElements, elements)

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

source
MLIR.API.mlirDenseElementsAttrRawBufferGetMethod
mlirDenseElementsAttrRawBufferGet(shapedType, rawBufferSize, 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.

source
MLIR.API.mlirDenseElementsAttrReshapeGetMethod
mlirDenseElementsAttrReshapeGet(attr, 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.

source
MLIR.API.mlirDiagnosticGetNoteMethod
mlirDiagnosticGetNote(diagnostic, pos)

Returns pos-th note attached to the diagnostic. Expects pos to be a valid zero-based index into the list of notes.

source
MLIR.API.mlirDialectEqualMethod
mlirDialectEqual(dialect1, dialect2)

Checks if two dialects that belong to the same context are equal. Dialects from different contexts will not compare equal.

source
MLIR.API.mlirDictionaryAttrGetMethod
mlirDictionaryAttrGet(ctx, numElements, elements)

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

source
MLIR.API.mlirElementsAttrGetNumElementsMethod
mlirElementsAttrGetNumElements(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.

source
MLIR.API.mlirEmitErrorMethod
mlirEmitError(location, message)

Emits an error at the given location through the diagnostics engine. Used for testing purposes.

source
MLIR.API.mlirExecutionEngineCreateMethod
mlirExecutionEngineCreate(op, optLevel, numPaths, sharedLibPaths)

Creates an ExecutionEngine for the provided ModuleOp. The ModuleOp is expected to be "translatable" to LLVM IR (only contains operations in dialects that implement the LLVMTranslationDialectInterface). The module ownership stays with the client and can be destroyed as soon as the call returns. optLevel is the optimization level to be used for transformation and code generation. LLVM passes at optLevel are run before code generation. The number and array of paths corresponding to shared libraries that will be loaded are specified via numPaths and sharedLibPaths respectively. TODO: figure out other options.

source
MLIR.API.mlirExecutionEngineInvokePackedMethod
mlirExecutionEngineInvokePacked(jit, name, arguments)

Invoke a native function in the execution engine by name with the arguments and result of the invoked function passed as an array of pointers. The function must have been tagged with the llvm.emit\_c\_interface attribute. Returns a failure if the execution fails for any reason (the function name can't be resolved for instance).

source
MLIR.API.mlirExecutionEngineLookupPackedMethod
mlirExecutionEngineLookupPacked(jit, name)

Lookup the wrapper of the native function in the execution engine with the given name, returns nullptr if the function can't be looked-up.

source
MLIR.API.mlirFlatSymbolRefAttrGetMethod
mlirFlatSymbolRefAttrGet(ctx, symbol)

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

source
MLIR.API.mlirFloatAttrDoubleGetMethod
mlirFloatAttrDoubleGet(ctx, type, value)

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

source
MLIR.API.mlirFunctionTypeGetMethod
mlirFunctionTypeGet(ctx, numInputs, inputs, numResults, results)

Creates a function type, mapping a list of input types to result types.

source
MLIR.API.mlirInferTypeOpInterfaceInferReturnTypesMethod
mlirInferTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, nRegions, regions, callback, userData)

Infers the return types of the operation identified by its canonical given the arguments that will be supplied to its generic builder. Calls callback with the types of inferred arguments, potentially several times, on success. Returns failure otherwise.

source
MLIR.API.mlirIntegerAttrGetValueIntMethod
mlirIntegerAttrGetValueInt(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.

source
MLIR.API.mlirIntegerAttrGetValueSIntMethod
mlirIntegerAttrGetValueSInt(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.

source
MLIR.API.mlirIntegerAttrGetValueUIntMethod
mlirIntegerAttrGetValueUInt(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.

source
MLIR.API.mlirIntegerSetEmptyGetMethod
mlirIntegerSetEmptyGet(context, numDims, numSymbols)

Gets or creates a new canonically empty integer set with the give number of dimensions and symbols in the given context.

source
MLIR.API.mlirIntegerSetEqualMethod
mlirIntegerSetEqual(s1, s2)

Checks if two integer set objects are equal. This is a "shallow" comparison of two objects. Only the sets with some small number of constraints are uniqued and compare equal here. Set objects that represent the same integer set with different constraints may be considered non-equal by this check. Set difference followed by an (expensive) emptiness check should be used to check equivalence of the underlying integer sets.

source
MLIR.API.mlirIntegerSetGetMethod
mlirIntegerSetGet(context, numDims, numSymbols, numConstraints, constraints, eqFlags)

Gets or creates a new integer set in the given context. The set is defined by a list of affine constraints, with the given number of input dimensions and symbols, which are treated as either equalities (eqFlags is 1) or inequalities (eqFlags is 0). Both constraints and eqFlags are expected to point to at least numConstraint consecutive values.

source
MLIR.API.mlirIntegerSetPrintMethod
mlirIntegerSetPrint(set, callback, userData)

Prints an integer set by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirIntegerSetReplaceGetMethod
mlirIntegerSetReplaceGet(set, dimReplacements, symbolReplacements, numResultDims, numResultSymbols)

Gets or creates a new integer set in which the values and dimensions of the given set are replaced with the given affine expressions. dimReplacements and symbolReplacements are expected to point to at least as many consecutive expressions as the given set has dimensions and symbols, respectively. The new set will have numResultDims and numResultSymbols dimensions and symbols, respectively.

source
MLIR.API.mlirIntegerTypeGetMethod
mlirIntegerTypeGet(ctx, bitwidth)

Creates a signless integer type of the given bitwidth in the context. The type is owned by the context.

source
MLIR.API.mlirLocationNameGetMethod
mlirLocationNameGet(context, name, childLoc)

Creates a name location owned by the given context. Providing null location for childLoc is allowed and if childLoc is null location, then the behavior is the same as having unknown child location.

source
MLIR.API.mlirLocationPrintMethod
mlirLocationPrint(location, callback, userData)

Prints a location by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirMemRefTypeContiguousGetMethod
mlirMemRefTypeContiguousGet(elementType, rank, shape, memorySpace)

Creates a MemRef type with the given rank, shape, memory space and element type in the same context as the element type. The type has no affine maps, i.e. represents a default row-major contiguous memref. The type is owned by the context.

source
MLIR.API.mlirMemRefTypeGetMethod
mlirMemRefTypeGet(elementType, rank, shape, layout, memorySpace)

Creates a MemRef type with the given rank and shape, a potentially empty list of affine layout maps, the given memory space and element type, in the same context as element type. The type is owned by the context.

source
MLIR.API.mlirOpPassManagerAddOwnedPassMethod
mlirOpPassManagerAddOwnedPass(passManager, pass)

Add a pass and transfer ownership to the provided mlirOpPassManager. If the pass is not a generic operation pass or matching the type of the provided PassManager, a new OpPassManager is implicitly nested under the provided PassManager.

source
MLIR.API.mlirOpPassManagerGetNestedUnderMethod
mlirOpPassManagerGetNestedUnder(passManager, operationName)

Nest an OpPassManager under the provided OpPassManager, the nested passmanager will only run on operations matching the provided name. The returned OpPassManager will be destroyed when the parent is destroyed.

source
MLIR.API.mlirOpPrintingFlagsElideLargeElementsAttrsMethod
mlirOpPrintingFlagsElideLargeElementsAttrs(flags, largeElementLimit)

Enables the elision of large elements attributes by printing a lexically valid but otherwise meaningless form instead of the element data. The largeElementLimit is used to configure what is considered to be a "large" ElementsAttr by providing an upper limit to the number of elements.

source
MLIR.API.mlirOpPrintingFlagsEnableDebugInfoMethod
mlirOpPrintingFlagsEnableDebugInfo(flags, prettyForm)

Enable printing of debug information. If 'prettyForm' is set to true, debug information is printed in a more readable 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable.

source
MLIR.API.mlirOpPrintingFlagsUseLocalScopeMethod
mlirOpPrintingFlagsUseLocalScope(flags)

Use local scope when printing the operation. This allows for using the printer in a more localized and thread-safe setting, but may not necessarily be identical to what the IR will look like when dumping the full module.

source
MLIR.API.mlirOpResultGetOwnerMethod
mlirOpResultGetOwner(value)

Returns an operation that produced this value as its result. Asserts if the value is not an op result.

source
MLIR.API.mlirOpaqueAttrGetMethod
mlirOpaqueAttrGet(ctx, dialectNamespace, dataLength, data, 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).

source
MLIR.API.mlirOpaqueAttrGetDataMethod
mlirOpaqueAttrGetData(attr)

Returns the raw data as a string reference. The data remains live as long as the context in which the attribute lives.

source
MLIR.API.mlirOpaqueTypeGetMethod
mlirOpaqueTypeGet(ctx, dialectNamespace, typeData)

Creates an opaque type in the given context associated with the dialect identified by its namespace. The type contains opaque byte data of the specified length (data need not be null-terminated).

source
MLIR.API.mlirOpaqueTypeGetDataMethod
mlirOpaqueTypeGetData(type)

Returns the raw data as a string reference. The data remains live as long as the context in which the type lives.

source
MLIR.API.mlirOperationCloneMethod
mlirOperationClone(op)

Creates a deep copy of an operation. The operation is not inserted and ownership is transferred to the caller.

source
MLIR.API.mlirOperationCreateMethod
mlirOperationCreate(state)

Creates an operation and transfers ownership to the caller. Note that caller owned child objects are transferred in this call and must not be further used. Particularly, this applies to any regions added to the state (the implementation may invalidate any such pointers).

This call can fail under the following conditions, in which case, it will return a null operation and emit diagnostics: - Result type inference is enabled and cannot be performed.

source
MLIR.API.mlirOperationEqualMethod
mlirOperationEqual(op, other)

Checks whether two operation handles point to the same operation. This does not perform deep comparison.

source
MLIR.API.mlirOperationGetTypeIDMethod
mlirOperationGetTypeID(op)

Gets the type id of the operation. Returns null if the operation does not have a registered operation description.

source
MLIR.API.mlirOperationImplementsInterfaceStaticMethod
mlirOperationImplementsInterfaceStatic(operationName, context, interfaceTypeID)

Returns true if the operation identified by its canonical string name implements the interface identified by its TypeID in the given context. Note that interfaces may be attached to operations in some contexts and not others.

source
MLIR.API.mlirOperationMoveAfterMethod
mlirOperationMoveAfter(op, other)

Moves the given operation immediately after the other operation in its parent block. The given operation may be owned by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

source
MLIR.API.mlirOperationMoveBeforeMethod
mlirOperationMoveBefore(op, other)

Moves the given operation immediately before the other operation in its parent block. The given operation may be owner by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

source
MLIR.API.mlirOperationPrintMethod
mlirOperationPrint(op, callback, userData)

Prints an operation by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirOperationRemoveFromParentMethod
mlirOperationRemoveFromParent(op)

Removes the given operation from its parent block. The operation is not destroyed. The ownership of the operation is transferred to the caller.

source
MLIR.API.mlirPassManagerAddOwnedPassMethod
mlirPassManagerAddOwnedPass(passManager, pass)

Add a pass and transfer ownership to the provided top-level mlirPassManager. If the pass is not a generic operation pass or a ModulePass, a new OpPassManager is implicitly nested under the provided PassManager.

source
MLIR.API.mlirPassManagerGetNestedUnderMethod
mlirPassManagerGetNestedUnder(passManager, operationName)

Nest an OpPassManager under the top-level PassManager, the nested passmanager will only run on operations matching the provided name. The returned OpPassManager will be destroyed when the parent is destroyed. To further nest more OpPassManager under the newly returned one, see mlirOpPassManagerNest below.

source
MLIR.API.mlirPrintPassPipelineMethod
mlirPrintPassPipeline(passManager, callback, userData)

Print a textual MLIR pass pipeline by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirQuantizedTypeCastFromExpressedTypeMethod
mlirQuantizedTypeCastFromExpressedType(type, candidate)

Casts from a type based on the expressed type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid.

source
MLIR.API.mlirQuantizedTypeCastFromStorageTypeMethod
mlirQuantizedTypeCastFromStorageType(type, candidate)

Casts from a type based on the storage type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid.

source
MLIR.API.mlirRankedTensorTypeGetMethod
mlirRankedTensorTypeGet(rank, shape, elementType, encoding)

Creates a tensor type of a fixed rank with the given shape, element type, and optional encoding in the same context as the element type. The type is owned by the context. Tensor types without any specific encoding field should assign mlirAttributeGetNull() to this parameter.

source
MLIR.API.mlirRegionEqualMethod
mlirRegionEqual(region, other)

Checks whether two region handles point to the same region. This does not perform deep comparison.

source
MLIR.API.mlirRegionInsertOwnedBlockMethod
mlirRegionInsertOwnedBlock(region, pos, block)

Takes a block owned by the caller and inserts it at pos to the given region. This is an expensive operation that linearly scans the region, prefer insertAfter/Before instead.

source
MLIR.API.mlirRegionInsertOwnedBlockAfterMethod
mlirRegionInsertOwnedBlockAfter(region, reference, block)

Takes a block owned by the caller and inserts it after the (non-owned) reference block in the given region. The reference block must belong to the region. If the reference block is null, prepends the block to the region.

source
MLIR.API.mlirRegionInsertOwnedBlockBeforeMethod
mlirRegionInsertOwnedBlockBefore(region, reference, block)

Takes a block owned by the caller and inserts it before the (non-owned) reference block in the given region. The reference block must belong to the region. If the reference block is null, appends the block to the region.

source
MLIR.API.mlirSparseElementsAttributeMethod
mlirSparseElementsAttribute(shapedType, denseIndices, 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.

source
MLIR.API.mlirSparseTensorEncodingAttrGetMethod
mlirSparseTensorEncodingAttrGet(ctx, numDimLevelTypes, dimLevelTypes, dimOrdering, pointerBitWidth, indexBitWidth)

Creates a sparse_tensor.encoding attribute with the given parameters.

source
MLIR.API.mlirStringAttrGetValueMethod
mlirStringAttrGetValue(attr)

Returns the attribute values as a string reference. The data remains live as long as the context in which the attribute lives.

source
MLIR.API.mlirStringAttrTypedGetMethod
mlirStringAttrTypedGet(type, str)

Creates a string attribute in the given context containing the given string. Additionally, the attribute has the given type.

source
MLIR.API.mlirStringRefCreateMethod
mlirStringRefCreate(str, length)

Constructs a string reference from the pointer and length. The pointer need not reference to a null-terminated string.

source
MLIR.API.mlirSymbolRefAttrGetMethod
mlirSymbolRefAttrGet(ctx, symbol, numReferences, 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.

source
MLIR.API.mlirSymbolTableCreateMethod
mlirSymbolTableCreate(operation)

Creates a symbol table for the given operation. If the operation does not have the SymbolTable trait, returns a null symbol table.

source
MLIR.API.mlirSymbolTableInsertMethod
mlirSymbolTableInsert(symbolTable, operation)

Inserts the given operation into the given symbol table. The operation must have the symbol trait. If the symbol table already has a symbol with the same name, renames the symbol being inserted to ensure name uniqueness. Note that this does not move the operation itself into the block of the symbol table operation, this should be done separately. Returns the name of the symbol after insertion.

source
MLIR.API.mlirSymbolTableLookupMethod
mlirSymbolTableLookup(symbolTable, name)

Looks up a symbol with the given name in the given symbol table and returns the operation that corresponds to the symbol. If the symbol cannot be found, returns a null operation.

source
MLIR.API.mlirSymbolTableReplaceAllSymbolUsesMethod
mlirSymbolTableReplaceAllSymbolUses(oldSymbol, newSymbol, from)

Attempt to replace all uses that are nested within the given operation of the given symbol 'oldSymbol' with the provided 'newSymbol'. This does not traverse into nested symbol tables. Will fail atomically if there are any unknown operations that may be potential symbol tables.

source
MLIR.API.mlirSymbolTableWalkSymbolTablesMethod
mlirSymbolTableWalkSymbolTables(from, allSymUsesVisible, callback, userData)

Walks all symbol table operations nested within, and including, op. For each symbol table operation, the provided callback is invoked with the op and a boolean signifying if the symbols within that symbol table can be treated as if all uses within the IR are visible to the caller. allSymUsesVisible identifies whether all of the symbol uses of symbols within op are visible.

source
MLIR.API.mlirTupleTypeGetMethod
mlirTupleTypeGet(ctx, numElements, elements)

Creates a tuple type that consists of the given list of elemental types. The type is owned by the context.

source
MLIR.API.mlirTypeIDCreateMethod
mlirTypeIDCreate(ptr)

ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage

source
MLIR.API.mlirTypePrintMethod
mlirTypePrint(type, callback, userData)

Prints a location by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirUniformQuantizedPerAxisTypeGetMethod
mlirUniformQuantizedPerAxisTypeGet(flags, storageType, expressedType, nDims, scales, zeroPoints, quantizedDimension, storageTypeMin, storageTypeMax)

Creates an instance of UniformQuantizedPerAxisType with the given parameters in the same context as storageType and returns it. scales and zeroPoints point to nDims number of elements. The instance is owned by the context.

source
MLIR.API.mlirUniformQuantizedTypeGetMethod
mlirUniformQuantizedTypeGet(flags, storageType, expressedType, scale, zeroPoint, storageTypeMin, storageTypeMax)

Creates an instance of UniformQuantizedType with the given parameters in the same context as storageType and returns it. The instance is owned by the context.

source
MLIR.API.mlirUnrankedMemRefTypeGetMethod
mlirUnrankedMemRefTypeGet(elementType, memorySpace)

Creates an Unranked MemRef type with the given element type and in the given memory space. The type is owned by the context of element type.

source
MLIR.API.mlirUnrankedTensorTypeGetMethod
mlirUnrankedTensorTypeGet(elementType)

Creates an unranked tensor type with the given element type in the same context as the element type. The type is owned by the context.

source
MLIR.API.mlirValuePrintMethod
mlirValuePrint(value, callback, userData)

Prints a value by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirVectorTypeGetMethod
mlirVectorTypeGet(rank, shape, elementType)

Creates a vector type of the shape identified by its rank and dimensions, with the given element type in the same context as the element type. The type is owned by the context.

source
+API · MLIR.jl

API

Types and constants

Functions and macros

Documentation

MLIR.API.MlirDiagnosticType
MlirDiagnostic

An opaque reference to a diagnostic, always owned by the diagnostics engine (context). Must not be stored outside of the diagnostic handler.

source
MLIR.API.MlirDiagnosticHandlerType

Diagnostic handler type. Accepts a reference to a diagnostic, which is only guaranteed to be live during the call. The handler is passed the userData that was provided when the handler was attached to a context. If the handler processed the diagnostic completely, it is expected to return success. Otherwise, it is expected to return failure to indicate that other handlers should attempt to process the diagnostic.

source
MLIR.API.MlirExternalPassCallbacksType
MlirExternalPassCallbacks

Structure of external MlirPass callbacks. All callbacks are required to be set unless otherwise specified.

FieldNote
constructThis callback is called from the pass is created. This is analogous to a C++ pass constructor.
destructThis callback is called when the pass is destroyed This is analogous to a C++ pass destructor.
initializeThis callback is optional. The callback is called before the pass is run, allowing a chance to initialize any complex state necessary for running the pass. See Pass::initialize(MLIRContext *).
cloneThis callback is called when the pass is cloned. See Pass::clonePass().
runThis callback is called when the pass is run. See Pass::runOnOperation().
source
MLIR.API.MlirLogicalResultType
MlirLogicalResult

A logical result value, essentially a boolean with named states. LLVM convention for using boolean values to designate success or failure of an operation is a moving target, so MLIR opted for an explicit class. Instances of MlirLogicalResult must only be inspected using the associated functions.

source
MLIR.API.MlirNamedAttributeType
MlirNamedAttribute

Named MLIR attribute.

A named attribute is essentially a (name, attribute) pair where the name is a string.

source
MLIR.API.MlirOperationStateType
MlirOperationState

An auxiliary class for constructing operations.

This class contains all the information necessary to construct the operation. It owns the MlirRegions it has pointers to and does not own anything else. By default, the state can be constructed from a name and location, the latter being also used to access the context, and has no other components. These components can be added progressively until the operation is constructed. Users are not expected to rely on the internals of this class and should use mlirOperationState* functions instead.

source
MLIR.API.MlirSparseTensorDimLevelTypeType
MlirSparseTensorDimLevelType

Dimension level types that define sparse tensors: - MLIR_SPARSE_TENSOR_DIM_LEVEL_DENSE - dimension is dense, every entry is stored - MLIR_SPARSE_TENSOR_DIM_LEVEL_COMPRESSED - dimension is sparse, only nonzeros are stored. - MLIR_SPARSE_TENSOR_DIM_LEVEL_SINGLETON - dimension contains single coordinate, no siblings.

These correspond to SparseTensorEncodingAttr::DimLevelType in the C++ API. If updating, keep them in sync and update the static_assert in the impl file.

source
MLIR.API.MlirStringCallbackType

A callback for returning string references.

This function is called back by the functions that need to return a reference to the portion of the string with the following arguments: - an MlirStringRef representing the current portion of the string - a pointer to user data forwarded from the printing call.

source
MLIR.API.MlirStringRefType
MlirStringRef

A pointer to a sized fragment of a string, not necessarily null-terminated. Does not own the underlying string. This is equivalent to llvm::StringRef.

FieldNote
dataPointer to the first symbol.
lengthLength of the fragment.
source
MLIR.API.MlirTypesCallbackType

These callbacks are used to return multiple types from functions while transferring ownership to the caller. The first argument is the number of consecutive elements pointed to by the second argument. The third argument is an opaque pointer forwarded to the callback by the caller.

source
MLIR.API.mlirAffineExprIsNullMethod
mlirAffineExprIsNull(affineExpr)

Returns true if the given affine expression is a null expression. Note constant zero is not a null expression.

source
MLIR.API.mlirAffineExprIsPureAffineMethod
mlirAffineExprIsPureAffine(affineExpr)

Checks whether the given affine expression is a pure affine expression, i.e. mul, floordiv, ceildic, and mod is only allowed w.r.t constants.

source
MLIR.API.mlirAffineExprPrintMethod
mlirAffineExprPrint(affineExpr, callback, userData)

Prints an affine expression by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirAffineMapAttrGetMethod
mlirAffineMapAttrGet(map)

Creates an affine map attribute wrapping the given map. The attribute belongs to the same context as the affine map.

source
MLIR.API.mlirAffineMapCompressUnusedSymbolsMethod
mlirAffineMapCompressUnusedSymbols(affineMaps, size, result, populateResult)

Returns the simplified affine map resulting from dropping the symbols that do not appear in any of the individual maps in affineMaps. Asserts that all maps in affineMaps are normalized to the same number of dims and symbols. Takes a callback populateResult to fill the res container with value m at entry idx. This allows returning without worrying about ownership considerations.

source
MLIR.API.mlirAffineMapEmptyGetMethod
mlirAffineMapEmptyGet(ctx)

Creates a zero result affine map with no dimensions or symbols in the context. The affine map is owned by the context.

source
MLIR.API.mlirAffineMapGetMethod
mlirAffineMapGet(ctx, dimCount, symbolCount, nAffineExprs, affineExprs)

Creates an affine map with results defined by the given list of affine expressions. The map resulting map also has the requested number of input dimensions and symbols, regardless of them being used in the results.

source
MLIR.API.mlirAffineMapGetMajorSubMapMethod
mlirAffineMapGetMajorSubMap(affineMap, numResults)

Returns the affine map consisting of the most major numResults results. Returns the null AffineMap if the numResults is equal to zero. Returns the affineMap if numResults is greater or equals to number of results of the given affine map.

source
MLIR.API.mlirAffineMapGetMinorSubMapMethod
mlirAffineMapGetMinorSubMap(affineMap, numResults)

Returns the affine map consisting of the most minor numResults results. Returns the null AffineMap if the numResults is equal to zero. Returns the affineMap if numResults is greater or equals to number of results of the given affine map.

source
MLIR.API.mlirAffineMapIsIdentityMethod
mlirAffineMapIsIdentity(affineMap)

Checks whether the given affine map is an identity affine map. The function asserts that the number of dimensions is greater or equal to the number of results.

source
MLIR.API.mlirAffineMapMinorIdentityGetMethod
mlirAffineMapMinorIdentityGet(ctx, dims, results)

Creates an identity affine map on the most minor dimensions in the context. The affine map is owned by the context. The function asserts that the number of dimensions is greater or equal to the number of results.

source
MLIR.API.mlirAffineMapPermutationGetMethod
mlirAffineMapPermutationGet(ctx, size, permutation)

Creates an affine map with a permutation expression and its size in the context. The permutation expression is a non-empty vector of integers. The elements of the permutation vector must be continuous from 0 and cannot be repeated (i.e. [1,2,0] is a valid permutation. [2,0] or [1,1,2] is an invalid invalid permutation.) The affine map is owned by the context.

source
MLIR.API.mlirAffineMapPrintMethod
mlirAffineMapPrint(affineMap, callback, userData)

Prints an affine map by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirAffineMapReplaceMethod
mlirAffineMapReplace(affineMap, expression, replacement, numResultDims, numResultSyms)

Apply AffineExpr::replace(map) to each of the results and return a new new AffineMap with the new results and the specified number of dims and symbols.

source
MLIR.API.mlirAffineMapZeroResultGetMethod
mlirAffineMapZeroResultGet(ctx, dimCount, symbolCount)

Creates a zero result affine map of the given dimensions and symbols in the context. The affine map is owned by the context.

source
MLIR.API.mlirAnyQuantizedTypeGetMethod
mlirAnyQuantizedTypeGet(flags, storageType, expressedType, storageTypeMin, storageTypeMax)

Creates an instance of AnyQuantizedType with the given parameters in the same context as storageType and returns it. The instance is owned by the context.

source
MLIR.API.mlirArrayAttrGetMethod
mlirArrayAttrGet(ctx, numElements, elements)

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

source
MLIR.API.mlirAttributePrintMethod
mlirAttributePrint(attr, callback, userData)

Prints an attribute by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirBlockCreateMethod
mlirBlockCreate(nArgs, args, locs)

Creates a new empty block with the given argument types and transfers ownership to the caller.

source
MLIR.API.mlirBlockEqualMethod
mlirBlockEqual(block, other)

Checks whether two blocks handles point to the same block. This does not perform deep comparison.

source
MLIR.API.mlirBlockInsertOwnedOperationMethod
mlirBlockInsertOwnedOperation(block, pos, operation)

Takes an operation owned by the caller and inserts it as pos to the block. This is an expensive operation that scans the block linearly, prefer insertBefore/After instead.

source
MLIR.API.mlirBlockInsertOwnedOperationAfterMethod
mlirBlockInsertOwnedOperationAfter(block, reference, operation)

Takes an operation owned by the caller and inserts it after the (non-owned) reference operation in the given block. If the reference is null, prepends the operation. Otherwise, the reference must belong to the block.

source
MLIR.API.mlirBlockInsertOwnedOperationBeforeMethod
mlirBlockInsertOwnedOperationBefore(block, reference, operation)

Takes an operation owned by the caller and inserts it before the (non-owned) reference operation in the given block. If the reference is null, appends the operation. Otherwise, the reference must belong to the block.

source
MLIR.API.mlirBlockPrintMethod
mlirBlockPrint(block, callback, userData)

Prints a block by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirCalibratedQuantizedTypeGetMethod
mlirCalibratedQuantizedTypeGet(expressedType, min, max)

Creates an instance of CalibratedQuantizedType with the given parameters in the same context as expressedType and returns it. The instance is owned by the context.

source
MLIR.API.mlirComplexTypeGetMethod
mlirComplexTypeGet(elementType)

Creates a complex type with the given element type in the same context as the element type. The type is owned by the context.

source
MLIR.API.mlirContextAttachDiagnosticHandlerMethod
mlirContextAttachDiagnosticHandler(context, handler, userData, deleteUserData)

Attaches the diagnostic handler to the context. Handlers are invoked in the reverse order of attachment until one of them processes the diagnostic completely. When a handler is invoked it is passed the userData that was provided when it was attached. If non-NULL, deleteUserData is called once the system no longer needs to call the handler (for instance after the handler is detached or the context is destroyed). Returns an identifier that can be used to detach the handler.

source
MLIR.API.mlirContextGetOrLoadDialectMethod
mlirContextGetOrLoadDialect(context, name)

Gets the dialect instance owned by the given context using the dialect namespace to identify it, loads (i.e., constructs the instance of) the dialect if necessary. If the dialect is not registered with the context, returns null. Use mlirContextLoad<Name>Dialect to load an unregistered dialect.

source
MLIR.API.mlirContextIsRegisteredOperationMethod
mlirContextIsRegisteredOperation(context, name)

Returns whether the given fully-qualified operation (i.e. 'dialect.operation') is registered with the context. This will return true if the dialect is loaded and the operation is registered within the dialect.

source
MLIR.API.mlirCreateExternalPassMethod
mlirCreateExternalPass(passID, name, argument, description, opName, nDependentDialects, dependentDialects, callbacks, userData)

Creates an external MlirPass that calls the supplied callbacks using the supplied userData. If opName is empty, the pass is a generic operation pass. Otherwise it is an operation pass specific to the specified pass name.

source
MLIR.API.mlirDenseElementsAttrBoolGetMethod
mlirDenseElementsAttrBoolGet(shapedType, numElements, 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.

source
MLIR.API.mlirDenseElementsAttrGetMethod
mlirDenseElementsAttrGet(shapedType, numElements, elements)

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

source
MLIR.API.mlirDenseElementsAttrRawBufferGetMethod
mlirDenseElementsAttrRawBufferGet(shapedType, rawBufferSize, 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.

source
MLIR.API.mlirDenseElementsAttrReshapeGetMethod
mlirDenseElementsAttrReshapeGet(attr, 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.

source
MLIR.API.mlirDiagnosticGetNoteMethod
mlirDiagnosticGetNote(diagnostic, pos)

Returns pos-th note attached to the diagnostic. Expects pos to be a valid zero-based index into the list of notes.

source
MLIR.API.mlirDialectEqualMethod
mlirDialectEqual(dialect1, dialect2)

Checks if two dialects that belong to the same context are equal. Dialects from different contexts will not compare equal.

source
MLIR.API.mlirDictionaryAttrGetMethod
mlirDictionaryAttrGet(ctx, numElements, elements)

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

source
MLIR.API.mlirElementsAttrGetNumElementsMethod
mlirElementsAttrGetNumElements(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.

source
MLIR.API.mlirEmitErrorMethod
mlirEmitError(location, message)

Emits an error at the given location through the diagnostics engine. Used for testing purposes.

source
MLIR.API.mlirExecutionEngineCreateMethod
mlirExecutionEngineCreate(op, optLevel, numPaths, sharedLibPaths)

Creates an ExecutionEngine for the provided ModuleOp. The ModuleOp is expected to be "translatable" to LLVM IR (only contains operations in dialects that implement the LLVMTranslationDialectInterface). The module ownership stays with the client and can be destroyed as soon as the call returns. optLevel is the optimization level to be used for transformation and code generation. LLVM passes at optLevel are run before code generation. The number and array of paths corresponding to shared libraries that will be loaded are specified via numPaths and sharedLibPaths respectively. TODO: figure out other options.

source
MLIR.API.mlirExecutionEngineInvokePackedMethod
mlirExecutionEngineInvokePacked(jit, name, arguments)

Invoke a native function in the execution engine by name with the arguments and result of the invoked function passed as an array of pointers. The function must have been tagged with the llvm.emit\_c\_interface attribute. Returns a failure if the execution fails for any reason (the function name can't be resolved for instance).

source
MLIR.API.mlirExecutionEngineLookupPackedMethod
mlirExecutionEngineLookupPacked(jit, name)

Lookup the wrapper of the native function in the execution engine with the given name, returns nullptr if the function can't be looked-up.

source
MLIR.API.mlirFlatSymbolRefAttrGetMethod
mlirFlatSymbolRefAttrGet(ctx, symbol)

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

source
MLIR.API.mlirFloatAttrDoubleGetMethod
mlirFloatAttrDoubleGet(ctx, type, value)

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

source
MLIR.API.mlirFunctionTypeGetMethod
mlirFunctionTypeGet(ctx, numInputs, inputs, numResults, results)

Creates a function type, mapping a list of input types to result types.

source
MLIR.API.mlirInferTypeOpInterfaceInferReturnTypesMethod
mlirInferTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, nRegions, regions, callback, userData)

Infers the return types of the operation identified by its canonical given the arguments that will be supplied to its generic builder. Calls callback with the types of inferred arguments, potentially several times, on success. Returns failure otherwise.

source
MLIR.API.mlirIntegerAttrGetValueIntMethod
mlirIntegerAttrGetValueInt(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.

source
MLIR.API.mlirIntegerAttrGetValueSIntMethod
mlirIntegerAttrGetValueSInt(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.

source
MLIR.API.mlirIntegerAttrGetValueUIntMethod
mlirIntegerAttrGetValueUInt(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.

source
MLIR.API.mlirIntegerSetEmptyGetMethod
mlirIntegerSetEmptyGet(context, numDims, numSymbols)

Gets or creates a new canonically empty integer set with the give number of dimensions and symbols in the given context.

source
MLIR.API.mlirIntegerSetEqualMethod
mlirIntegerSetEqual(s1, s2)

Checks if two integer set objects are equal. This is a "shallow" comparison of two objects. Only the sets with some small number of constraints are uniqued and compare equal here. Set objects that represent the same integer set with different constraints may be considered non-equal by this check. Set difference followed by an (expensive) emptiness check should be used to check equivalence of the underlying integer sets.

source
MLIR.API.mlirIntegerSetGetMethod
mlirIntegerSetGet(context, numDims, numSymbols, numConstraints, constraints, eqFlags)

Gets or creates a new integer set in the given context. The set is defined by a list of affine constraints, with the given number of input dimensions and symbols, which are treated as either equalities (eqFlags is 1) or inequalities (eqFlags is 0). Both constraints and eqFlags are expected to point to at least numConstraint consecutive values.

source
MLIR.API.mlirIntegerSetPrintMethod
mlirIntegerSetPrint(set, callback, userData)

Prints an integer set by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirIntegerSetReplaceGetMethod
mlirIntegerSetReplaceGet(set, dimReplacements, symbolReplacements, numResultDims, numResultSymbols)

Gets or creates a new integer set in which the values and dimensions of the given set are replaced with the given affine expressions. dimReplacements and symbolReplacements are expected to point to at least as many consecutive expressions as the given set has dimensions and symbols, respectively. The new set will have numResultDims and numResultSymbols dimensions and symbols, respectively.

source
MLIR.API.mlirIntegerTypeGetMethod
mlirIntegerTypeGet(ctx, bitwidth)

Creates a signless integer type of the given bitwidth in the context. The type is owned by the context.

source
MLIR.API.mlirLocationNameGetMethod
mlirLocationNameGet(context, name, childLoc)

Creates a name location owned by the given context. Providing null location for childLoc is allowed and if childLoc is null location, then the behavior is the same as having unknown child location.

source
MLIR.API.mlirLocationPrintMethod
mlirLocationPrint(location, callback, userData)

Prints a location by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirMemRefTypeContiguousGetMethod
mlirMemRefTypeContiguousGet(elementType, rank, shape, memorySpace)

Creates a MemRef type with the given rank, shape, memory space and element type in the same context as the element type. The type has no affine maps, i.e. represents a default row-major contiguous memref. The type is owned by the context.

source
MLIR.API.mlirMemRefTypeGetMethod
mlirMemRefTypeGet(elementType, rank, shape, layout, memorySpace)

Creates a MemRef type with the given rank and shape, a potentially empty list of affine layout maps, the given memory space and element type, in the same context as element type. The type is owned by the context.

source
MLIR.API.mlirOpPassManagerAddOwnedPassMethod
mlirOpPassManagerAddOwnedPass(passManager, pass)

Add a pass and transfer ownership to the provided mlirOpPassManager. If the pass is not a generic operation pass or matching the type of the provided PassManager, a new OpPassManager is implicitly nested under the provided PassManager.

source
MLIR.API.mlirOpPassManagerGetNestedUnderMethod
mlirOpPassManagerGetNestedUnder(passManager, operationName)

Nest an OpPassManager under the provided OpPassManager, the nested passmanager will only run on operations matching the provided name. The returned OpPassManager will be destroyed when the parent is destroyed.

source
MLIR.API.mlirOpPrintingFlagsElideLargeElementsAttrsMethod
mlirOpPrintingFlagsElideLargeElementsAttrs(flags, largeElementLimit)

Enables the elision of large elements attributes by printing a lexically valid but otherwise meaningless form instead of the element data. The largeElementLimit is used to configure what is considered to be a "large" ElementsAttr by providing an upper limit to the number of elements.

source
MLIR.API.mlirOpPrintingFlagsEnableDebugInfoMethod
mlirOpPrintingFlagsEnableDebugInfo(flags, prettyForm)

Enable printing of debug information. If 'prettyForm' is set to true, debug information is printed in a more readable 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable.

source
MLIR.API.mlirOpPrintingFlagsUseLocalScopeMethod
mlirOpPrintingFlagsUseLocalScope(flags)

Use local scope when printing the operation. This allows for using the printer in a more localized and thread-safe setting, but may not necessarily be identical to what the IR will look like when dumping the full module.

source
MLIR.API.mlirOpResultGetOwnerMethod
mlirOpResultGetOwner(value)

Returns an operation that produced this value as its result. Asserts if the value is not an op result.

source
MLIR.API.mlirOpaqueAttrGetMethod
mlirOpaqueAttrGet(ctx, dialectNamespace, dataLength, data, 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).

source
MLIR.API.mlirOpaqueAttrGetDataMethod
mlirOpaqueAttrGetData(attr)

Returns the raw data as a string reference. The data remains live as long as the context in which the attribute lives.

source
MLIR.API.mlirOpaqueTypeGetMethod
mlirOpaqueTypeGet(ctx, dialectNamespace, typeData)

Creates an opaque type in the given context associated with the dialect identified by its namespace. The type contains opaque byte data of the specified length (data need not be null-terminated).

source
MLIR.API.mlirOpaqueTypeGetDataMethod
mlirOpaqueTypeGetData(type)

Returns the raw data as a string reference. The data remains live as long as the context in which the type lives.

source
MLIR.API.mlirOperationCloneMethod
mlirOperationClone(op)

Creates a deep copy of an operation. The operation is not inserted and ownership is transferred to the caller.

source
MLIR.API.mlirOperationCreateMethod
mlirOperationCreate(state)

Creates an operation and transfers ownership to the caller. Note that caller owned child objects are transferred in this call and must not be further used. Particularly, this applies to any regions added to the state (the implementation may invalidate any such pointers).

This call can fail under the following conditions, in which case, it will return a null operation and emit diagnostics: - Result type inference is enabled and cannot be performed.

source
MLIR.API.mlirOperationEqualMethod
mlirOperationEqual(op, other)

Checks whether two operation handles point to the same operation. This does not perform deep comparison.

source
MLIR.API.mlirOperationGetTypeIDMethod
mlirOperationGetTypeID(op)

Gets the type id of the operation. Returns null if the operation does not have a registered operation description.

source
MLIR.API.mlirOperationImplementsInterfaceStaticMethod
mlirOperationImplementsInterfaceStatic(operationName, context, interfaceTypeID)

Returns true if the operation identified by its canonical string name implements the interface identified by its TypeID in the given context. Note that interfaces may be attached to operations in some contexts and not others.

source
MLIR.API.mlirOperationMoveAfterMethod
mlirOperationMoveAfter(op, other)

Moves the given operation immediately after the other operation in its parent block. The given operation may be owned by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

source
MLIR.API.mlirOperationMoveBeforeMethod
mlirOperationMoveBefore(op, other)

Moves the given operation immediately before the other operation in its parent block. The given operation may be owner by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

source
MLIR.API.mlirOperationPrintMethod
mlirOperationPrint(op, callback, userData)

Prints an operation by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirOperationRemoveFromParentMethod
mlirOperationRemoveFromParent(op)

Removes the given operation from its parent block. The operation is not destroyed. The ownership of the operation is transferred to the caller.

source
MLIR.API.mlirPassManagerAddOwnedPassMethod
mlirPassManagerAddOwnedPass(passManager, pass)

Add a pass and transfer ownership to the provided top-level mlirPassManager. If the pass is not a generic operation pass or a ModulePass, a new OpPassManager is implicitly nested under the provided PassManager.

source
MLIR.API.mlirPassManagerGetNestedUnderMethod
mlirPassManagerGetNestedUnder(passManager, operationName)

Nest an OpPassManager under the top-level PassManager, the nested passmanager will only run on operations matching the provided name. The returned OpPassManager will be destroyed when the parent is destroyed. To further nest more OpPassManager under the newly returned one, see mlirOpPassManagerNest below.

source
MLIR.API.mlirPrintPassPipelineMethod
mlirPrintPassPipeline(passManager, callback, userData)

Print a textual MLIR pass pipeline by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirQuantizedTypeCastFromExpressedTypeMethod
mlirQuantizedTypeCastFromExpressedType(type, candidate)

Casts from a type based on the expressed type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid.

source
MLIR.API.mlirQuantizedTypeCastFromStorageTypeMethod
mlirQuantizedTypeCastFromStorageType(type, candidate)

Casts from a type based on the storage type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid.

source
MLIR.API.mlirRankedTensorTypeGetMethod
mlirRankedTensorTypeGet(rank, shape, elementType, encoding)

Creates a tensor type of a fixed rank with the given shape, element type, and optional encoding in the same context as the element type. The type is owned by the context. Tensor types without any specific encoding field should assign mlirAttributeGetNull() to this parameter.

source
MLIR.API.mlirRegionEqualMethod
mlirRegionEqual(region, other)

Checks whether two region handles point to the same region. This does not perform deep comparison.

source
MLIR.API.mlirRegionInsertOwnedBlockMethod
mlirRegionInsertOwnedBlock(region, pos, block)

Takes a block owned by the caller and inserts it at pos to the given region. This is an expensive operation that linearly scans the region, prefer insertAfter/Before instead.

source
MLIR.API.mlirRegionInsertOwnedBlockAfterMethod
mlirRegionInsertOwnedBlockAfter(region, reference, block)

Takes a block owned by the caller and inserts it after the (non-owned) reference block in the given region. The reference block must belong to the region. If the reference block is null, prepends the block to the region.

source
MLIR.API.mlirRegionInsertOwnedBlockBeforeMethod
mlirRegionInsertOwnedBlockBefore(region, reference, block)

Takes a block owned by the caller and inserts it before the (non-owned) reference block in the given region. The reference block must belong to the region. If the reference block is null, appends the block to the region.

source
MLIR.API.mlirSparseElementsAttributeMethod
mlirSparseElementsAttribute(shapedType, denseIndices, 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.

source
MLIR.API.mlirSparseTensorEncodingAttrGetMethod
mlirSparseTensorEncodingAttrGet(ctx, numDimLevelTypes, dimLevelTypes, dimOrdering, pointerBitWidth, indexBitWidth)

Creates a sparse_tensor.encoding attribute with the given parameters.

source
MLIR.API.mlirStringAttrGetValueMethod
mlirStringAttrGetValue(attr)

Returns the attribute values as a string reference. The data remains live as long as the context in which the attribute lives.

source
MLIR.API.mlirStringAttrTypedGetMethod
mlirStringAttrTypedGet(type, str)

Creates a string attribute in the given context containing the given string. Additionally, the attribute has the given type.

source
MLIR.API.mlirStringRefCreateMethod
mlirStringRefCreate(str, length)

Constructs a string reference from the pointer and length. The pointer need not reference to a null-terminated string.

source
MLIR.API.mlirSymbolRefAttrGetMethod
mlirSymbolRefAttrGet(ctx, symbol, numReferences, 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.

source
MLIR.API.mlirSymbolTableCreateMethod
mlirSymbolTableCreate(operation)

Creates a symbol table for the given operation. If the operation does not have the SymbolTable trait, returns a null symbol table.

source
MLIR.API.mlirSymbolTableInsertMethod
mlirSymbolTableInsert(symbolTable, operation)

Inserts the given operation into the given symbol table. The operation must have the symbol trait. If the symbol table already has a symbol with the same name, renames the symbol being inserted to ensure name uniqueness. Note that this does not move the operation itself into the block of the symbol table operation, this should be done separately. Returns the name of the symbol after insertion.

source
MLIR.API.mlirSymbolTableLookupMethod
mlirSymbolTableLookup(symbolTable, name)

Looks up a symbol with the given name in the given symbol table and returns the operation that corresponds to the symbol. If the symbol cannot be found, returns a null operation.

source
MLIR.API.mlirSymbolTableReplaceAllSymbolUsesMethod
mlirSymbolTableReplaceAllSymbolUses(oldSymbol, newSymbol, from)

Attempt to replace all uses that are nested within the given operation of the given symbol 'oldSymbol' with the provided 'newSymbol'. This does not traverse into nested symbol tables. Will fail atomically if there are any unknown operations that may be potential symbol tables.

source
MLIR.API.mlirSymbolTableWalkSymbolTablesMethod
mlirSymbolTableWalkSymbolTables(from, allSymUsesVisible, callback, userData)

Walks all symbol table operations nested within, and including, op. For each symbol table operation, the provided callback is invoked with the op and a boolean signifying if the symbols within that symbol table can be treated as if all uses within the IR are visible to the caller. allSymUsesVisible identifies whether all of the symbol uses of symbols within op are visible.

source
MLIR.API.mlirTupleTypeGetMethod
mlirTupleTypeGet(ctx, numElements, elements)

Creates a tuple type that consists of the given list of elemental types. The type is owned by the context.

source
MLIR.API.mlirTypeIDCreateMethod
mlirTypeIDCreate(ptr)

ptr must be 8 byte aligned and unique to a type valid for the duration of the returned type id's usage

source
MLIR.API.mlirTypePrintMethod
mlirTypePrint(type, callback, userData)

Prints a location by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirUniformQuantizedPerAxisTypeGetMethod
mlirUniformQuantizedPerAxisTypeGet(flags, storageType, expressedType, nDims, scales, zeroPoints, quantizedDimension, storageTypeMin, storageTypeMax)

Creates an instance of UniformQuantizedPerAxisType with the given parameters in the same context as storageType and returns it. scales and zeroPoints point to nDims number of elements. The instance is owned by the context.

source
MLIR.API.mlirUniformQuantizedTypeGetMethod
mlirUniformQuantizedTypeGet(flags, storageType, expressedType, scale, zeroPoint, storageTypeMin, storageTypeMax)

Creates an instance of UniformQuantizedType with the given parameters in the same context as storageType and returns it. The instance is owned by the context.

source
MLIR.API.mlirUnrankedMemRefTypeGetMethod
mlirUnrankedMemRefTypeGet(elementType, memorySpace)

Creates an Unranked MemRef type with the given element type and in the given memory space. The type is owned by the context of element type.

source
MLIR.API.mlirUnrankedTensorTypeGetMethod
mlirUnrankedTensorTypeGet(elementType)

Creates an unranked tensor type with the given element type in the same context as the element type. The type is owned by the context.

source
MLIR.API.mlirValuePrintMethod
mlirValuePrint(value, callback, userData)

Prints a value by sending chunks of the string representation and forwarding userData tocallback`. Note that the callback may be called several times with consecutive chunks of the string.

source
MLIR.API.mlirVectorTypeGetMethod
mlirVectorTypeGet(rank, shape, elementType)

Creates a vector type of the shape identified by its rank and dimensions, with the given element type in the same context as the element type. The type is owned by the context.

source
diff --git a/previews/PR62/index.html b/previews/PR62/index.html index ac9195ed..0f74f2d6 100644 --- a/previews/PR62/index.html +++ b/previews/PR62/index.html @@ -1,2 +1,2 @@ -Home · MLIR.jl

MLIR.jl

Design

String and MlirStringRef.

MlirStringRef is a non-owning pointer, the caller is in charge of performing necessary copies or ensuring that the pointee outlives all uses of MlirStringRef. Since Julia is a GC'd language special care must be taken around the live-time of Julia objects such as Strings when interacting with foreign libraries.

For convenience and safty sake, users of the API should use Julia String or Symbol as the argument to the C-ABI of MLIR instead of directly using MlirStringRef. We translate (cheaply) between Julia String and MlirStringRef.

+Home · MLIR.jl

MLIR.jl

Design

String and MlirStringRef.

MlirStringRef is a non-owning pointer, the caller is in charge of performing necessary copies or ensuring that the pointee outlives all uses of MlirStringRef. Since Julia is a GC'd language special care must be taken around the live-time of Julia objects such as Strings when interacting with foreign libraries.

For convenience and safty sake, users of the API should use Julia String or Symbol as the argument to the C-ABI of MLIR instead of directly using MlirStringRef. We translate (cheaply) between Julia String and MlirStringRef.

diff --git a/previews/PR62/search/index.html b/previews/PR62/search/index.html index 700cd5e3..76696e2b 100644 --- a/previews/PR62/search/index.html +++ b/previews/PR62/search/index.html @@ -1,2 +1,2 @@ -Search · MLIR.jl

Loading search...

    +Search · MLIR.jl

    Loading search...