diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 29222cbe3..ff4ce2b53 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-04T21:51:37","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-08-05T18:19:16","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index 1baac3a55..f78e19cbb 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,13 +1,13 @@ -API reference · Reactant.jl

API reference

Types and constants

Functions and macros

Documentation

Reactant.MLIR.API.LLVMModuleProviderRefType

Interface used to provide a module to JIT or interpreter. This is now just a synonym for llvm::Module, but we have to keep using the different type to keep binary compatibility.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.MlirShapedTypeComponentsCallbackType

These callbacks are used to return multiple shaped type components from functions while transferring ownership to the caller. The first argument is the has rank boolean followed by the the rank and a pointer to the shape (if applicable). The next argument is the element type, then the attribute. The last argument is an opaque pointer forwarded to the callback by the caller. This callback will be called potentially multiple times for each shaped type components.

source
Reactant.MLIR.API.MlirSparseTensorLevelTypeType

Dimension level types (and properties) that define sparse tensors. See the documentation in SparseTensorAttrDefs.td for their meaning.

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

source
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.LLVMAddSymbolMethod
LLVMAddSymbol(symbolName, symbolValue)

This functions permanently adds the symbol symbolName with the value symbolValue. These symbols are searched before any libraries.

See also

sys::DynamicLibrary::AddSymbol()

source
Reactant.MLIR.API.LLVMLoadLibraryPermanentlyMethod
LLVMLoadLibraryPermanently(Filename)

This function permanently loads the dynamic library at the given path. It is safe to call this function multiple times for the same library.

See also

sys::DynamicLibrary::LoadLibraryPermanently()

source
Reactant.MLIR.API.LLVMParseCommandLineOptionsMethod
LLVMParseCommandLineOptions(argc, argv, Overview)

This function parses the given arguments using the LLVM command line parser. Note that the only stable thing about this function is its signature; you cannot rely on any particular set of command line arguments being interpreted the same way across LLVM versions.

See also

llvm::cl::ParseCommandLineOptions()

source
Reactant.MLIR.API.LLVMSearchForAddressOfSymbolMethod
LLVMSearchForAddressOfSymbol(symbolName)

This function will search through all previously loaded dynamic libraries for the symbol symbolName. If it is found, the address of that symbol is returned. If not, null is returned.

See also

sys::DynamicLibrary::SearchForAddressOfSymbol()

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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 permutation.) The affine map is owned by the context.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirContextSetThreadPoolMethod
mlirContextSetThreadPool(context, threadPool)

Sets the thread pool of the context explicitly, enabling multithreading in the process. This API should be used to avoid re-creating thread pools in long-running applications that perform multiple compilations, see the C++ documentation for MLIRContext for details.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirExecutionEngineCreateMethod
mlirExecutionEngineCreate(op, optLevel, numPaths, sharedLibPaths, enableObjectDump)

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
Reactant.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
Reactant.MLIR.API.mlirInferShapedTypeOpInterfaceInferReturnTypesMethod
mlirInferShapedTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, nRegions, regions, callback, userData)

Infers the return shaped type components of the operation. Calls callback with the types of inferred arguments on success. Returns failure otherwise.

source
Reactant.MLIR.API.mlirInferTypeOpInterfaceInferReturnTypesMethod
mlirInferTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, 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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirLLVMStructTypeIdentifiedNewGetMethod
mlirLLVMStructTypeIdentifiedNewGet(ctx, name, nFieldTypes, fieldTypes, isPacked)

Creates an LLVM identified struct type with no body and a name starting with the given prefix. If a struct with the exact name as the given prefix already exists, appends an unspecified suffix to the name so that the name is unique in context.

source
Reactant.MLIR.API.mlirLLVMStructTypeLiteralGetMethod
mlirLLVMStructTypeLiteralGet(ctx, nFieldTypes, fieldTypes, isPacked)

Creates an LLVM literal (unnamed) struct type. This may assert if the fields have types not compatible with the LLVM dialect. For a graceful failure, use the checked version.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirMemRefTypeGetStridesAndOffsetMethod
mlirMemRefTypeGetStridesAndOffset(type, strides, offset)

Returns the strides of the MemRef if the layout map is in strided form. Both strides and offset are out params. strides must point to pre-allocated memory of length equal to the rank of the memref.

source
Reactant.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
Reactant.MLIR.API.mlirOpPassManagerAddPipelineMethod
mlirOpPassManagerAddPipeline(passManager, pipelineElements, callback, userData)

Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOpPrintingFlagsEnableDebugInfoMethod
mlirOpPrintingFlagsEnableDebugInfo(flags, enable, prettyForm)

Enable or disable printing of debug information (based on enable). 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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOperationCreateParseMethod
mlirOperationCreateParse(context, sourceStr, sourceName)

Parses an operation, giving ownership to the caller. If parsing fails a null operation will be returned, and an error diagnostic emitted.

sourceStr may be either the text assembly format, or binary bytecode format. sourceName is used as the file name of the source; any IR without locations will get a FileLineColLoc location with sourceName as the file name.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOperationWalkMethod
mlirOperationWalk(op, callback, userData, walkOrder)

Walks operation op in walkOrder and calls callback on that operation. *userData is passed to the callback as well and can be used to tunnel some context or other data into the callback.

source
Reactant.MLIR.API.mlirParsePassPipelineMethod
mlirParsePassPipeline(passManager, pipeline, callback, userData)

Parse a textual MLIR pass pipeline and assign it to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirTransformApplyNamedSequenceMethod
mlirTransformApplyNamedSequence(payload, transformRoot, transformModule, transformOptions)

Applies the transformation script starting at the given transform root operation to the given payload operation. The module containing the transform root as well as the transform options should be provided. The transform operation must implement TransformOpInterface and the module must be a ModuleOp. Returns the status of the application.

source
Reactant.MLIR.API.mlirTranslateModuleToLLVMIRMethod
mlirTranslateModuleToLLVMIR(_module, context)

Translate operation that satisfies LLVM dialect module requirements into an LLVM IR module living in the given context. This translates operations from any dilalect that has a registered implementation of LLVMTranslationDialectInterface.

Returns

the generated LLVM IR Module from the translated MLIR module, it is owned by the caller.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirUnmanagedDenseResourceElementsAttrGetMethod
mlirUnmanagedDenseResourceElementsAttrGet(shapedType, name, data, dataLength, dataAlignment, dataIsMutable, deleter, userData)

Unlike the typed accessors below, constructs the attribute with a raw data buffer and no type/alignment checking. Use a more strongly typed accessor if possible. If dataIsMutable is false, then an immutable AsmResourceBlob will be created and that passed data contents will be treated as const. If the deleter is non NULL, then it will be called when the data buffer can no longer be accessed (passing userData to it).

source
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirValueReplaceAllUsesOfWithMethod
mlirValueReplaceAllUsesOfWith(of, with)

Replace all uses of 'of' value with the 'with' value, updating anything in the IR that uses 'of' to use the other value instead. When this returns there are zero uses of 'of'.

source
Reactant.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
Reactant.MLIR.API.mlirVectorTypeGetScalableMethod
mlirVectorTypeGetScalable(rank, shape, scalable, elementType)

Creates a scalable vector type with the shape identified by its rank and dimensions. A subset of dimensions may be marked as scalable via the corresponding flag list, which is expected to have as many entries as the rank of the vector. The vector is created in the same context as the element type.

source
Core.BoolMethod
Bool(attr)

Returns the value stored in the given bool attribute.

source
Core.Float64Method
Float64(attr)

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

source
Core.Int64Method
Int64(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
Core.StringMethod
String(attr)

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

source
Core.UInt64Method
UInt64(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
Reactant.MLIR.IR.AffineMapMethod
AffineMap(ndims, nsymbols, affineExprs; context=context())

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
Reactant.MLIR.IR.AffineMapMethod
AffineMap(ndims, nsymbols; context=context())

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

source
Reactant.MLIR.IR.AffineMapMethod
AffineMap(; context=context())

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(elements; context=context())

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(affineMap)

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(type, str)

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(float; context=context(), location=Location(), check=false)

Creates a floating point attribute in the given context with the given double value and double-precision FP semantics. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.AttributeMethod
Attribute(elements; context=context())

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

source
Reactant.MLIR.IR.BlockMethod
Block(args, locs)

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

source
Reactant.MLIR.IR.ExecutionEngineType
ExecutionEngine(op, optLevel, sharedlibs = [])

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
Reactant.MLIR.IR.IntegerSetMethod
IntegerSet(ndims, nsymbols, constraints, eqflags; context=context())

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 need to be arrays of the same length.

source
Reactant.MLIR.IR.IntegerSetMethod
Integerset(ndims, nsymbols; context=context())

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

source
Reactant.MLIR.IR.LogicalResultType
LogicalResult

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 LogicalResult must only be inspected using the associated functions.

source
Reactant.MLIR.IR.OpPassManagerMethod
OpPassManager(opPassManager, 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
Reactant.MLIR.IR.OpPassManagerMethod
OpPassManager(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
Reactant.MLIR.IR.SymbolTableMethod
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
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Integer}; context=context()

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

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Signed}; context=context()

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

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Unsigned}; context=context()

Creates an unsigned integer type of the given bitwidth in the context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{Bool}; context=context()

Creates a 1-bit signless integer type in the context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(::Core.Type{Float16}; context=context())

Creates an f16 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(Core.Type{Float32}; context=context())

Creates an f32 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(Core.Type{Float64}; context=context())

Creates a f64 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(::Core.Type{Nothing}; context=context())

Creates a None type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(elements; context=context())
-Type(::Core.Type{<:Tuple{T...}}; context=context())

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

source
Reactant.MLIR.IR.TypeMethod
Type(Complex{T}) where {T}

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
Reactant.MLIR.IR.@affinemapMacro
@affinemap (d1, d2, d3, ...)[s1, s2, ...] -> (d0 + d1, ...)

Returns an affine map from the provided Julia expression. On the right hand side are allowed the following function calls:

  • +, *, ÷, %, fld, cld

The rhs can only contains dimensions and symbols present on the left hand side or integer literals.

julia> using MLIR: IR, AffineUtils
+API reference · Reactant.jl

API reference

Types and constants

Functions and macros

Documentation

Reactant.MLIR.API.LLVMModuleProviderRefType

Interface used to provide a module to JIT or interpreter. This is now just a synonym for llvm::Module, but we have to keep using the different type to keep binary compatibility.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.MlirShapedTypeComponentsCallbackType

These callbacks are used to return multiple shaped type components from functions while transferring ownership to the caller. The first argument is the has rank boolean followed by the the rank and a pointer to the shape (if applicable). The next argument is the element type, then the attribute. The last argument is an opaque pointer forwarded to the callback by the caller. This callback will be called potentially multiple times for each shaped type components.

source
Reactant.MLIR.API.MlirSparseTensorLevelTypeType

Dimension level types (and properties) that define sparse tensors. See the documentation in SparseTensorAttrDefs.td for their meaning.

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

source
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.LLVMAddSymbolMethod
LLVMAddSymbol(symbolName, symbolValue)

This functions permanently adds the symbol symbolName with the value symbolValue. These symbols are searched before any libraries.

See also

sys::DynamicLibrary::AddSymbol()

source
Reactant.MLIR.API.LLVMLoadLibraryPermanentlyMethod
LLVMLoadLibraryPermanently(Filename)

This function permanently loads the dynamic library at the given path. It is safe to call this function multiple times for the same library.

See also

sys::DynamicLibrary::LoadLibraryPermanently()

source
Reactant.MLIR.API.LLVMParseCommandLineOptionsMethod
LLVMParseCommandLineOptions(argc, argv, Overview)

This function parses the given arguments using the LLVM command line parser. Note that the only stable thing about this function is its signature; you cannot rely on any particular set of command line arguments being interpreted the same way across LLVM versions.

See also

llvm::cl::ParseCommandLineOptions()

source
Reactant.MLIR.API.LLVMSearchForAddressOfSymbolMethod
LLVMSearchForAddressOfSymbol(symbolName)

This function will search through all previously loaded dynamic libraries for the symbol symbolName. If it is found, the address of that symbol is returned. If not, null is returned.

See also

sys::DynamicLibrary::SearchForAddressOfSymbol()

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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 permutation.) The affine map is owned by the context.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirContextSetThreadPoolMethod
mlirContextSetThreadPool(context, threadPool)

Sets the thread pool of the context explicitly, enabling multithreading in the process. This API should be used to avoid re-creating thread pools in long-running applications that perform multiple compilations, see the C++ documentation for MLIRContext for details.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirExecutionEngineCreateMethod
mlirExecutionEngineCreate(op, optLevel, numPaths, sharedLibPaths, enableObjectDump)

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
Reactant.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
Reactant.MLIR.API.mlirInferShapedTypeOpInterfaceInferReturnTypesMethod
mlirInferShapedTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, nRegions, regions, callback, userData)

Infers the return shaped type components of the operation. Calls callback with the types of inferred arguments on success. Returns failure otherwise.

source
Reactant.MLIR.API.mlirInferTypeOpInterfaceInferReturnTypesMethod
mlirInferTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, 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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirLLVMStructTypeIdentifiedNewGetMethod
mlirLLVMStructTypeIdentifiedNewGet(ctx, name, nFieldTypes, fieldTypes, isPacked)

Creates an LLVM identified struct type with no body and a name starting with the given prefix. If a struct with the exact name as the given prefix already exists, appends an unspecified suffix to the name so that the name is unique in context.

source
Reactant.MLIR.API.mlirLLVMStructTypeLiteralGetMethod
mlirLLVMStructTypeLiteralGet(ctx, nFieldTypes, fieldTypes, isPacked)

Creates an LLVM literal (unnamed) struct type. This may assert if the fields have types not compatible with the LLVM dialect. For a graceful failure, use the checked version.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirMemRefTypeGetStridesAndOffsetMethod
mlirMemRefTypeGetStridesAndOffset(type, strides, offset)

Returns the strides of the MemRef if the layout map is in strided form. Both strides and offset are out params. strides must point to pre-allocated memory of length equal to the rank of the memref.

source
Reactant.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
Reactant.MLIR.API.mlirOpPassManagerAddPipelineMethod
mlirOpPassManagerAddPipeline(passManager, pipelineElements, callback, userData)

Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOpPrintingFlagsEnableDebugInfoMethod
mlirOpPrintingFlagsEnableDebugInfo(flags, enable, prettyForm)

Enable or disable printing of debug information (based on enable). 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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOperationCreateParseMethod
mlirOperationCreateParse(context, sourceStr, sourceName)

Parses an operation, giving ownership to the caller. If parsing fails a null operation will be returned, and an error diagnostic emitted.

sourceStr may be either the text assembly format, or binary bytecode format. sourceName is used as the file name of the source; any IR without locations will get a FileLineColLoc location with sourceName as the file name.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirOperationWalkMethod
mlirOperationWalk(op, callback, userData, walkOrder)

Walks operation op in walkOrder and calls callback on that operation. *userData is passed to the callback as well and can be used to tunnel some context or other data into the callback.

source
Reactant.MLIR.API.mlirParsePassPipelineMethod
mlirParsePassPipeline(passManager, pipeline, callback, userData)

Parse a textual MLIR pass pipeline and assign it to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirTransformApplyNamedSequenceMethod
mlirTransformApplyNamedSequence(payload, transformRoot, transformModule, transformOptions)

Applies the transformation script starting at the given transform root operation to the given payload operation. The module containing the transform root as well as the transform options should be provided. The transform operation must implement TransformOpInterface and the module must be a ModuleOp. Returns the status of the application.

source
Reactant.MLIR.API.mlirTranslateModuleToLLVMIRMethod
mlirTranslateModuleToLLVMIR(_module, context)

Translate operation that satisfies LLVM dialect module requirements into an LLVM IR module living in the given context. This translates operations from any dilalect that has a registered implementation of LLVMTranslationDialectInterface.

Returns

the generated LLVM IR Module from the translated MLIR module, it is owned by the caller.

source
Reactant.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
Reactant.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
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirUnmanagedDenseResourceElementsAttrGetMethod
mlirUnmanagedDenseResourceElementsAttrGet(shapedType, name, data, dataLength, dataAlignment, dataIsMutable, deleter, userData)

Unlike the typed accessors below, constructs the attribute with a raw data buffer and no type/alignment checking. Use a more strongly typed accessor if possible. If dataIsMutable is false, then an immutable AsmResourceBlob will be created and that passed data contents will be treated as const. If the deleter is non NULL, then it will be called when the data buffer can no longer be accessed (passing userData to it).

source
Reactant.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
Reactant.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
Reactant.MLIR.API.mlirValueReplaceAllUsesOfWithMethod
mlirValueReplaceAllUsesOfWith(of, with)

Replace all uses of 'of' value with the 'with' value, updating anything in the IR that uses 'of' to use the other value instead. When this returns there are zero uses of 'of'.

source
Reactant.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
Reactant.MLIR.API.mlirVectorTypeGetScalableMethod
mlirVectorTypeGetScalable(rank, shape, scalable, elementType)

Creates a scalable vector type with the shape identified by its rank and dimensions. A subset of dimensions may be marked as scalable via the corresponding flag list, which is expected to have as many entries as the rank of the vector. The vector is created in the same context as the element type.

source
Core.BoolMethod
Bool(attr)

Returns the value stored in the given bool attribute.

source
Core.Float64Method
Float64(attr)

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

source
Core.Int64Method
Int64(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
Core.StringMethod
String(attr)

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

source
Core.UInt64Method
UInt64(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
Reactant.MLIR.IR.AffineMapMethod
AffineMap(ndims, nsymbols, affineExprs; context=context())

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
Reactant.MLIR.IR.AffineMapMethod
AffineMap(ndims, nsymbols; context=context())

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

source
Reactant.MLIR.IR.AffineMapMethod
AffineMap(; context=context())

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(elements; context=context())

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(affineMap)

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(type, str)

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

source
Reactant.MLIR.IR.AttributeMethod
Attribute(float; context=context(), location=Location(), check=false)

Creates a floating point attribute in the given context with the given double value and double-precision FP semantics. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.AttributeMethod
Attribute(elements; context=context())

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

source
Reactant.MLIR.IR.BlockMethod
Block(args, locs)

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

source
Reactant.MLIR.IR.ExecutionEngineType
ExecutionEngine(op, optLevel, sharedlibs = [])

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
Reactant.MLIR.IR.IntegerSetMethod
IntegerSet(ndims, nsymbols, constraints, eqflags; context=context())

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 need to be arrays of the same length.

source
Reactant.MLIR.IR.IntegerSetMethod
Integerset(ndims, nsymbols; context=context())

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

source
Reactant.MLIR.IR.LogicalResultType
LogicalResult

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 LogicalResult must only be inspected using the associated functions.

source
Reactant.MLIR.IR.OpPassManagerMethod
OpPassManager(opPassManager, 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
Reactant.MLIR.IR.OpPassManagerMethod
OpPassManager(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
Reactant.MLIR.IR.SymbolTableMethod
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
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Integer}; context=context()

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

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Signed}; context=context()

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

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{<:Unsigned}; context=context()

Creates an unsigned integer type of the given bitwidth in the context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(T::Core.Type{Bool}; context=context()

Creates a 1-bit signless integer type in the context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(::Core.Type{Float16}; context=context())

Creates an f16 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(Core.Type{Float32}; context=context())

Creates an f32 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(Core.Type{Float64}; context=context())

Creates a f64 type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(::Core.Type{Nothing}; context=context())

Creates a None type in the given context. The type is owned by the context.

source
Reactant.MLIR.IR.TypeMethod
Type(elements; context=context())
+Type(::Core.Type{<:Tuple{T...}}; context=context())

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

source
Reactant.MLIR.IR.TypeMethod
Type(Complex{T}) where {T}

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
Reactant.MLIR.IR.@affinemapMacro
@affinemap (d1, d2, d3, ...)[s1, s2, ...] -> (d0 + d1, ...)

Returns an affine map from the provided Julia expression. On the right hand side are allowed the following function calls:

  • +, *, ÷, %, fld, cld

The rhs can only contains dimensions and symbols present on the left hand side or integer literals.

julia> using MLIR: IR, AffineUtils
 
 julia> IR.context!(IR.Context()) do
            IR.@affinemap (d1, d2)[s0] -> (d1 + s0, d2 % 10)
        end
-MLIR.IR.AffineMap(#= (d0, d1)[s0] -> (d0 + s0, d1 mod 10) =#)
source
Base.:*Method
*(lhs, rhs)

Creates an affine mul expression with 'lhs' and 'rhs'.

source
Base.:+Method
+(lhs, rhs)

Creates an affine add expression with 'lhs' and 'rhs'.

source
Base.:==Method
==(a, b)

Returns true if the two affine expressions are equal.

source
Base.:==Method
==(a1, a2)

Checks if two attributes are equal.

source
Base.:==Method
==(block, other)

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

source
Base.:==Method
==(ident, other)

Checks whether two identifiers are the same.

source
Base.:==Method
==(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
Base.:==Method
==(region, other)

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

source
Base.:==Method
==(typeID1, typeID2)

Checks if two type ids are equal.

source
Base.:==Method
==(value1, value2)

Returns 1 if two values are equal, 0 otherwise.

source
Base.cldMethod
cld(lhs, rhs)

Creates an affine ceildiv expression with 'lhs' and 'rhs'.

source
Base.copyMethod
copy(op)

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

source
Base.divMethod
div(lhs, rhs)
+MLIR.IR.AffineMap(#= (d0, d1)[s0] -> (d0 + s0, d1 mod 10) =#)
source
Base.:*Method
*(lhs, rhs)

Creates an affine mul expression with 'lhs' and 'rhs'.

source
Base.:+Method
+(lhs, rhs)

Creates an affine add expression with 'lhs' and 'rhs'.

source
Base.:==Method
==(a, b)

Returns true if the two affine expressions are equal.

source
Base.:==Method
==(a1, a2)

Checks if two attributes are equal.

source
Base.:==Method
==(block, other)

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

source
Base.:==Method
==(ident, other)

Checks whether two identifiers are the same.

source
Base.:==Method
==(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
Base.:==Method
==(region, other)

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

source
Base.:==Method
==(typeID1, typeID2)

Checks if two type ids are equal.

source
Base.:==Method
==(value1, value2)

Returns 1 if two values are equal, 0 otherwise.

source
Base.cldMethod
cld(lhs, rhs)

Creates an affine ceildiv expression with 'lhs' and 'rhs'.

source
Base.copyMethod
copy(op)

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

source
Base.divMethod
div(lhs, rhs)
 ÷(lhs, rhs)
-fld(lhs, rhs)

Creates an affine floordiv expression with 'lhs' and 'rhs'.

source
Base.fillMethod
fill(attr, shapedType)

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

source
Base.gcdMethod
gcd(affineExpr)

Returns the greatest known integral divisor of this affine expression. The result is always positive.

source
Base.hashMethod
hash(typeID)

Returns the hash value of the type id.

source
Base.insert!Method
insert!(block, index, operation)

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

source
Base.insert!Method
insert!(region, index, block)

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

source
Base.isemptyMethod
isempty(affineMap)

Checks whether the given affine map is an empty affine map.

source
Base.ispermMethod
isperm(affineMap)

Checks whether the given affine map represents a symbol-less permutation map.

source
Base.modMethod
mod(lhs, rhs)

Creates an affine mod expression with 'lhs' and 'rhs'.

source
Base.ndimsMethod
ndims(affineMap)

Returns the number of dimensions of the given affine map.

source
Base.ndimsMethod
ndims(set)

Returns the number of dimensions in the given set.

source
Base.ndimsMethod
ndims(type)

Returns the rank of the given ranked shaped type.

source
Base.parseMethod
parse(passManager, pipeline)

Parse a textual MLIR pass pipeline and add it to the provided OpPassManager.

source
Base.parseMethod
parse(::Core.Type{Attribute}, str; context=context())

Parses an attribute. The attribute is owned by the context.

source
Base.parseMethod
parse(::Type{Module}, module; context=context())

Parses a module from the string and transfers ownership to the caller.

source
Base.parseMethod
parse(type; context=context())

Parses a type. The type is owned by the context.

source
Base.push!Method
push!(block, operation)

Takes an operation owned by the caller and appends it to the block.

source
Base.push!Method
push!(region, block)

Takes a block owned by the caller and appends it to the given region.

source
Base.push!Method
push!(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
Base.replaceMethod
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
Base.replaceMethod
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
Base.reshapeMethod
Base.reshape(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
Base.sizeMethod
size(type, i)

Returns the i-th dimension of the given ranked shaped type.

source
Reactant.MLIR.IR.DenseElementsAttributeMethod
DenseElementsAttribute(array::AbstractArray)

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
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(elementType, rank, shape, layout, memorySpace; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(elementType, rank, shape, memorySpace; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MinorIdentityAffineMapMethod
MinorIdentityAffineMap(ndims, nresults; context=context())

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
Reactant.MLIR.IR.OpaqueAttributeMethod
OpaqueAttribute(dialectNamespace, dataLength, data, type; context=context())

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
Reactant.MLIR.IR.OpaqueTypeMethod
OpaqueType(dialectNamespace, typeData; context=context())

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
Reactant.MLIR.IR.PermutationAffineMapMethod
PermutationAffineMap(permutation; context=context())

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
Reactant.MLIR.IR.SymbolRefAttributeMethod
SymbolRefAttribute(symbol, references; context=context())

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
Reactant.MLIR.IR.TensorTypeFunction
TensorType(shape, elementType, encoding=Attribute(); location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.TensorTypeMethod
TensorType(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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.VectorTypeMethod
VectorType(rank, shape, elementType; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.add_owned_pass!Method
add_owned_pass!(opPassManager, pass)

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

source
Reactant.MLIR.IR.add_owned_pass!Method
add_owned_pass!(passManager, pass)

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

source
Reactant.MLIR.IR.add_pipeline!Method
add_pipeline!(passManager, pipelineElements, callback, userData)

Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.MLIR.IR.attr!Method
attr!(op, name, attr)

Sets an attribute by name, replacing the existing if it exists or adding a new one otherwise.

source
Reactant.MLIR.IR.block_ownerMethod
block_owner(value)

Returns the block in which this value is defined as an argument. Asserts if the value is not a block argument.

source
Reactant.MLIR.IR.dataMethod
data(attr)

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

source
Reactant.MLIR.IR.dataMethod
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
Reactant.MLIR.IR.flatsymbolMethod
flatsymbol(attr)

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

source
Reactant.MLIR.IR.insert_after!Method
insert_after!(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
Reactant.MLIR.IR.insert_after!Method
insert_after!(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
Reactant.MLIR.IR.insert_before!Method
insert_before!(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
Reactant.MLIR.IR.insert_before!Method
insert_before!(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
Reactant.MLIR.IR.is_pure_affineMethod
is_pure_affine(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
Reactant.MLIR.IR.is_registeredMethod
is_registered(name; context=context())

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
Reactant.MLIR.IR.isidentityMethod
isidentity(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
Reactant.MLIR.IR.leafrefMethod
leafref(attr)

Returns the string reference to the leaf referenced symbol. The data remains live as long as the context in which the attribute lives.

source
Reactant.MLIR.IR.lhsMethod
lhs(affineExpr)

Returns the left hand side affine expression of the given affine binary operation expression.

source
Reactant.MLIR.IR.lookupMethod
lookup(jit, name)

Lookup a native function in the execution engine by name, returns nullptr if the name can't be looked-up.

source
Reactant.MLIR.IR.lookupMethod
lookup(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
Reactant.MLIR.IR.majorsubmapMethod
majorsubmap(affineMap, nresults)

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

source
Reactant.MLIR.IR.minorsubmapMethod
minorsubmap(affineMap, nresults)

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

source
Reactant.MLIR.IR.move_after!Method
move_after!(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
Reactant.MLIR.IR.move_before!Method
move_before!(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
Reactant.MLIR.IR.namespaceMethod
mlirOpaqueAttrGetDialectNamespace(attr)

Returns the namespace of the dialect with which the given opaque attribute is associated. The namespace string is owned by the context.

source
Reactant.MLIR.IR.namespaceMethod
mlirOpaqueTypeGetDialectNamespace(type)

Returns the namespace of the dialect with which the given opaque type is associated. The namespace string is owned by the context.

source
Reactant.MLIR.IR.nextMethod
next(block)

Returns the block immediately following the given block in its parent region or nothing if last.

source
Reactant.MLIR.IR.nextMethod
next(opOperand)

Returns an op operand representing the next use of the value, or nothing if there is no next use.

source
Reactant.MLIR.IR.op_ownerMethod
op_owner(value)

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

source
Reactant.MLIR.IR.positionMethod
position(affineExpr)

Returns the position of the given affine dimension expression, affine symbol expression or ...

source
Reactant.MLIR.IR.push_argument!Method
push_argument!(block, type; location=Location())

Appends an argument of the specified type to the block. Returns the newly added argument.

source
Reactant.MLIR.IR.resultMethod
result(affineMap)

Returns the constant result of the given affine map. The function asserts that the map has a single constant result.

source
Reactant.MLIR.IR.rhsMethod
rhs(affineExpr)

Returns the right hand side affine expression of the given affine binary operation expression.

source
Reactant.MLIR.IR.rmattr!Method
rmattr!(op, name)

Removes an attribute by name. Returns false if the attribute was not found and true if removed.

source
Reactant.MLIR.IR.rmfromparent!Method
rmfromparent(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
Reactant.MLIR.IR.rootrefMethod
rootref(attr)

Returns the string reference to the root referenced symbol. The data remains live as long as the context in which the attribute lives.

source
Reactant.MLIR.IR.typeidMethod
typeid(op)

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

source
Reactant.MLIR.Dialects.chlo.broadcast_compareMethod

broadcast_compare

Compares lhs and rhs elementwise according to comparison_direction and compare_type. If unspecified, compare_type is FLOAT for float element types, SIGNED for signed element types and UNSIGNED for unsigned element types.

See https://www.tensorflow.org/xla/operationsemantics#element-wisecomparison_operations.

source
Reactant.MLIR.Dialects.chlo.next_afterMethod

next_after

Returns the next representable value of x in the direction of y, element-wise. It can also return a subnormal number.

Equivalent to the C++ std::nextafter function.

source
Reactant.MLIR.Dialects.chlo.top_kMethod

top_k

If the input is a vector (rank-1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j].

For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus,

values.shape = indices.shape = input.shape[:-1] + [k]

If two elements are equal, the lower-index element appears first.

source
Reactant.MLIR.Dialects.stablehlo.absMethod

abs

Performs element-wise abs operation on operand tensor and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#abs

Example

%result = stablehlo.abs %operand : tensor<3xi32>
source
Reactant.MLIR.Dialects.stablehlo.addMethod

add

Performs element-wise addition of two tensors lhs and rhs and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#add

Example

%result = stablehlo.add %lhs, %rhs : tensor<2x2xi32>
source
Reactant.MLIR.Dialects.stablehlo.after_allMethod

after_all

Ensures that the operations producing the inputs are executed before any operations that depend on result.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all

Example

%result = stablehlo.after_all %input0, %input1 : !stablehlo.token
source
Reactant.MLIR.Dialects.stablehlo.all_gatherMethod

all_gather

Within each process group in the process grid, concatenates the values of the operand tensor from each process along all_gather_dim and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_gather

Example

%result = "stablehlo.all_gather"(%operand) {
+fld(lhs, rhs)

Creates an affine floordiv expression with 'lhs' and 'rhs'.

source
Base.fillMethod
fill(attr, shapedType)

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

source
Base.gcdMethod
gcd(affineExpr)

Returns the greatest known integral divisor of this affine expression. The result is always positive.

source
Base.hashMethod
hash(typeID)

Returns the hash value of the type id.

source
Base.insert!Method
insert!(block, index, operation)

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

source
Base.insert!Method
insert!(region, index, block)

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

source
Base.isemptyMethod
isempty(affineMap)

Checks whether the given affine map is an empty affine map.

source
Base.ispermMethod
isperm(affineMap)

Checks whether the given affine map represents a symbol-less permutation map.

source
Base.modMethod
mod(lhs, rhs)

Creates an affine mod expression with 'lhs' and 'rhs'.

source
Base.ndimsMethod
ndims(affineMap)

Returns the number of dimensions of the given affine map.

source
Base.ndimsMethod
ndims(set)

Returns the number of dimensions in the given set.

source
Base.ndimsMethod
ndims(type)

Returns the rank of the given ranked shaped type.

source
Base.parseMethod
parse(passManager, pipeline)

Parse a textual MLIR pass pipeline and add it to the provided OpPassManager.

source
Base.parseMethod
parse(::Core.Type{Attribute}, str; context=context())

Parses an attribute. The attribute is owned by the context.

source
Base.parseMethod
parse(::Type{Module}, module; context=context())

Parses a module from the string and transfers ownership to the caller.

source
Base.parseMethod
parse(type; context=context())

Parses a type. The type is owned by the context.

source
Base.push!Method
push!(block, operation)

Takes an operation owned by the caller and appends it to the block.

source
Base.push!Method
push!(region, block)

Takes a block owned by the caller and appends it to the given region.

source
Base.push!Method
push!(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
Base.replaceMethod
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
Base.replaceMethod
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
Base.reshapeMethod
Base.reshape(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
Base.sizeMethod
size(type, i)

Returns the i-th dimension of the given ranked shaped type.

source
Reactant.MLIR.IR.DenseElementsAttributeMethod
DenseElementsAttribute(array::AbstractArray)

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
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(elementType, rank, shape, layout, memorySpace; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(elementType, rank, shape, memorySpace; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MemRefTypeMethod
MemRefType(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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.MinorIdentityAffineMapMethod
MinorIdentityAffineMap(ndims, nresults; context=context())

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
Reactant.MLIR.IR.OpaqueAttributeMethod
OpaqueAttribute(dialectNamespace, dataLength, data, type; context=context())

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
Reactant.MLIR.IR.OpaqueTypeMethod
OpaqueType(dialectNamespace, typeData; context=context())

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
Reactant.MLIR.IR.PermutationAffineMapMethod
PermutationAffineMap(permutation; context=context())

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
Reactant.MLIR.IR.SymbolRefAttributeMethod
SymbolRefAttribute(symbol, references; context=context())

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
Reactant.MLIR.IR.TensorTypeFunction
TensorType(shape, elementType, encoding=Attribute(); location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.TensorTypeMethod
TensorType(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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.VectorTypeMethod
VectorType(rank, shape, elementType; location=Location(), check=false)

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. If check=true, emits appropriate diagnostics on illegal arguments.

source
Reactant.MLIR.IR.add_owned_pass!Method
add_owned_pass!(opPassManager, pass)

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

source
Reactant.MLIR.IR.add_owned_pass!Method
add_owned_pass!(passManager, pass)

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

source
Reactant.MLIR.IR.add_pipeline!Method
add_pipeline!(passManager, pipelineElements, callback, userData)

Parse a sequence of textual MLIR pass pipeline elements and add them to the provided OpPassManager. If parsing fails an error message is reported using the provided callback.

source
Reactant.MLIR.IR.attr!Method
attr!(op, name, attr)

Sets an attribute by name, replacing the existing if it exists or adding a new one otherwise.

source
Reactant.MLIR.IR.block_ownerMethod
block_owner(value)

Returns the block in which this value is defined as an argument. Asserts if the value is not a block argument.

source
Reactant.MLIR.IR.dataMethod
data(attr)

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

source
Reactant.MLIR.IR.dataMethod
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
Reactant.MLIR.IR.flatsymbolMethod
flatsymbol(attr)

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

source
Reactant.MLIR.IR.insert_after!Method
insert_after!(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
Reactant.MLIR.IR.insert_after!Method
insert_after!(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
Reactant.MLIR.IR.insert_before!Method
insert_before!(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
Reactant.MLIR.IR.insert_before!Method
insert_before!(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
Reactant.MLIR.IR.is_pure_affineMethod
is_pure_affine(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
Reactant.MLIR.IR.is_registeredMethod
is_registered(name; context=context())

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
Reactant.MLIR.IR.isidentityMethod
isidentity(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
Reactant.MLIR.IR.leafrefMethod
leafref(attr)

Returns the string reference to the leaf referenced symbol. The data remains live as long as the context in which the attribute lives.

source
Reactant.MLIR.IR.lhsMethod
lhs(affineExpr)

Returns the left hand side affine expression of the given affine binary operation expression.

source
Reactant.MLIR.IR.lookupMethod
lookup(jit, name)

Lookup a native function in the execution engine by name, returns nullptr if the name can't be looked-up.

source
Reactant.MLIR.IR.lookupMethod
lookup(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
Reactant.MLIR.IR.majorsubmapMethod
majorsubmap(affineMap, nresults)

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

source
Reactant.MLIR.IR.minorsubmapMethod
minorsubmap(affineMap, nresults)

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

source
Reactant.MLIR.IR.move_after!Method
move_after!(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
Reactant.MLIR.IR.move_before!Method
move_before!(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
Reactant.MLIR.IR.namespaceMethod
mlirOpaqueAttrGetDialectNamespace(attr)

Returns the namespace of the dialect with which the given opaque attribute is associated. The namespace string is owned by the context.

source
Reactant.MLIR.IR.namespaceMethod
mlirOpaqueTypeGetDialectNamespace(type)

Returns the namespace of the dialect with which the given opaque type is associated. The namespace string is owned by the context.

source
Reactant.MLIR.IR.nextMethod
next(block)

Returns the block immediately following the given block in its parent region or nothing if last.

source
Reactant.MLIR.IR.nextMethod
next(opOperand)

Returns an op operand representing the next use of the value, or nothing if there is no next use.

source
Reactant.MLIR.IR.op_ownerMethod
op_owner(value)

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

source
Reactant.MLIR.IR.positionMethod
position(affineExpr)

Returns the position of the given affine dimension expression, affine symbol expression or ...

source
Reactant.MLIR.IR.push_argument!Method
push_argument!(block, type; location=Location())

Appends an argument of the specified type to the block. Returns the newly added argument.

source
Reactant.MLIR.IR.resultMethod
result(affineMap)

Returns the constant result of the given affine map. The function asserts that the map has a single constant result.

source
Reactant.MLIR.IR.rhsMethod
rhs(affineExpr)

Returns the right hand side affine expression of the given affine binary operation expression.

source
Reactant.MLIR.IR.rmattr!Method
rmattr!(op, name)

Removes an attribute by name. Returns false if the attribute was not found and true if removed.

source
Reactant.MLIR.IR.rmfromparent!Method
rmfromparent(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
Reactant.MLIR.IR.rootrefMethod
rootref(attr)

Returns the string reference to the root referenced symbol. The data remains live as long as the context in which the attribute lives.

source
Reactant.MLIR.IR.typeidMethod
typeid(op)

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

source
Reactant.MLIR.Dialects.chlo.broadcast_compareMethod

broadcast_compare

Compares lhs and rhs elementwise according to comparison_direction and compare_type. If unspecified, compare_type is FLOAT for float element types, SIGNED for signed element types and UNSIGNED for unsigned element types.

See https://www.tensorflow.org/xla/operationsemantics#element-wisecomparison_operations.

source
Reactant.MLIR.Dialects.chlo.next_afterMethod

next_after

Returns the next representable value of x in the direction of y, element-wise. It can also return a subnormal number.

Equivalent to the C++ std::nextafter function.

source
Reactant.MLIR.Dialects.chlo.top_kMethod

top_k

If the input is a vector (rank-1), finds the k largest entries in the vector and outputs their values and indices as vectors. Thus values[j] is the j-th largest entry in input, and its index is indices[j].

For matrices (resp. higher rank input), computes the top k entries in each row (resp. vector along the last dimension). Thus,

values.shape = indices.shape = input.shape[:-1] + [k]

If two elements are equal, the lower-index element appears first.

source
Reactant.MLIR.Dialects.stablehlo.absMethod

abs

Performs element-wise abs operation on operand tensor and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#abs

Example

%result = stablehlo.abs %operand : tensor<3xi32>
source
Reactant.MLIR.Dialects.stablehlo.addMethod

add

Performs element-wise addition of two tensors lhs and rhs and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#add

Example

%result = stablehlo.add %lhs, %rhs : tensor<2x2xi32>
source
Reactant.MLIR.Dialects.stablehlo.after_allMethod

after_all

Ensures that the operations producing the inputs are executed before any operations that depend on result.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#after_all

Example

%result = stablehlo.after_all %input0, %input1 : !stablehlo.token
source
Reactant.MLIR.Dialects.stablehlo.all_gatherMethod

all_gather

Within each process group in the process grid, concatenates the values of the operand tensor from each process along all_gather_dim and produces a result tensor.

See: https://github.com/openxla/stablehlo/blob/main/docs/spec.md#all_gather

Example

%result = "stablehlo.all_gather"(%operand) {
   all_gather_dim = 1 : i64,
   replica_groups = dense<[[0, 1]]> : tensor<1x2xi64>,
   channel_handle = #stablehlo.channel_handle<handle = 0, type = 0>
@@ -517,4 +517,4 @@
 %results2:2 = unrealized_conversion_cast %tuple_operand : !foo.tuple_type<!foo.type, !foo.type> to !foo.type, !foo.type
 
 // An unrealized N-1 conversion.
-%result3 = unrealized_conversion_cast %operand, %operand : !foo.type, !foo.type to !bar.tuple_type<!foo.type, !foo.type>
source
+%result3 = unrealized_conversion_cast %operand, %operand : !foo.type, !foo.type to !bar.tuple_type<!foo.type, !foo.type>
source
diff --git a/dev/index.html b/dev/index.html index 9d3501cac..58bb27519 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · Reactant.jl
+Home · Reactant.jl