From 6dd132b420a5ae3fc94fbdcd5eebc11aeb1a3b1d Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Tue, 7 Jan 2025 00:59:22 -0500 Subject: [PATCH] wip --- deps/ReactantExtra/API.cpp | 13 + deps/ReactantExtra/WORKSPACE | 2 +- deps/ReactantExtra/make-bindings.jl | 1 + ext/ReactantCUDAExt.jl | 25 +- src/Compiler.jl | 2 +- src/mlir/Dialects/Llvm.jl | 27 +- src/mlir/libMLIR_h.jl | 2389 ++++++--------------------- src/utils.jl | 7 + test/integration/cuda.jl | 52 + 9 files changed, 597 insertions(+), 1921 deletions(-) diff --git a/deps/ReactantExtra/API.cpp b/deps/ReactantExtra/API.cpp index 3292f3880..fecfddb68 100644 --- a/deps/ReactantExtra/API.cpp +++ b/deps/ReactantExtra/API.cpp @@ -432,11 +432,24 @@ extern "C" MlirModule ConvertLLVMStrToMLIR(const char *lmod, MlirContext cctx) { SMDiagnostic Err; auto llvmModule = llvm::parseIR(llvm::MemoryBufferRef(lmod, "conversion"), Err, Context); + if (!llvmModule) { + std::string err_str; + llvm::raw_string_ostream err_stream(err_str); + Err.print(/*ProgName=*/"LLVMToMLIR", err_stream); + err_stream.flush(); + if (ReactantThrowError) { + ReactantThrowError(err_str.c_str()); + return wrap((mlir::ModuleOp)nullptr); + } + } mlir::MLIRContext &context = *unwrap(cctx); auto res = mlir::translateLLVMIRToModule(std::move(llvmModule), &context, /*emitExpensiveWarnings*/ false, /*dropDICompositeElements*/ false) .release(); + if (!res) { + ReactantThrowError("Could not translate LLVM IR to MLIR Module"); + } return wrap(res); } diff --git a/deps/ReactantExtra/WORKSPACE b/deps/ReactantExtra/WORKSPACE index 15e883854..1143c84d3 100644 --- a/deps/ReactantExtra/WORKSPACE +++ b/deps/ReactantExtra/WORKSPACE @@ -9,7 +9,7 @@ http_archive( urls = ["https://github.com/wsmoses/nsync/archive/{commit}.tar.gz".format(commit = NSYNC_COMMIT)], ) -ENZYMEXLA_COMMIT = "92074225b9546e332042b915c76b7561f7fa038d" +ENZYMEXLA_COMMIT = "d601991a87b010023f85ec9f11fa2eb827bf1b90" ENZYMEXLA_SHA256 = "" http_archive( diff --git a/deps/ReactantExtra/make-bindings.jl b/deps/ReactantExtra/make-bindings.jl index c35004738..169c57f1a 100644 --- a/deps/ReactantExtra/make-bindings.jl +++ b/deps/ReactantExtra/make-bindings.jl @@ -27,6 +27,7 @@ for file in [ "Nvvm.jl", "Gpu.jl", "Affine.jl", + "MosaicTPU.jl" ] build_file(joinpath(src_dir, "mlir", "Dialects", file)) end diff --git a/ext/ReactantCUDAExt.jl b/ext/ReactantCUDAExt.jl index 621f5e98d..12151cb66 100644 --- a/ext/ReactantCUDAExt.jl +++ b/ext/ReactantCUDAExt.jl @@ -281,7 +281,7 @@ function compile(job) # TODO: on 1.9, this actually creates a context. cache those. entry = GPUCompiler.JuliaContext() do ctx mod, meta = GPUCompiler.compile( - :llvm, job; optimize=false, cleanup=false, validate=false + :llvm, job; optimize=false, cleanup=false, validate=false, libraries=false ) entryname = LLVM.name(meta.entry) @@ -322,8 +322,6 @@ function compile(job) LLVM.strip_debuginfo!(mod) modstr = string(mod) - println(modstr) - # This is a bit weird since we're taking a module from julia's llvm into reactant's llvm version # it is probably safer to reparse a string using the right llvm module api, so we will do that. @@ -332,6 +330,7 @@ function compile(job) modstr::Cstring, MLIR.IR.context()::MLIR.API.MlirContext )::MLIR.API.MlirModule ) + @assert mmod != C_NULL linkRes = @ccall MLIR.API.mlir_c.LinkInModule( MLIR.IR.mmodule()::MLIR.API.MlirModule, @@ -339,7 +338,6 @@ function compile(job) entryname::Cstring, )::MLIR.API.MlirOperation - entry = MLIR.IR.Operation(linkRes) String(Reactant.TracedUtils.get_attribute_by_name(linkRes, "sym_name")) end @@ -401,11 +399,16 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})( sym_name = String(gensym("call_$fname")) mod = MLIR.IR.mmodule() + CConv=MLIR.IR.Attribute(MLIR.API.mlirLLVMCConvAttrGet(ctx, MLIR.API.MlirLLVMCConvPTX_Kernel)) + voidty = MLIR.IR.Type(MLIR.API.mlirLLVMVoidTypeGet(ctx)) + wrapftype = MLIR.IR.Type(MLIR.API.mlirLLVMFunctionTypeGet(voidty, length(wrapper_tys), wrapper_tys, false)) wrapfunc = MLIR.IR.block!(MLIR.IR.body(mod)) do - return MLIR.Dialects.func.func_(; + return MLIR.Dialects.llvm.func(; sym_name, - function_type=MLIR.IR.FunctionType(wrapper_tys, []), - body=MLIR.IR.Region() + sym_visibility=MLIR.IR.Attribute("private"), + function_type=wrapftype, + body=MLIR.IR.Region(), + CConv ) end wrapbody = MLIR.IR.Block(wrapper_tys, [MLIR.IR.Location() for _ in wrapper_tys]) @@ -416,6 +419,7 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})( symtab = MLIR.IR.SymbolTable(MLIR.IR.Operation(mod)) gpufunc = MLIR.IR.lookup(symtab, fname) + MLIR.IR.attr!(gpufunc, "CConv", MLIR.IR.Attribute(MLIR.API.mlirLLVMCConvAttrGet(ctx, MLIR.API.MlirLLVMCConvC))) gpu_function_type = MLIR.IR.Type(Reactant.TracedUtils.get_attribute_by_name(gpufunc, "function_type")) @@ -467,13 +471,12 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})( end MLIR.IR.block!(wrapbody) do - MLIR.Dialects.func.call(wrapargs; result_0=MLIR.IR.Type[], callee=wrapfn) - MLIR.Dialects.func.return_(MLIR.IR.Value[]) + MLIR.Dialects.llvm.call(wrapargs, MLIR.IR.Value[]; callee=MLIR.IR.FlatSymbolRefAttribute(Base.String(fname)), op_bundle_sizes=MLIR.IR.Attribute(Int32[])) + MLIR.Dialects.llvm.return_(nothing) end output_operand_aliases = MLIR.IR.Attribute(aliases) - blk_operands = MLIR.IR.Value[] for idx in (blockdim.x, blockdim.y, blockdim.z, threaddim.x, threaddim.y, threaddim.z, shmem) @@ -488,7 +491,7 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})( blk_operands..., mlir_args; result_0=restys, - fn=sym_name, + fn=MLIR.IR.FlatSymbolRefAttribute(sym_name), output_operand_aliases=MLIR.IR.Attribute(output_operand_aliases) ) for (i, res) in enumerate(rarrays) diff --git a/src/Compiler.jl b/src/Compiler.jl index a5051b3fa..0dda85376 100644 --- a/src/Compiler.jl +++ b/src/Compiler.jl @@ -363,7 +363,7 @@ function compile_mlir!(mod, f, args; optimize::Union{Bool,Symbol}=true, no_nan:: if isdefined(Reactant_jll, :ptxas_path) toolkit = Reactant_jll.ptxas_path[1:(end - length("/bin/ptxas"))] end - kern = "lower-kernel{run_init=true toolkitPath=$toolkit cuLaunchKernelPtr=$(cuLaunch[]) cuModuleLoadDataPtr=$(cuModule[]) cuModuleGetFunctionPtr=$(cuFunc[])}" + kern = "lower-kernel{run_init=true toolkitPath=$toolkit cuLaunchKernelPtr=$(cuLaunch[]) cuModuleLoadDataPtr=$(cuModule[]) cuModuleGetFunctionPtr=$(cuFunc[])},symbol-dce" opt_passes = optimization_passes(; no_nan) diff --git a/src/mlir/Dialects/Llvm.jl b/src/mlir/Dialects/Llvm.jl index 3e2124f67..b31ef0ee7 100755 --- a/src/mlir/Dialects/Llvm.jl +++ b/src/mlir/Dialects/Llvm.jl @@ -6,13 +6,14 @@ import ...API -function ashr(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, location=Location()) +function ashr(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, isExact=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[lhs, rhs, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] !isnothing(res) && push!(op_ty_results, res) + !isnothing(isExact) && push!(attributes, namedattribute("isExact", isExact)) create_operation( "llvm.ashr", location; @@ -1155,13 +1156,14 @@ function func(; sym_name, sym_visibility=nothing, function_type, linkage=nothing end -function lshr(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, location=Location()) +function lshr(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, isExact=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[lhs, rhs, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] !isnothing(res) && push!(op_ty_results, res) + !isnothing(isExact) && push!(attributes, namedattribute("isExact", isExact)) create_operation( "llvm.lshr", location; @@ -1245,7 +1247,7 @@ Examples: See the following link for more details: https://llvm.org/docs/LangRef.html#load-instruction """ -function load(addr::Value; res::IR.Type, alignment=nothing, volatile_=nothing, nontemporal=nothing, invariant=nothing, ordering=nothing, syncscope=nothing, access_groups=nothing, alias_scopes=nothing, noalias_scopes=nothing, tbaa=nothing, location=Location()) +function load(addr::Value; res::IR.Type, alignment=nothing, volatile_=nothing, nontemporal=nothing, invariant=nothing, invariantGroup=nothing, ordering=nothing, syncscope=nothing, access_groups=nothing, alias_scopes=nothing, noalias_scopes=nothing, tbaa=nothing, location=Location()) op_ty_results = IR.Type[res, ] operands = Value[addr, ] owned_regions = Region[] @@ -1255,6 +1257,7 @@ function load(addr::Value; res::IR.Type, alignment=nothing, volatile_=nothing, n !isnothing(volatile_) && push!(attributes, namedattribute("volatile_", volatile_)) !isnothing(nontemporal) && push!(attributes, namedattribute("nontemporal", nontemporal)) !isnothing(invariant) && push!(attributes, namedattribute("invariant", invariant)) + !isnothing(invariantGroup) && push!(attributes, namedattribute("invariantGroup", invariantGroup)) !isnothing(ordering) && push!(attributes, namedattribute("ordering", ordering)) !isnothing(syncscope) && push!(attributes, namedattribute("syncscope", syncscope)) !isnothing(access_groups) && push!(attributes, namedattribute("access_groups", access_groups)) @@ -1318,13 +1321,14 @@ function mlir_none(; res=nothing::Union{Nothing, IR.Type}, location=Location()) end -function or(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, location=Location()) +function or(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, isDisjoint=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[lhs, rhs, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] !isnothing(res) && push!(op_ty_results, res) + !isnothing(isDisjoint) && push!(attributes, namedattribute("isDisjoint", isDisjoint)) create_operation( "llvm.or", location; @@ -1415,13 +1419,14 @@ function return_(arg=nothing::Union{Nothing, Value}; location=Location()) end -function sdiv(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, location=Location()) +function sdiv(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, isExact=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[lhs, rhs, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] !isnothing(res) && push!(op_ty_results, res) + !isnothing(isExact) && push!(attributes, namedattribute("isExact", isExact)) create_operation( "llvm.sdiv", location; @@ -1557,7 +1562,7 @@ llvm.store %val, %ptr atomic monotonic {alignment = 8 : i64} See the following link for more details: https://llvm.org/docs/LangRef.html#store-instruction """ -function store(value::Value, addr::Value; alignment=nothing, volatile_=nothing, nontemporal=nothing, ordering=nothing, syncscope=nothing, access_groups=nothing, alias_scopes=nothing, noalias_scopes=nothing, tbaa=nothing, location=Location()) +function store(value::Value, addr::Value; alignment=nothing, volatile_=nothing, nontemporal=nothing, invariantGroup=nothing, ordering=nothing, syncscope=nothing, access_groups=nothing, alias_scopes=nothing, noalias_scopes=nothing, tbaa=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[value, addr, ] owned_regions = Region[] @@ -1566,6 +1571,7 @@ function store(value::Value, addr::Value; alignment=nothing, volatile_=nothing, !isnothing(alignment) && push!(attributes, namedattribute("alignment", alignment)) !isnothing(volatile_) && push!(attributes, namedattribute("volatile_", volatile_)) !isnothing(nontemporal) && push!(attributes, namedattribute("nontemporal", nontemporal)) + !isnothing(invariantGroup) && push!(attributes, namedattribute("invariantGroup", invariantGroup)) !isnothing(ordering) && push!(attributes, namedattribute("ordering", ordering)) !isnothing(syncscope) && push!(attributes, namedattribute("syncscope", syncscope)) !isnothing(access_groups) && push!(attributes, namedattribute("access_groups", access_groups)) @@ -1634,13 +1640,14 @@ function trunc(arg::Value; res::IR.Type, location=Location()) end -function udiv(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, location=Location()) +function udiv(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, isExact=nothing, location=Location()) op_ty_results = IR.Type[] operands = Value[lhs, rhs, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] !isnothing(res) && push!(op_ty_results, res) + !isnothing(isExact) && push!(attributes, namedattribute("isExact", isExact)) create_operation( "llvm.udiv", location; @@ -1651,12 +1658,13 @@ function udiv(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, loca end -function uitofp(arg::Value; res::IR.Type, location=Location()) +function uitofp(arg::Value; res::IR.Type, nonNeg=nothing, location=Location()) op_ty_results = IR.Type[res, ] operands = Value[arg, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] + !isnothing(nonNeg) && push!(attributes, namedattribute("nonNeg", nonNeg)) create_operation( "llvm.uitofp", location; @@ -1763,12 +1771,13 @@ function xor(lhs::Value, rhs::Value; res=nothing::Union{Nothing, IR.Type}, locat end -function zext(arg::Value; res::IR.Type, location=Location()) +function zext(arg::Value; res::IR.Type, nonNeg=nothing, location=Location()) op_ty_results = IR.Type[res, ] operands = Value[arg, ] owned_regions = Region[] successors = Block[] attributes = NamedAttribute[] + !isnothing(nonNeg) && push!(attributes, namedattribute("nonNeg", nonNeg)) create_operation( "llvm.zext", location; diff --git a/src/mlir/libMLIR_h.jl b/src/mlir/libMLIR_h.jl index 5f5c0feeb..d72219309 100644 --- a/src/mlir/libMLIR_h.jl +++ b/src/mlir/libMLIR_h.jl @@ -39,6 +39,7 @@ elseif Sys.iswindows() && Sys.ARCH === :x86_64 const off_t = off32_t end + const intptr_t = Clong struct MlirDialectHandle @@ -235,9 +236,7 @@ end Allocates a type id that is valid for the lifetime of the allocator """ function mlirTypeIDAllocatorAllocateTypeID(allocator) - @ccall mlir_c.mlirTypeIDAllocatorAllocateTypeID( - allocator::MlirTypeIDAllocator - )::MlirTypeID + @ccall mlir_c.mlirTypeIDAllocatorAllocateTypeID(allocator::MlirTypeIDAllocator)::MlirTypeID end struct MlirAsmState @@ -344,9 +343,7 @@ end Creates an MLIR context, setting the multithreading setting explicitly and pre-loading the dialects from the provided DialectRegistry. """ function mlirContextCreateWithRegistry(registry, threadingEnabled) - @ccall mlir_c.mlirContextCreateWithRegistry( - registry::MlirDialectRegistry, threadingEnabled::Bool - )::MlirContext + @ccall mlir_c.mlirContextCreateWithRegistry(registry::MlirDialectRegistry, threadingEnabled::Bool)::MlirContext end """ @@ -382,9 +379,7 @@ end Sets whether unregistered dialects are allowed in this context. """ function mlirContextSetAllowUnregisteredDialects(context, allow) - @ccall mlir_c.mlirContextSetAllowUnregisteredDialects( - context::MlirContext, allow::Bool - )::Cvoid + @ccall mlir_c.mlirContextSetAllowUnregisteredDialects(context::MlirContext, allow::Bool)::Cvoid end """ @@ -411,9 +406,7 @@ end Append the contents of the given dialect registry to the registry associated with the context. """ function mlirContextAppendDialectRegistry(ctx, registry) - @ccall mlir_c.mlirContextAppendDialectRegistry( - ctx::MlirContext, registry::MlirDialectRegistry - )::Cvoid + @ccall mlir_c.mlirContextAppendDialectRegistry(ctx::MlirContext, registry::MlirDialectRegistry)::Cvoid end """ @@ -431,9 +424,7 @@ end 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 mlirContextLoadDialect to load an unregistered dialect. """ function mlirContextGetOrLoadDialect(context, name) - @ccall mlir_c.mlirContextGetOrLoadDialect( - context::MlirContext, name::MlirStringRef - )::MlirDialect + @ccall mlir_c.mlirContextGetOrLoadDialect(context::MlirContext, name::MlirStringRef)::MlirDialect end """ @@ -460,9 +451,7 @@ end 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. """ function mlirContextIsRegisteredOperation(context, name) - @ccall mlir_c.mlirContextIsRegisteredOperation( - context::MlirContext, name::MlirStringRef - )::Bool + @ccall mlir_c.mlirContextIsRegisteredOperation(context::MlirContext, name::MlirStringRef)::Bool end """ @@ -471,9 +460,7 @@ end 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. """ function mlirContextSetThreadPool(context, threadPool) - @ccall mlir_c.mlirContextSetThreadPool( - context::MlirContext, threadPool::MlirLlvmThreadPool - )::Cvoid + @ccall mlir_c.mlirContextSetThreadPool(context::MlirContext, threadPool::MlirLlvmThreadPool)::Cvoid end """ @@ -527,9 +514,7 @@ end Inserts the dialect associated with the provided dialect handle into the provided dialect registry """ function mlirDialectHandleInsertDialect(arg1, arg2) - @ccall mlir_c.mlirDialectHandleInsertDialect( - arg1::MlirDialectHandle, arg2::MlirDialectRegistry - )::Cvoid + @ccall mlir_c.mlirDialectHandleInsertDialect(arg1::MlirDialectHandle, arg2::MlirDialectRegistry)::Cvoid end """ @@ -538,9 +523,7 @@ end Registers the dialect associated with the provided dialect handle. """ function mlirDialectHandleRegisterDialect(arg1, arg2) - @ccall mlir_c.mlirDialectHandleRegisterDialect( - arg1::MlirDialectHandle, arg2::MlirContext - )::Cvoid + @ccall mlir_c.mlirDialectHandleRegisterDialect(arg1::MlirDialectHandle, arg2::MlirContext)::Cvoid end """ @@ -549,9 +532,7 @@ end Loads the dialect associated with the provided dialect handle. """ function mlirDialectHandleLoadDialect(arg1, arg2) - @ccall mlir_c.mlirDialectHandleLoadDialect( - arg1::MlirDialectHandle, arg2::MlirContext - )::MlirDialect + @ccall mlir_c.mlirDialectHandleLoadDialect(arg1::MlirDialectHandle, arg2::MlirContext)::MlirDialect end """ @@ -605,9 +586,7 @@ end Creates an File/Line/Column location owned by the given context. """ function mlirLocationFileLineColGet(context, filename, line, col) - @ccall mlir_c.mlirLocationFileLineColGet( - context::MlirContext, filename::MlirStringRef, line::Cuint, col::Cuint - )::MlirLocation + @ccall mlir_c.mlirLocationFileLineColGet(context::MlirContext, filename::MlirStringRef, line::Cuint, col::Cuint)::MlirLocation end """ @@ -616,9 +595,7 @@ end Creates a call site location with a callee and a caller. """ function mlirLocationCallSiteGet(callee, caller) - @ccall mlir_c.mlirLocationCallSiteGet( - callee::MlirLocation, caller::MlirLocation - )::MlirLocation + @ccall mlir_c.mlirLocationCallSiteGet(callee::MlirLocation, caller::MlirLocation)::MlirLocation end """ @@ -627,12 +604,7 @@ end Creates a fused location with an array of locations and metadata. """ function mlirLocationFusedGet(ctx, nLocations, locations, metadata) - @ccall mlir_c.mlirLocationFusedGet( - ctx::MlirContext, - nLocations::intptr_t, - locations::Ptr{MlirLocation}, - metadata::MlirAttribute, - )::MlirLocation + @ccall mlir_c.mlirLocationFusedGet(ctx::MlirContext, nLocations::intptr_t, locations::Ptr{MlirLocation}, metadata::MlirAttribute)::MlirLocation end """ @@ -641,9 +613,7 @@ end 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. """ function mlirLocationNameGet(context, name, childLoc) - @ccall mlir_c.mlirLocationNameGet( - context::MlirContext, name::MlirStringRef, childLoc::MlirLocation - )::MlirLocation + @ccall mlir_c.mlirLocationNameGet(context::MlirContext, name::MlirStringRef, childLoc::MlirLocation)::MlirLocation end """ @@ -688,9 +658,7 @@ end Prints a location by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirLocationPrint(location, callback, userData) - @ccall mlir_c.mlirLocationPrint( - location::MlirLocation, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirLocationPrint(location::MlirLocation, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -708,9 +676,7 @@ end Parses a module from the string and transfers ownership to the caller. """ function mlirModuleCreateParse(context, _module) - @ccall mlir_c.mlirModuleCreateParse( - context::MlirContext, _module::MlirStringRef - )::MlirModule + @ccall mlir_c.mlirModuleCreateParse(context::MlirContext, _module::MlirStringRef)::MlirModule end """ @@ -796,9 +762,7 @@ end Constructs an operation state from a name and a location. """ function mlirOperationStateGet(name, loc) - @ccall mlir_c.mlirOperationStateGet( - name::MlirStringRef, loc::MlirLocation - )::MlirOperationState + @ccall mlir_c.mlirOperationStateGet(name::MlirStringRef, loc::MlirLocation)::MlirOperationState end """ @@ -807,33 +771,23 @@ end Adds a list of components to the operation state. """ function mlirOperationStateAddResults(state, n, results) - @ccall mlir_c.mlirOperationStateAddResults( - state::Ptr{MlirOperationState}, n::intptr_t, results::Ptr{MlirType} - )::Cvoid + @ccall mlir_c.mlirOperationStateAddResults(state::Ptr{MlirOperationState}, n::intptr_t, results::Ptr{MlirType})::Cvoid end function mlirOperationStateAddOperands(state, n, operands) - @ccall mlir_c.mlirOperationStateAddOperands( - state::Ptr{MlirOperationState}, n::intptr_t, operands::Ptr{MlirValue} - )::Cvoid + @ccall mlir_c.mlirOperationStateAddOperands(state::Ptr{MlirOperationState}, n::intptr_t, operands::Ptr{MlirValue})::Cvoid end function mlirOperationStateAddOwnedRegions(state, n, regions) - @ccall mlir_c.mlirOperationStateAddOwnedRegions( - state::Ptr{MlirOperationState}, n::intptr_t, regions::Ptr{MlirRegion} - )::Cvoid + @ccall mlir_c.mlirOperationStateAddOwnedRegions(state::Ptr{MlirOperationState}, n::intptr_t, regions::Ptr{MlirRegion})::Cvoid end function mlirOperationStateAddSuccessors(state, n, successors) - @ccall mlir_c.mlirOperationStateAddSuccessors( - state::Ptr{MlirOperationState}, n::intptr_t, successors::Ptr{MlirBlock} - )::Cvoid + @ccall mlir_c.mlirOperationStateAddSuccessors(state::Ptr{MlirOperationState}, n::intptr_t, successors::Ptr{MlirBlock})::Cvoid end function mlirOperationStateAddAttributes(state, n, attributes) - @ccall mlir_c.mlirOperationStateAddAttributes( - state::Ptr{MlirOperationState}, n::intptr_t, attributes::Ptr{MlirNamedAttribute} - )::Cvoid + @ccall mlir_c.mlirOperationStateAddAttributes(state::Ptr{MlirOperationState}, n::intptr_t, attributes::Ptr{MlirNamedAttribute})::Cvoid end """ @@ -842,9 +796,7 @@ end Enables result type inference for the operation under construction. If enabled, then the caller must not have called [`mlirOperationStateAddResults`](@ref)(). Note that if enabled, the [`mlirOperationCreate`](@ref)() call is failable: it will return a null operation on inference failure and will emit diagnostics. """ function mlirOperationStateEnableResultTypeInference(state) - @ccall mlir_c.mlirOperationStateEnableResultTypeInference( - state::Ptr{MlirOperationState} - )::Cvoid + @ccall mlir_c.mlirOperationStateEnableResultTypeInference(state::Ptr{MlirOperationState})::Cvoid end """ @@ -853,9 +805,7 @@ end Creates new AsmState, as with AsmState the IR should not be mutated in-between using this state. Must be freed with a call to [`mlirAsmStateDestroy`](@ref)(). """ function mlirAsmStateCreateForOperation(op, flags) - @ccall mlir_c.mlirAsmStateCreateForOperation( - op::MlirOperation, flags::MlirOpPrintingFlags - )::MlirAsmState + @ccall mlir_c.mlirAsmStateCreateForOperation(op::MlirOperation, flags::MlirOpPrintingFlags)::MlirAsmState end """ @@ -864,9 +814,7 @@ end Creates new AsmState from value. Must be freed with a call to [`mlirAsmStateDestroy`](@ref)(). """ function mlirAsmStateCreateForValue(value, flags) - @ccall mlir_c.mlirAsmStateCreateForValue( - value::MlirValue, flags::MlirOpPrintingFlags - )::MlirAsmState + @ccall mlir_c.mlirAsmStateCreateForValue(value::MlirValue, flags::MlirOpPrintingFlags)::MlirAsmState end """ @@ -902,9 +850,7 @@ end 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. """ function mlirOpPrintingFlagsElideLargeElementsAttrs(flags, largeElementLimit) - @ccall mlir_c.mlirOpPrintingFlagsElideLargeElementsAttrs( - flags::MlirOpPrintingFlags, largeElementLimit::intptr_t - )::Cvoid + @ccall mlir_c.mlirOpPrintingFlagsElideLargeElementsAttrs(flags::MlirOpPrintingFlags, largeElementLimit::intptr_t)::Cvoid end """ @@ -913,9 +859,7 @@ end Enables the elision of large resources strings by omitting them from the `dialect_resources` section. The `largeResourceLimit` is used to configure what is considered to be a "large" resource by providing an upper limit to the string size. """ function mlirOpPrintingFlagsElideLargeResourceString(flags, largeResourceLimit) - @ccall mlir_c.mlirOpPrintingFlagsElideLargeResourceString( - flags::MlirOpPrintingFlags, largeResourceLimit::intptr_t - )::Cvoid + @ccall mlir_c.mlirOpPrintingFlagsElideLargeResourceString(flags::MlirOpPrintingFlags, largeResourceLimit::intptr_t)::Cvoid end """ @@ -924,9 +868,7 @@ end 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. """ function mlirOpPrintingFlagsEnableDebugInfo(flags, enable, prettyForm) - @ccall mlir_c.mlirOpPrintingFlagsEnableDebugInfo( - flags::MlirOpPrintingFlags, enable::Bool, prettyForm::Bool - )::Cvoid + @ccall mlir_c.mlirOpPrintingFlagsEnableDebugInfo(flags::MlirOpPrintingFlags, enable::Bool, prettyForm::Bool)::Cvoid end """ @@ -989,9 +931,7 @@ end Sets the version to emit in the writer config. """ function mlirBytecodeWriterConfigDesiredEmitVersion(flags, version) - @ccall mlir_c.mlirBytecodeWriterConfigDesiredEmitVersion( - flags::MlirBytecodeWriterConfig, version::Int64 - )::Cvoid + @ccall mlir_c.mlirBytecodeWriterConfigDesiredEmitVersion(flags::MlirBytecodeWriterConfig, version::Int64)::Cvoid end """ @@ -1013,9 +953,7 @@ Parses an operation, giving ownership to the caller. If parsing fails a null ope `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. """ function mlirOperationCreateParse(context, sourceStr, sourceName) - @ccall mlir_c.mlirOperationCreateParse( - context::MlirContext, sourceStr::MlirStringRef, sourceName::MlirStringRef - )::MlirOperation + @ccall mlir_c.mlirOperationCreateParse(context::MlirContext, sourceStr::MlirStringRef, sourceName::MlirStringRef)::MlirOperation end """ @@ -1168,9 +1106,7 @@ end Sets the `pos`-th operand of the operation. """ function mlirOperationSetOperand(op, pos, newValue) - @ccall mlir_c.mlirOperationSetOperand( - op::MlirOperation, pos::intptr_t, newValue::MlirValue - )::Cvoid + @ccall mlir_c.mlirOperationSetOperand(op::MlirOperation, pos::intptr_t, newValue::MlirValue)::Cvoid end """ @@ -1179,9 +1115,7 @@ end Replaces the operands of the operation. """ function mlirOperationSetOperands(op, nOperands, operands) - @ccall mlir_c.mlirOperationSetOperands( - op::MlirOperation, nOperands::intptr_t, operands::Ptr{MlirValue} - )::Cvoid + @ccall mlir_c.mlirOperationSetOperands(op::MlirOperation, nOperands::intptr_t, operands::Ptr{MlirValue})::Cvoid end """ @@ -1226,9 +1160,7 @@ end Set `pos`-th successor of the operation. """ function mlirOperationSetSuccessor(op, pos, block) - @ccall mlir_c.mlirOperationSetSuccessor( - op::MlirOperation, pos::intptr_t, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirOperationSetSuccessor(op::MlirOperation, pos::intptr_t, block::MlirBlock)::Cvoid end """ @@ -1237,9 +1169,7 @@ end Returns true if this operation defines an inherent attribute with this name. Note: the attribute can be optional, so [`mlirOperationGetInherentAttributeByName`](@ref) can still return a null attribute. """ function mlirOperationHasInherentAttributeByName(op, name) - @ccall mlir_c.mlirOperationHasInherentAttributeByName( - op::MlirOperation, name::MlirStringRef - )::Bool + @ccall mlir_c.mlirOperationHasInherentAttributeByName(op::MlirOperation, name::MlirStringRef)::Bool end """ @@ -1248,9 +1178,7 @@ end Returns an inherent attribute attached to the operation given its name. """ function mlirOperationGetInherentAttributeByName(op, name) - @ccall mlir_c.mlirOperationGetInherentAttributeByName( - op::MlirOperation, name::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirOperationGetInherentAttributeByName(op::MlirOperation, name::MlirStringRef)::MlirAttribute end """ @@ -1259,9 +1187,7 @@ end Sets an inherent attribute by name, replacing the existing if it exists. This has no effect if "name" does not match an inherent attribute. """ function mlirOperationSetInherentAttributeByName(op, name, attr) - @ccall mlir_c.mlirOperationSetInherentAttributeByName( - op::MlirOperation, name::MlirStringRef, attr::MlirAttribute - )::Cvoid + @ccall mlir_c.mlirOperationSetInherentAttributeByName(op::MlirOperation, name::MlirStringRef, attr::MlirAttribute)::Cvoid end """ @@ -1279,9 +1205,7 @@ end Return `pos`-th discardable attribute of the operation. """ function mlirOperationGetDiscardableAttribute(op, pos) - @ccall mlir_c.mlirOperationGetDiscardableAttribute( - op::MlirOperation, pos::intptr_t - )::MlirNamedAttribute + @ccall mlir_c.mlirOperationGetDiscardableAttribute(op::MlirOperation, pos::intptr_t)::MlirNamedAttribute end """ @@ -1290,9 +1214,7 @@ end Returns a discardable attribute attached to the operation given its name. """ function mlirOperationGetDiscardableAttributeByName(op, name) - @ccall mlir_c.mlirOperationGetDiscardableAttributeByName( - op::MlirOperation, name::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirOperationGetDiscardableAttributeByName(op::MlirOperation, name::MlirStringRef)::MlirAttribute end """ @@ -1301,9 +1223,7 @@ end Sets a discardable attribute by name, replacing the existing if it exists or adding a new one otherwise. The new `attr` Attribute is not allowed to be null, use [`mlirOperationRemoveDiscardableAttributeByName`](@ref) to remove an Attribute instead. """ function mlirOperationSetDiscardableAttributeByName(op, name, attr) - @ccall mlir_c.mlirOperationSetDiscardableAttributeByName( - op::MlirOperation, name::MlirStringRef, attr::MlirAttribute - )::Cvoid + @ccall mlir_c.mlirOperationSetDiscardableAttributeByName(op::MlirOperation, name::MlirStringRef, attr::MlirAttribute)::Cvoid end """ @@ -1312,9 +1232,7 @@ end Removes a discardable attribute by name. Returns false if the attribute was not found and true if removed. """ function mlirOperationRemoveDiscardableAttributeByName(op, name) - @ccall mlir_c.mlirOperationRemoveDiscardableAttributeByName( - op::MlirOperation, name::MlirStringRef - )::Bool + @ccall mlir_c.mlirOperationRemoveDiscardableAttributeByName(op::MlirOperation, name::MlirStringRef)::Bool end """ @@ -1332,9 +1250,7 @@ end Return `pos`-th attribute of the operation. Deprecated, please use `mlirOperationGetInherentAttribute` or [`mlirOperationGetDiscardableAttribute`](@ref). """ function mlirOperationGetAttribute(op, pos) - @ccall mlir_c.mlirOperationGetAttribute( - op::MlirOperation, pos::intptr_t - )::MlirNamedAttribute + @ccall mlir_c.mlirOperationGetAttribute(op::MlirOperation, pos::intptr_t)::MlirNamedAttribute end """ @@ -1343,9 +1259,7 @@ end Returns an attribute attached to the operation given its name. Deprecated, please use [`mlirOperationGetInherentAttributeByName`](@ref) or [`mlirOperationGetDiscardableAttributeByName`](@ref). """ function mlirOperationGetAttributeByName(op, name) - @ccall mlir_c.mlirOperationGetAttributeByName( - op::MlirOperation, name::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirOperationGetAttributeByName(op::MlirOperation, name::MlirStringRef)::MlirAttribute end """ @@ -1354,9 +1268,7 @@ end Sets an attribute by name, replacing the existing if it exists or adding a new one otherwise. Deprecated, please use [`mlirOperationSetInherentAttributeByName`](@ref) or [`mlirOperationSetDiscardableAttributeByName`](@ref). """ function mlirOperationSetAttributeByName(op, name, attr) - @ccall mlir_c.mlirOperationSetAttributeByName( - op::MlirOperation, name::MlirStringRef, attr::MlirAttribute - )::Cvoid + @ccall mlir_c.mlirOperationSetAttributeByName(op::MlirOperation, name::MlirStringRef, attr::MlirAttribute)::Cvoid end """ @@ -1365,9 +1277,7 @@ end Removes an attribute by name. Returns false if the attribute was not found and true if removed. Deprecated, please use `mlirOperationRemoveInherentAttributeByName` or [`mlirOperationRemoveDiscardableAttributeByName`](@ref). """ function mlirOperationRemoveAttributeByName(op, name) - @ccall mlir_c.mlirOperationRemoveAttributeByName( - op::MlirOperation, name::MlirStringRef - )::Bool + @ccall mlir_c.mlirOperationRemoveAttributeByName(op::MlirOperation, name::MlirStringRef)::Bool end """ @@ -1376,9 +1286,7 @@ end Prints an operation by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirOperationPrint(op, callback, userData) - @ccall mlir_c.mlirOperationPrint( - op::MlirOperation, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirOperationPrint(op::MlirOperation, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1387,12 +1295,7 @@ end Same as [`mlirOperationPrint`](@ref) but accepts flags controlling the printing behavior. """ function mlirOperationPrintWithFlags(op, flags, callback, userData) - @ccall mlir_c.mlirOperationPrintWithFlags( - op::MlirOperation, - flags::MlirOpPrintingFlags, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::Cvoid + @ccall mlir_c.mlirOperationPrintWithFlags(op::MlirOperation, flags::MlirOpPrintingFlags, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1401,12 +1304,7 @@ end Same as [`mlirOperationPrint`](@ref) but accepts AsmState controlling the printing behavior as well as caching computed names. """ function mlirOperationPrintWithState(op, state, callback, userData) - @ccall mlir_c.mlirOperationPrintWithState( - op::MlirOperation, - state::MlirAsmState, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::Cvoid + @ccall mlir_c.mlirOperationPrintWithState(op::MlirOperation, state::MlirAsmState, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1415,9 +1313,7 @@ end Same as [`mlirOperationPrint`](@ref) but writing the bytecode format. """ function mlirOperationWriteBytecode(op, callback, userData) - @ccall mlir_c.mlirOperationWriteBytecode( - op::MlirOperation, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirOperationWriteBytecode(op::MlirOperation, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1426,12 +1322,7 @@ end Same as [`mlirOperationWriteBytecode`](@ref) but with writer config and returns failure only if desired bytecode could not be honored. """ function mlirOperationWriteBytecodeWithConfig(op, config, callback, userData) - @ccall mlir_c.mlirOperationWriteBytecodeWithConfig( - op::MlirOperation, - config::MlirBytecodeWriterConfig, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::MlirLogicalResult + @ccall mlir_c.mlirOperationWriteBytecodeWithConfig(op::MlirOperation, config::MlirBytecodeWriterConfig, callback::MlirStringCallback, userData::Ptr{Cvoid})::MlirLogicalResult end """ @@ -1503,12 +1394,7 @@ const MlirOperationWalkCallback = Ptr{Cvoid} 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. """ function mlirOperationWalk(op, callback, userData, walkOrder) - @ccall mlir_c.mlirOperationWalk( - op::MlirOperation, - callback::MlirOperationWalkCallback, - userData::Ptr{Cvoid}, - walkOrder::MlirWalkOrder, - )::Cvoid + @ccall mlir_c.mlirOperationWalk(op::MlirOperation, callback::MlirOperationWalkCallback, userData::Ptr{Cvoid}, walkOrder::MlirWalkOrder)::Cvoid end """ @@ -1571,9 +1457,7 @@ end 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. """ function mlirRegionInsertOwnedBlock(region, pos, block) - @ccall mlir_c.mlirRegionInsertOwnedBlock( - region::MlirRegion, pos::intptr_t, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRegionInsertOwnedBlock(region::MlirRegion, pos::intptr_t, block::MlirBlock)::Cvoid end """ @@ -1582,9 +1466,7 @@ end 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. """ function mlirRegionInsertOwnedBlockAfter(region, reference, block) - @ccall mlir_c.mlirRegionInsertOwnedBlockAfter( - region::MlirRegion, reference::MlirBlock, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRegionInsertOwnedBlockAfter(region::MlirRegion, reference::MlirBlock, block::MlirBlock)::Cvoid end """ @@ -1593,9 +1475,7 @@ end 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. """ function mlirRegionInsertOwnedBlockBefore(region, reference, block) - @ccall mlir_c.mlirRegionInsertOwnedBlockBefore( - region::MlirRegion, reference::MlirBlock, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRegionInsertOwnedBlockBefore(region::MlirRegion, reference::MlirBlock, block::MlirBlock)::Cvoid end """ @@ -1631,9 +1511,7 @@ end Creates a new empty block with the given argument types and transfers ownership to the caller. """ function mlirBlockCreate(nArgs, args, locs) - @ccall mlir_c.mlirBlockCreate( - nArgs::intptr_t, args::Ptr{MlirType}, locs::Ptr{MlirLocation} - )::MlirBlock + @ccall mlir_c.mlirBlockCreate(nArgs::intptr_t, args::Ptr{MlirType}, locs::Ptr{MlirLocation})::MlirBlock end """ @@ -1723,9 +1601,7 @@ end Takes an operation owned by the caller and appends it to the block. """ function mlirBlockAppendOwnedOperation(block, operation) - @ccall mlir_c.mlirBlockAppendOwnedOperation( - block::MlirBlock, operation::MlirOperation - )::Cvoid + @ccall mlir_c.mlirBlockAppendOwnedOperation(block::MlirBlock, operation::MlirOperation)::Cvoid end """ @@ -1734,9 +1610,7 @@ end 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. """ function mlirBlockInsertOwnedOperation(block, pos, operation) - @ccall mlir_c.mlirBlockInsertOwnedOperation( - block::MlirBlock, pos::intptr_t, operation::MlirOperation - )::Cvoid + @ccall mlir_c.mlirBlockInsertOwnedOperation(block::MlirBlock, pos::intptr_t, operation::MlirOperation)::Cvoid end """ @@ -1745,9 +1619,7 @@ end 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. """ function mlirBlockInsertOwnedOperationAfter(block, reference, operation) - @ccall mlir_c.mlirBlockInsertOwnedOperationAfter( - block::MlirBlock, reference::MlirOperation, operation::MlirOperation - )::Cvoid + @ccall mlir_c.mlirBlockInsertOwnedOperationAfter(block::MlirBlock, reference::MlirOperation, operation::MlirOperation)::Cvoid end """ @@ -1756,9 +1628,7 @@ end 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. """ function mlirBlockInsertOwnedOperationBefore(block, reference, operation) - @ccall mlir_c.mlirBlockInsertOwnedOperationBefore( - block::MlirBlock, reference::MlirOperation, operation::MlirOperation - )::Cvoid + @ccall mlir_c.mlirBlockInsertOwnedOperationBefore(block::MlirBlock, reference::MlirOperation, operation::MlirOperation)::Cvoid end """ @@ -1776,9 +1646,7 @@ end Appends an argument of the specified type to the block. Returns the newly added argument. """ function mlirBlockAddArgument(block, type, loc) - @ccall mlir_c.mlirBlockAddArgument( - block::MlirBlock, type::MlirType, loc::MlirLocation - )::MlirValue + @ccall mlir_c.mlirBlockAddArgument(block::MlirBlock, type::MlirType, loc::MlirLocation)::MlirValue end """ @@ -1796,9 +1664,7 @@ end Inserts an argument of the specified type at a specified index to the block. Returns the newly added argument. """ function mlirBlockInsertArgument(block, pos, type, loc) - @ccall mlir_c.mlirBlockInsertArgument( - block::MlirBlock, pos::intptr_t, type::MlirType, loc::MlirLocation - )::MlirValue + @ccall mlir_c.mlirBlockInsertArgument(block::MlirBlock, pos::intptr_t, type::MlirType, loc::MlirLocation)::MlirValue end """ @@ -1816,9 +1682,7 @@ end Prints a block by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirBlockPrint(block, callback, userData) - @ccall mlir_c.mlirBlockPrint( - block::MlirBlock, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirBlockPrint(block::MlirBlock, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1935,9 +1799,7 @@ end Prints a value by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirValuePrint(value, callback, userData) - @ccall mlir_c.mlirValuePrint( - value::MlirValue, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirValuePrint(value::MlirValue, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1946,12 +1808,7 @@ end Prints a value as an operand (i.e., the ValueID). """ function mlirValuePrintAsOperand(value, state, callback, userData) - @ccall mlir_c.mlirValuePrintAsOperand( - value::MlirValue, - state::MlirAsmState, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::Cvoid + @ccall mlir_c.mlirValuePrintAsOperand(value::MlirValue, state::MlirAsmState, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -1978,12 +1835,7 @@ end Replace all uses of 'of' value with 'with' value, updating anything in the IR that uses 'of' to use 'with' instead, except if the user is listed in 'exceptions'. The 'exceptions' parameter is an array of [`MlirOperation`](@ref) pointers with a length of 'numExceptions'. """ function mlirValueReplaceAllUsesExcept(of, with, numExceptions, exceptions) - @ccall mlir_c.mlirValueReplaceAllUsesExcept( - of::MlirValue, - with::MlirValue, - numExceptions::intptr_t, - exceptions::Ptr{MlirOperation}, - )::Cvoid + @ccall mlir_c.mlirValueReplaceAllUsesExcept(of::MlirValue, with::MlirValue, numExceptions::intptr_t, exceptions::Ptr{MlirOperation})::Cvoid end """ @@ -2091,9 +1943,7 @@ end Prints a location by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirTypePrint(type, callback, userData) - @ccall mlir_c.mlirTypePrint( - type::MlirType, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirTypePrint(type::MlirType, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -2111,9 +1961,7 @@ end Parses an attribute. The attribute is owned by the context. """ function mlirAttributeParseGet(context, attr) - @ccall mlir_c.mlirAttributeParseGet( - context::MlirContext, attr::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirAttributeParseGet(context::MlirContext, attr::MlirStringRef)::MlirAttribute end """ @@ -2176,9 +2024,7 @@ end Prints an attribute by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirAttributePrint(attr, callback, userData) - @ccall mlir_c.mlirAttributePrint( - attr::MlirAttribute, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirAttributePrint(attr::MlirAttribute, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -2196,9 +2042,7 @@ end Associates an attribute with the name. Takes ownership of neither. """ function mlirNamedAttributeGet(name, attr) - @ccall mlir_c.mlirNamedAttributeGet( - name::MlirIdentifier, attr::MlirAttribute - )::MlirNamedAttribute + @ccall mlir_c.mlirNamedAttributeGet(name::MlirIdentifier, attr::MlirAttribute)::MlirNamedAttribute end """ @@ -2207,9 +2051,7 @@ end Gets an identifier with the given string value. """ function mlirIdentifierGet(context, str) - @ccall mlir_c.mlirIdentifierGet( - context::MlirContext, str::MlirStringRef - )::MlirIdentifier + @ccall mlir_c.mlirIdentifierGet(context::MlirContext, str::MlirStringRef)::MlirIdentifier end """ @@ -2290,9 +2132,7 @@ end 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. """ function mlirSymbolTableLookup(symbolTable, name) - @ccall mlir_c.mlirSymbolTableLookup( - symbolTable::MlirSymbolTable, name::MlirStringRef - )::MlirOperation + @ccall mlir_c.mlirSymbolTableLookup(symbolTable::MlirSymbolTable, name::MlirStringRef)::MlirOperation end """ @@ -2301,9 +2141,7 @@ end 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. """ function mlirSymbolTableInsert(symbolTable, operation) - @ccall mlir_c.mlirSymbolTableInsert( - symbolTable::MlirSymbolTable, operation::MlirOperation - )::MlirAttribute + @ccall mlir_c.mlirSymbolTableInsert(symbolTable::MlirSymbolTable, operation::MlirOperation)::MlirAttribute end """ @@ -2312,9 +2150,7 @@ end Removes the given operation from the symbol table and erases it. """ function mlirSymbolTableErase(symbolTable, operation) - @ccall mlir_c.mlirSymbolTableErase( - symbolTable::MlirSymbolTable, operation::MlirOperation - )::Cvoid + @ccall mlir_c.mlirSymbolTableErase(symbolTable::MlirSymbolTable, operation::MlirOperation)::Cvoid end """ @@ -2323,9 +2159,7 @@ end 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. """ function mlirSymbolTableReplaceAllSymbolUses(oldSymbol, newSymbol, from) - @ccall mlir_c.mlirSymbolTableReplaceAllSymbolUses( - oldSymbol::MlirStringRef, newSymbol::MlirStringRef, from::MlirOperation - )::MlirLogicalResult + @ccall mlir_c.mlirSymbolTableReplaceAllSymbolUses(oldSymbol::MlirStringRef, newSymbol::MlirStringRef, from::MlirOperation)::MlirLogicalResult end """ @@ -2334,12 +2168,7 @@ end 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. """ function mlirSymbolTableWalkSymbolTables(from, allSymUsesVisible, callback, userData) - @ccall mlir_c.mlirSymbolTableWalkSymbolTables( - from::MlirOperation, - allSymUsesVisible::Bool, - callback::Ptr{Cvoid}, - userData::Ptr{Cvoid}, - )::Cvoid + @ccall mlir_c.mlirSymbolTableWalkSymbolTables(from::MlirOperation, allSymUsesVisible::Bool, callback::Ptr{Cvoid}, userData::Ptr{Cvoid})::Cvoid end struct MlirAffineExpr @@ -2379,9 +2208,7 @@ end Prints an affine expression by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirAffineExprPrint(affineExpr, callback, userData) - @ccall mlir_c.mlirAffineExprPrint( - affineExpr::MlirAffineExpr, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirAffineExprPrint(affineExpr::MlirAffineExpr, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -2426,9 +2253,7 @@ end Checks whether the given affine expression is a multiple of 'factor'. """ function mlirAffineExprIsMultipleOf(affineExpr, factor) - @ccall mlir_c.mlirAffineExprIsMultipleOf( - affineExpr::MlirAffineExpr, factor::Int64 - )::Bool + @ccall mlir_c.mlirAffineExprIsMultipleOf(affineExpr::MlirAffineExpr, factor::Int64)::Bool end """ @@ -2437,9 +2262,7 @@ end Checks whether the given affine expression involves AffineDimExpr 'position'. """ function mlirAffineExprIsFunctionOfDim(affineExpr, position) - @ccall mlir_c.mlirAffineExprIsFunctionOfDim( - affineExpr::MlirAffineExpr, position::intptr_t - )::Bool + @ccall mlir_c.mlirAffineExprIsFunctionOfDim(affineExpr::MlirAffineExpr, position::intptr_t)::Bool end struct MlirAffineMap @@ -2452,9 +2275,7 @@ end Composes the given map with the given expression. """ function mlirAffineExprCompose(affineExpr, affineMap) - @ccall mlir_c.mlirAffineExprCompose( - affineExpr::MlirAffineExpr, affineMap::MlirAffineMap - )::MlirAffineExpr + @ccall mlir_c.mlirAffineExprCompose(affineExpr::MlirAffineExpr, affineMap::MlirAffineMap)::MlirAffineExpr end """ @@ -2499,9 +2320,7 @@ end Creates an affine symbol expression with 'position' in the context. """ function mlirAffineSymbolExprGet(ctx, position) - @ccall mlir_c.mlirAffineSymbolExprGet( - ctx::MlirContext, position::intptr_t - )::MlirAffineExpr + @ccall mlir_c.mlirAffineSymbolExprGet(ctx::MlirContext, position::intptr_t)::MlirAffineExpr end """ @@ -2528,9 +2347,7 @@ end Creates an affine constant expression with 'constant' in the context. """ function mlirAffineConstantExprGet(ctx, constant) - @ccall mlir_c.mlirAffineConstantExprGet( - ctx::MlirContext, constant::Int64 - )::MlirAffineExpr + @ccall mlir_c.mlirAffineConstantExprGet(ctx::MlirContext, constant::Int64)::MlirAffineExpr end """ @@ -2557,9 +2374,7 @@ end Creates an affine add expression with 'lhs' and 'rhs'. """ function mlirAffineAddExprGet(lhs, rhs) - @ccall mlir_c.mlirAffineAddExprGet( - lhs::MlirAffineExpr, rhs::MlirAffineExpr - )::MlirAffineExpr + @ccall mlir_c.mlirAffineAddExprGet(lhs::MlirAffineExpr, rhs::MlirAffineExpr)::MlirAffineExpr end """ @@ -2577,9 +2392,7 @@ end Creates an affine mul expression with 'lhs' and 'rhs'. """ function mlirAffineMulExprGet(lhs, rhs) - @ccall mlir_c.mlirAffineMulExprGet( - lhs::MlirAffineExpr, rhs::MlirAffineExpr - )::MlirAffineExpr + @ccall mlir_c.mlirAffineMulExprGet(lhs::MlirAffineExpr, rhs::MlirAffineExpr)::MlirAffineExpr end """ @@ -2597,9 +2410,7 @@ end Creates an affine mod expression with 'lhs' and 'rhs'. """ function mlirAffineModExprGet(lhs, rhs) - @ccall mlir_c.mlirAffineModExprGet( - lhs::MlirAffineExpr, rhs::MlirAffineExpr - )::MlirAffineExpr + @ccall mlir_c.mlirAffineModExprGet(lhs::MlirAffineExpr, rhs::MlirAffineExpr)::MlirAffineExpr end """ @@ -2617,9 +2428,7 @@ end Creates an affine floordiv expression with 'lhs' and 'rhs'. """ function mlirAffineFloorDivExprGet(lhs, rhs) - @ccall mlir_c.mlirAffineFloorDivExprGet( - lhs::MlirAffineExpr, rhs::MlirAffineExpr - )::MlirAffineExpr + @ccall mlir_c.mlirAffineFloorDivExprGet(lhs::MlirAffineExpr, rhs::MlirAffineExpr)::MlirAffineExpr end """ @@ -2637,9 +2446,7 @@ end Creates an affine ceildiv expression with 'lhs' and 'rhs'. """ function mlirAffineCeilDivExprGet(lhs, rhs) - @ccall mlir_c.mlirAffineCeilDivExprGet( - lhs::MlirAffineExpr, rhs::MlirAffineExpr - )::MlirAffineExpr + @ccall mlir_c.mlirAffineCeilDivExprGet(lhs::MlirAffineExpr, rhs::MlirAffineExpr)::MlirAffineExpr end """ @@ -2702,9 +2509,7 @@ end Prints an affine map by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirAffineMapPrint(affineMap, callback, userData) - @ccall mlir_c.mlirAffineMapPrint( - affineMap::MlirAffineMap, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirAffineMapPrint(affineMap::MlirAffineMap, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -2731,9 +2536,7 @@ end Creates a zero result affine map of the given dimensions and symbols in the context. The affine map is owned by the context. """ function mlirAffineMapZeroResultGet(ctx, dimCount, symbolCount) - @ccall mlir_c.mlirAffineMapZeroResultGet( - ctx::MlirContext, dimCount::intptr_t, symbolCount::intptr_t - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapZeroResultGet(ctx::MlirContext, dimCount::intptr_t, symbolCount::intptr_t)::MlirAffineMap end """ @@ -2742,13 +2545,7 @@ end 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. """ function mlirAffineMapGet(ctx, dimCount, symbolCount, nAffineExprs, affineExprs) - @ccall mlir_c.mlirAffineMapGet( - ctx::MlirContext, - dimCount::intptr_t, - symbolCount::intptr_t, - nAffineExprs::intptr_t, - affineExprs::Ptr{MlirAffineExpr}, - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapGet(ctx::MlirContext, dimCount::intptr_t, symbolCount::intptr_t, nAffineExprs::intptr_t, affineExprs::Ptr{MlirAffineExpr})::MlirAffineMap end """ @@ -2766,9 +2563,7 @@ end Creates an affine map with 'numDims' identity in the context. The affine map is owned by the context. """ function mlirAffineMapMultiDimIdentityGet(ctx, numDims) - @ccall mlir_c.mlirAffineMapMultiDimIdentityGet( - ctx::MlirContext, numDims::intptr_t - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapMultiDimIdentityGet(ctx::MlirContext, numDims::intptr_t)::MlirAffineMap end """ @@ -2777,9 +2572,7 @@ end 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. """ function mlirAffineMapMinorIdentityGet(ctx, dims, results) - @ccall mlir_c.mlirAffineMapMinorIdentityGet( - ctx::MlirContext, dims::intptr_t, results::intptr_t - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapMinorIdentityGet(ctx::MlirContext, dims::intptr_t, results::intptr_t)::MlirAffineMap end """ @@ -2788,9 +2581,7 @@ end 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. """ function mlirAffineMapPermutationGet(ctx, size, permutation) - @ccall mlir_c.mlirAffineMapPermutationGet( - ctx::MlirContext, size::intptr_t, permutation::Ptr{Cuint} - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapPermutationGet(ctx::MlirContext, size::intptr_t, permutation::Ptr{Cuint})::MlirAffineMap end """ @@ -2871,9 +2662,7 @@ end Returns the result at the given position. """ function mlirAffineMapGetResult(affineMap, pos) - @ccall mlir_c.mlirAffineMapGetResult( - affineMap::MlirAffineMap, pos::intptr_t - )::MlirAffineExpr + @ccall mlir_c.mlirAffineMapGetResult(affineMap::MlirAffineMap, pos::intptr_t)::MlirAffineExpr end """ @@ -2909,9 +2698,7 @@ end Returns the affine map consisting of the `resultPos` subset. """ function mlirAffineMapGetSubMap(affineMap, size, resultPos) - @ccall mlir_c.mlirAffineMapGetSubMap( - affineMap::MlirAffineMap, size::intptr_t, resultPos::Ptr{intptr_t} - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapGetSubMap(affineMap::MlirAffineMap, size::intptr_t, resultPos::Ptr{intptr_t})::MlirAffineMap end """ @@ -2920,9 +2707,7 @@ end 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. """ function mlirAffineMapGetMajorSubMap(affineMap, numResults) - @ccall mlir_c.mlirAffineMapGetMajorSubMap( - affineMap::MlirAffineMap, numResults::intptr_t - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapGetMajorSubMap(affineMap::MlirAffineMap, numResults::intptr_t)::MlirAffineMap end """ @@ -2931,9 +2716,7 @@ end 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. """ function mlirAffineMapGetMinorSubMap(affineMap, numResults) - @ccall mlir_c.mlirAffineMapGetMinorSubMap( - affineMap::MlirAffineMap, numResults::intptr_t - )::MlirAffineMap + @ccall mlir_c.mlirAffineMapGetMinorSubMap(affineMap::MlirAffineMap, numResults::intptr_t)::MlirAffineMap end """ @@ -2941,16 +2724,8 @@ end 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. """ -function mlirAffineMapReplace( - affineMap, expression, replacement, numResultDims, numResultSyms -) - @ccall mlir_c.mlirAffineMapReplace( - affineMap::MlirAffineMap, - expression::MlirAffineExpr, - replacement::MlirAffineExpr, - numResultDims::intptr_t, - numResultSyms::intptr_t, - )::MlirAffineMap +function mlirAffineMapReplace(affineMap, expression, replacement, numResultDims, numResultSyms) + @ccall mlir_c.mlirAffineMapReplace(affineMap::MlirAffineMap, expression::MlirAffineExpr, replacement::MlirAffineExpr, numResultDims::intptr_t, numResultSyms::intptr_t)::MlirAffineMap end """ @@ -2959,12 +2734,7 @@ end 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. """ function mlirAffineMapCompressUnusedSymbols(affineMaps, size, result, populateResult) - @ccall mlir_c.mlirAffineMapCompressUnusedSymbols( - affineMaps::Ptr{MlirAffineMap}, - size::intptr_t, - result::Ptr{Cvoid}, - populateResult::Ptr{Cvoid}, - )::Cvoid + @ccall mlir_c.mlirAffineMapCompressUnusedSymbols(affineMaps::Ptr{MlirAffineMap}, size::intptr_t, result::Ptr{Cvoid}, populateResult::Ptr{Cvoid})::Cvoid end struct MlirIntegerSet @@ -3004,9 +2774,7 @@ end Prints an integer set by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirIntegerSetPrint(set, callback, userData) - @ccall mlir_c.mlirIntegerSetPrint( - set::MlirIntegerSet, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirIntegerSetPrint(set::MlirIntegerSet, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -3024,9 +2792,7 @@ end Gets or creates a new canonically empty integer set with the give number of dimensions and symbols in the given context. """ function mlirIntegerSetEmptyGet(context, numDims, numSymbols) - @ccall mlir_c.mlirIntegerSetEmptyGet( - context::MlirContext, numDims::intptr_t, numSymbols::intptr_t - )::MlirIntegerSet + @ccall mlir_c.mlirIntegerSetEmptyGet(context::MlirContext, numDims::intptr_t, numSymbols::intptr_t)::MlirIntegerSet end """ @@ -3034,17 +2800,8 @@ end 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. """ -function mlirIntegerSetGet( - context, numDims, numSymbols, numConstraints, constraints, eqFlags -) - @ccall mlir_c.mlirIntegerSetGet( - context::MlirContext, - numDims::intptr_t, - numSymbols::intptr_t, - numConstraints::intptr_t, - constraints::Ptr{MlirAffineExpr}, - eqFlags::Ptr{Bool}, - )::MlirIntegerSet +function mlirIntegerSetGet(context, numDims, numSymbols, numConstraints, constraints, eqFlags) + @ccall mlir_c.mlirIntegerSetGet(context::MlirContext, numDims::intptr_t, numSymbols::intptr_t, numConstraints::intptr_t, constraints::Ptr{MlirAffineExpr}, eqFlags::Ptr{Bool})::MlirIntegerSet end """ @@ -3052,16 +2809,8 @@ end 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. """ -function mlirIntegerSetReplaceGet( - set, dimReplacements, symbolReplacements, numResultDims, numResultSymbols -) - @ccall mlir_c.mlirIntegerSetReplaceGet( - set::MlirIntegerSet, - dimReplacements::Ptr{MlirAffineExpr}, - symbolReplacements::Ptr{MlirAffineExpr}, - numResultDims::intptr_t, - numResultSymbols::intptr_t, - )::MlirIntegerSet +function mlirIntegerSetReplaceGet(set, dimReplacements, symbolReplacements, numResultDims, numResultSymbols) + @ccall mlir_c.mlirIntegerSetReplaceGet(set::MlirIntegerSet, dimReplacements::Ptr{MlirAffineExpr}, symbolReplacements::Ptr{MlirAffineExpr}, numResultDims::intptr_t, numResultSymbols::intptr_t)::MlirIntegerSet end """ @@ -3133,9 +2882,7 @@ end Returns `pos`-th constraint of the set. """ function mlirIntegerSetGetConstraint(set, pos) - @ccall mlir_c.mlirIntegerSetGetConstraint( - set::MlirIntegerSet, pos::intptr_t - )::MlirAffineExpr + @ccall mlir_c.mlirIntegerSetGetConstraint(set::MlirIntegerSet, pos::intptr_t)::MlirAffineExpr end """ @@ -3211,9 +2958,7 @@ end Creates an array element containing the given list of elements in the given context. """ function mlirArrayAttrGet(ctx, numElements, elements) - @ccall mlir_c.mlirArrayAttrGet( - ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirAttribute} - )::MlirAttribute + @ccall mlir_c.mlirArrayAttrGet(ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirAttribute})::MlirAttribute end """ @@ -3258,9 +3003,7 @@ end Creates a dictionary attribute containing the given list of elements in the provided context. """ function mlirDictionaryAttrGet(ctx, numElements, elements) - @ccall mlir_c.mlirDictionaryAttrGet( - ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirNamedAttribute} - )::MlirAttribute + @ccall mlir_c.mlirDictionaryAttrGet(ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirNamedAttribute})::MlirAttribute end """ @@ -3278,9 +3021,7 @@ end Returns pos-th element of the given dictionary attribute. """ function mlirDictionaryAttrGetElement(attr, pos) - @ccall mlir_c.mlirDictionaryAttrGetElement( - attr::MlirAttribute, pos::intptr_t - )::MlirNamedAttribute + @ccall mlir_c.mlirDictionaryAttrGetElement(attr::MlirAttribute, pos::intptr_t)::MlirNamedAttribute end """ @@ -3289,9 +3030,7 @@ end Returns the dictionary attribute element with the given name or NULL if the given name does not exist in the dictionary. """ function mlirDictionaryAttrGetElementByName(attr, name) - @ccall mlir_c.mlirDictionaryAttrGetElementByName( - attr::MlirAttribute, name::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirDictionaryAttrGetElementByName(attr::MlirAttribute, name::MlirStringRef)::MlirAttribute end """ @@ -3318,9 +3057,7 @@ end Creates a floating point attribute in the given context with the given double value and double-precision FP semantics. """ function mlirFloatAttrDoubleGet(ctx, type, value) - @ccall mlir_c.mlirFloatAttrDoubleGet( - ctx::MlirContext, type::MlirType, value::Cdouble - )::MlirAttribute + @ccall mlir_c.mlirFloatAttrDoubleGet(ctx::MlirContext, type::MlirType, value::Cdouble)::MlirAttribute end """ @@ -3329,9 +3066,7 @@ end Same as "[`mlirFloatAttrDoubleGet`](@ref)", but if the type is not valid for a construction of a FloatAttr, returns a null [`MlirAttribute`](@ref). """ function mlirFloatAttrDoubleGetChecked(loc, type, value) - @ccall mlir_c.mlirFloatAttrDoubleGetChecked( - loc::MlirLocation, type::MlirType, value::Cdouble - )::MlirAttribute + @ccall mlir_c.mlirFloatAttrDoubleGetChecked(loc::MlirLocation, type::MlirType, value::Cdouble)::MlirAttribute end """ @@ -3484,13 +3219,7 @@ end 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). """ function mlirOpaqueAttrGet(ctx, dialectNamespace, dataLength, data, type) - @ccall mlir_c.mlirOpaqueAttrGet( - ctx::MlirContext, - dialectNamespace::MlirStringRef, - dataLength::intptr_t, - data::Cstring, - type::MlirType, - )::MlirAttribute + @ccall mlir_c.mlirOpaqueAttrGet(ctx::MlirContext, dialectNamespace::MlirStringRef, dataLength::intptr_t, data::Cstring, type::MlirType)::MlirAttribute end """ @@ -3580,12 +3309,7 @@ end 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. """ function mlirSymbolRefAttrGet(ctx, symbol, numReferences, references) - @ccall mlir_c.mlirSymbolRefAttrGet( - ctx::MlirContext, - symbol::MlirStringRef, - numReferences::intptr_t, - references::Ptr{MlirAttribute}, - )::MlirAttribute + @ccall mlir_c.mlirSymbolRefAttrGet(ctx::MlirContext, symbol::MlirStringRef, numReferences::intptr_t, references::Ptr{MlirAttribute})::MlirAttribute end """ @@ -3621,9 +3345,7 @@ end Returns pos-th reference nested in the given symbol reference attribute. """ function mlirSymbolRefAttrGetNestedReference(attr, pos) - @ccall mlir_c.mlirSymbolRefAttrGetNestedReference( - attr::MlirAttribute, pos::intptr_t - )::MlirAttribute + @ccall mlir_c.mlirSymbolRefAttrGetNestedReference(attr::MlirAttribute, pos::intptr_t)::MlirAttribute end """ @@ -3659,9 +3381,7 @@ end Creates a flat symbol reference attribute in the given context referencing a symbol identified by the given string. """ function mlirFlatSymbolRefAttrGet(ctx, symbol) - @ccall mlir_c.mlirFlatSymbolRefAttrGet( - ctx::MlirContext, symbol::MlirStringRef - )::MlirAttribute + @ccall mlir_c.mlirFlatSymbolRefAttrGet(ctx::MlirContext, symbol::MlirStringRef)::MlirAttribute end """ @@ -3751,9 +3471,7 @@ end Returns the element at the given rank-dimensional index. """ function mlirElementsAttrGetValue(attr, rank, idxs) - @ccall mlir_c.mlirElementsAttrGetValue( - attr::MlirAttribute, rank::intptr_t, idxs::Ptr{UInt64} - )::MlirAttribute + @ccall mlir_c.mlirElementsAttrGetValue(attr::MlirAttribute, rank::intptr_t, idxs::Ptr{UInt64})::MlirAttribute end """ @@ -3762,9 +3480,7 @@ end Checks whether the given rank-dimensional index is valid in the given elements attribute. """ function mlirElementsAttrIsValidIndex(attr, rank, idxs) - @ccall mlir_c.mlirElementsAttrIsValidIndex( - attr::MlirAttribute, rank::intptr_t, idxs::Ptr{UInt64} - )::Bool + @ccall mlir_c.mlirElementsAttrIsValidIndex(attr::MlirAttribute, rank::intptr_t, idxs::Ptr{UInt64})::Bool end """ @@ -3819,45 +3535,31 @@ end Create a dense array attribute with the given elements. """ function mlirDenseBoolArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseBoolArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Cint} - )::MlirAttribute + @ccall mlir_c.mlirDenseBoolArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Cint})::MlirAttribute end function mlirDenseI8ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseI8ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Int8} - )::MlirAttribute + @ccall mlir_c.mlirDenseI8ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Int8})::MlirAttribute end function mlirDenseI16ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseI16ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Int16} - )::MlirAttribute + @ccall mlir_c.mlirDenseI16ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Int16})::MlirAttribute end function mlirDenseI32ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseI32ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Int32} - )::MlirAttribute + @ccall mlir_c.mlirDenseI32ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Int32})::MlirAttribute end function mlirDenseI64ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseI64ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Int64} - )::MlirAttribute + @ccall mlir_c.mlirDenseI64ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Int64})::MlirAttribute end function mlirDenseF32ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseF32ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Cfloat} - )::MlirAttribute + @ccall mlir_c.mlirDenseF32ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Cfloat})::MlirAttribute end function mlirDenseF64ArrayGet(ctx, size, values) - @ccall mlir_c.mlirDenseF64ArrayGet( - ctx::MlirContext, size::intptr_t, values::Ptr{Cdouble} - )::MlirAttribute + @ccall mlir_c.mlirDenseF64ArrayGet(ctx::MlirContext, size::intptr_t, values::Ptr{Cdouble})::MlirAttribute end """ @@ -3934,9 +3636,7 @@ end Creates a dense elements attribute with the given Shaped type and elements in the same context as the type. """ function mlirDenseElementsAttrGet(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrGet( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{MlirAttribute} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrGet(shapedType::MlirType, numElements::intptr_t, elements::Ptr{MlirAttribute})::MlirAttribute end """ @@ -3949,9 +3649,7 @@ The format of the raw buffer is a densely packed array of values that can be bit 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. """ function mlirDenseElementsAttrRawBufferGet(shapedType, rawBufferSize, rawBuffer) - @ccall mlir_c.mlirDenseElementsAttrRawBufferGet( - shapedType::MlirType, rawBufferSize::Csize_t, rawBuffer::Ptr{Cvoid} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrRawBufferGet(shapedType::MlirType, rawBufferSize::Csize_t, rawBuffer::Ptr{Cvoid})::MlirAttribute end """ @@ -3960,63 +3658,43 @@ end Creates a dense elements attribute with the given Shaped type containing a single replicated element (splat). """ function mlirDenseElementsAttrSplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrSplatGet( - shapedType::MlirType, element::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrSplatGet(shapedType::MlirType, element::MlirAttribute)::MlirAttribute end function mlirDenseElementsAttrBoolSplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrBoolSplatGet( - shapedType::MlirType, element::Bool - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrBoolSplatGet(shapedType::MlirType, element::Bool)::MlirAttribute end function mlirDenseElementsAttrUInt8SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrUInt8SplatGet( - shapedType::MlirType, element::UInt8 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt8SplatGet(shapedType::MlirType, element::UInt8)::MlirAttribute end function mlirDenseElementsAttrInt8SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrInt8SplatGet( - shapedType::MlirType, element::Int8 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt8SplatGet(shapedType::MlirType, element::Int8)::MlirAttribute end function mlirDenseElementsAttrUInt32SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrUInt32SplatGet( - shapedType::MlirType, element::UInt32 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt32SplatGet(shapedType::MlirType, element::UInt32)::MlirAttribute end function mlirDenseElementsAttrInt32SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrInt32SplatGet( - shapedType::MlirType, element::Int32 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt32SplatGet(shapedType::MlirType, element::Int32)::MlirAttribute end function mlirDenseElementsAttrUInt64SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrUInt64SplatGet( - shapedType::MlirType, element::UInt64 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt64SplatGet(shapedType::MlirType, element::UInt64)::MlirAttribute end function mlirDenseElementsAttrInt64SplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrInt64SplatGet( - shapedType::MlirType, element::Int64 - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt64SplatGet(shapedType::MlirType, element::Int64)::MlirAttribute end function mlirDenseElementsAttrFloatSplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrFloatSplatGet( - shapedType::MlirType, element::Cfloat - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrFloatSplatGet(shapedType::MlirType, element::Cfloat)::MlirAttribute end function mlirDenseElementsAttrDoubleSplatGet(shapedType, element) - @ccall mlir_c.mlirDenseElementsAttrDoubleSplatGet( - shapedType::MlirType, element::Cdouble - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrDoubleSplatGet(shapedType::MlirType, element::Cdouble)::MlirAttribute end """ @@ -4025,81 +3703,55 @@ end 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. """ function mlirDenseElementsAttrBoolGet(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrBoolGet( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cint} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrBoolGet(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cint})::MlirAttribute end function mlirDenseElementsAttrUInt8Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrUInt8Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt8} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt8Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt8})::MlirAttribute end function mlirDenseElementsAttrInt8Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrInt8Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int8} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt8Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int8})::MlirAttribute end function mlirDenseElementsAttrUInt16Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrUInt16Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt16Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16})::MlirAttribute end function mlirDenseElementsAttrInt16Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrInt16Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int16} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt16Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int16})::MlirAttribute end function mlirDenseElementsAttrUInt32Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrUInt32Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt32} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt32Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt32})::MlirAttribute end function mlirDenseElementsAttrInt32Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrInt32Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int32} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt32Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int32})::MlirAttribute end function mlirDenseElementsAttrUInt64Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrUInt64Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt64} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrUInt64Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt64})::MlirAttribute end function mlirDenseElementsAttrInt64Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrInt64Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int64} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrInt64Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Int64})::MlirAttribute end function mlirDenseElementsAttrFloatGet(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrFloatGet( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cfloat} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrFloatGet(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cfloat})::MlirAttribute end function mlirDenseElementsAttrDoubleGet(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrDoubleGet( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cdouble} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrDoubleGet(shapedType::MlirType, numElements::intptr_t, elements::Ptr{Cdouble})::MlirAttribute end function mlirDenseElementsAttrBFloat16Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrBFloat16Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrBFloat16Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16})::MlirAttribute end function mlirDenseElementsAttrFloat16Get(shapedType, numElements, elements) - @ccall mlir_c.mlirDenseElementsAttrFloat16Get( - shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrFloat16Get(shapedType::MlirType, numElements::intptr_t, elements::Ptr{UInt16})::MlirAttribute end """ @@ -4108,9 +3760,7 @@ end Creates a dense elements attribute with the given shaped type from string elements. """ function mlirDenseElementsAttrStringGet(shapedType, numElements, strs) - @ccall mlir_c.mlirDenseElementsAttrStringGet( - shapedType::MlirType, numElements::intptr_t, strs::Ptr{MlirStringRef} - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrStringGet(shapedType::MlirType, numElements::intptr_t, strs::Ptr{MlirStringRef})::MlirAttribute end """ @@ -4119,9 +3769,7 @@ end 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. """ function mlirDenseElementsAttrReshapeGet(attr, shapedType) - @ccall mlir_c.mlirDenseElementsAttrReshapeGet( - attr::MlirAttribute, shapedType::MlirType - )::MlirAttribute + @ccall mlir_c.mlirDenseElementsAttrReshapeGet(attr::MlirAttribute, shapedType::MlirType)::MlirAttribute end """ @@ -4179,9 +3827,7 @@ function mlirDenseElementsAttrGetDoubleSplatValue(attr) end function mlirDenseElementsAttrGetStringSplatValue(attr) - @ccall mlir_c.mlirDenseElementsAttrGetStringSplatValue( - attr::MlirAttribute - )::MlirStringRef + @ccall mlir_c.mlirDenseElementsAttrGetStringSplatValue(attr::MlirAttribute)::MlirStringRef end """ @@ -4190,75 +3836,51 @@ end Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense elements attribute. """ function mlirDenseElementsAttrGetBoolValue(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetBoolValue( - attr::MlirAttribute, pos::intptr_t - )::Bool + @ccall mlir_c.mlirDenseElementsAttrGetBoolValue(attr::MlirAttribute, pos::intptr_t)::Bool end function mlirDenseElementsAttrGetInt8Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetInt8Value( - attr::MlirAttribute, pos::intptr_t - )::Int8 + @ccall mlir_c.mlirDenseElementsAttrGetInt8Value(attr::MlirAttribute, pos::intptr_t)::Int8 end function mlirDenseElementsAttrGetUInt8Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetUInt8Value( - attr::MlirAttribute, pos::intptr_t - )::UInt8 + @ccall mlir_c.mlirDenseElementsAttrGetUInt8Value(attr::MlirAttribute, pos::intptr_t)::UInt8 end function mlirDenseElementsAttrGetInt16Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetInt16Value( - attr::MlirAttribute, pos::intptr_t - )::Int16 + @ccall mlir_c.mlirDenseElementsAttrGetInt16Value(attr::MlirAttribute, pos::intptr_t)::Int16 end function mlirDenseElementsAttrGetUInt16Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetUInt16Value( - attr::MlirAttribute, pos::intptr_t - )::UInt16 + @ccall mlir_c.mlirDenseElementsAttrGetUInt16Value(attr::MlirAttribute, pos::intptr_t)::UInt16 end function mlirDenseElementsAttrGetInt32Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetInt32Value( - attr::MlirAttribute, pos::intptr_t - )::Int32 + @ccall mlir_c.mlirDenseElementsAttrGetInt32Value(attr::MlirAttribute, pos::intptr_t)::Int32 end function mlirDenseElementsAttrGetUInt32Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetUInt32Value( - attr::MlirAttribute, pos::intptr_t - )::UInt32 + @ccall mlir_c.mlirDenseElementsAttrGetUInt32Value(attr::MlirAttribute, pos::intptr_t)::UInt32 end function mlirDenseElementsAttrGetInt64Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetInt64Value( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.mlirDenseElementsAttrGetInt64Value(attr::MlirAttribute, pos::intptr_t)::Int64 end function mlirDenseElementsAttrGetUInt64Value(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetUInt64Value( - attr::MlirAttribute, pos::intptr_t - )::UInt64 + @ccall mlir_c.mlirDenseElementsAttrGetUInt64Value(attr::MlirAttribute, pos::intptr_t)::UInt64 end function mlirDenseElementsAttrGetFloatValue(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetFloatValue( - attr::MlirAttribute, pos::intptr_t - )::Cfloat + @ccall mlir_c.mlirDenseElementsAttrGetFloatValue(attr::MlirAttribute, pos::intptr_t)::Cfloat end function mlirDenseElementsAttrGetDoubleValue(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetDoubleValue( - attr::MlirAttribute, pos::intptr_t - )::Cdouble + @ccall mlir_c.mlirDenseElementsAttrGetDoubleValue(attr::MlirAttribute, pos::intptr_t)::Cdouble end function mlirDenseElementsAttrGetStringValue(attr, pos) - @ccall mlir_c.mlirDenseElementsAttrGetStringValue( - attr::MlirAttribute, pos::intptr_t - )::MlirStringRef + @ccall mlir_c.mlirDenseElementsAttrGetStringValue(attr::MlirAttribute, pos::intptr_t)::MlirStringRef end """ @@ -4279,140 +3901,52 @@ end 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). """ -function mlirUnmanagedDenseResourceElementsAttrGet( - shapedType, name, data, dataLength, dataAlignment, dataIsMutable, deleter, userData -) - @ccall mlir_c.mlirUnmanagedDenseResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - data::Ptr{Cvoid}, - dataLength::Csize_t, - dataAlignment::Csize_t, - dataIsMutable::Bool, - deleter::Ptr{Cvoid}, - userData::Ptr{Cvoid}, - )::MlirAttribute -end - -function mlirUnmanagedDenseBoolResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseBoolResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Cint}, - )::MlirAttribute -end - -function mlirUnmanagedDenseUInt8ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseUInt8ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{UInt8}, - )::MlirAttribute -end - -function mlirUnmanagedDenseInt8ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseInt8ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Int8}, - )::MlirAttribute -end - -function mlirUnmanagedDenseUInt16ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseUInt16ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{UInt16}, - )::MlirAttribute -end - -function mlirUnmanagedDenseInt16ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseInt16ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Int16}, - )::MlirAttribute -end - -function mlirUnmanagedDenseUInt32ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseUInt32ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{UInt32}, - )::MlirAttribute -end - -function mlirUnmanagedDenseInt32ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseInt32ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Int32}, - )::MlirAttribute -end - -function mlirUnmanagedDenseUInt64ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseUInt64ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{UInt64}, - )::MlirAttribute -end - -function mlirUnmanagedDenseInt64ResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseInt64ResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Int64}, - )::MlirAttribute -end - -function mlirUnmanagedDenseFloatResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseFloatResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Cfloat}, - )::MlirAttribute -end - -function mlirUnmanagedDenseDoubleResourceElementsAttrGet( - shapedType, name, numElements, elements -) - @ccall mlir_c.mlirUnmanagedDenseDoubleResourceElementsAttrGet( - shapedType::MlirType, - name::MlirStringRef, - numElements::intptr_t, - elements::Ptr{Cdouble}, - )::MlirAttribute +function mlirUnmanagedDenseResourceElementsAttrGet(shapedType, name, data, dataLength, dataAlignment, dataIsMutable, deleter, userData) + @ccall mlir_c.mlirUnmanagedDenseResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, data::Ptr{Cvoid}, dataLength::Csize_t, dataAlignment::Csize_t, dataIsMutable::Bool, deleter::Ptr{Cvoid}, userData::Ptr{Cvoid})::MlirAttribute +end + +function mlirUnmanagedDenseBoolResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseBoolResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Cint})::MlirAttribute +end + +function mlirUnmanagedDenseUInt8ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseUInt8ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{UInt8})::MlirAttribute +end + +function mlirUnmanagedDenseInt8ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseInt8ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Int8})::MlirAttribute +end + +function mlirUnmanagedDenseUInt16ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseUInt16ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{UInt16})::MlirAttribute +end + +function mlirUnmanagedDenseInt16ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseInt16ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Int16})::MlirAttribute +end + +function mlirUnmanagedDenseUInt32ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseUInt32ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{UInt32})::MlirAttribute +end + +function mlirUnmanagedDenseInt32ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseInt32ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Int32})::MlirAttribute +end + +function mlirUnmanagedDenseUInt64ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseUInt64ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{UInt64})::MlirAttribute +end + +function mlirUnmanagedDenseInt64ResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseInt64ResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Int64})::MlirAttribute +end + +function mlirUnmanagedDenseFloatResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseFloatResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Cfloat})::MlirAttribute +end + +function mlirUnmanagedDenseDoubleResourceElementsAttrGet(shapedType, name, numElements, elements) + @ccall mlir_c.mlirUnmanagedDenseDoubleResourceElementsAttrGet(shapedType::MlirType, name::MlirStringRef, numElements::intptr_t, elements::Ptr{Cdouble})::MlirAttribute end """ @@ -4421,69 +3955,47 @@ end Returns the pos-th value (flat contiguous indexing) of a specific type contained by the given dense resource elements attribute. """ function mlirDenseBoolResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseBoolResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Bool + @ccall mlir_c.mlirDenseBoolResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Bool end function mlirDenseInt8ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseInt8ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Int8 + @ccall mlir_c.mlirDenseInt8ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Int8 end function mlirDenseUInt8ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseUInt8ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::UInt8 + @ccall mlir_c.mlirDenseUInt8ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::UInt8 end function mlirDenseInt16ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseInt16ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Int16 + @ccall mlir_c.mlirDenseInt16ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Int16 end function mlirDenseUInt16ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseUInt16ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::UInt16 + @ccall mlir_c.mlirDenseUInt16ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::UInt16 end function mlirDenseInt32ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseInt32ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Int32 + @ccall mlir_c.mlirDenseInt32ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Int32 end function mlirDenseUInt32ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseUInt32ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::UInt32 + @ccall mlir_c.mlirDenseUInt32ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::UInt32 end function mlirDenseInt64ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseInt64ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.mlirDenseInt64ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Int64 end function mlirDenseUInt64ResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseUInt64ResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::UInt64 + @ccall mlir_c.mlirDenseUInt64ResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::UInt64 end function mlirDenseFloatResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseFloatResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Cfloat + @ccall mlir_c.mlirDenseFloatResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Cfloat end function mlirDenseDoubleResourceElementsAttrGetValue(attr, pos) - @ccall mlir_c.mlirDenseDoubleResourceElementsAttrGetValue( - attr::MlirAttribute, pos::intptr_t - )::Cdouble + @ccall mlir_c.mlirDenseDoubleResourceElementsAttrGetValue(attr::MlirAttribute, pos::intptr_t)::Cdouble end """ @@ -4501,9 +4013,7 @@ end 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. """ function mlirSparseElementsAttribute(shapedType, denseIndices, denseValues) - @ccall mlir_c.mlirSparseElementsAttribute( - shapedType::MlirType, denseIndices::MlirAttribute, denseValues::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirSparseElementsAttribute(shapedType::MlirType, denseIndices::MlirAttribute, denseValues::MlirAttribute)::MlirAttribute end """ @@ -4538,9 +4048,7 @@ function mlirAttributeIsAStridedLayout(attr) end function mlirStridedLayoutAttrGet(ctx, offset, numStrides, strides) - @ccall mlir_c.mlirStridedLayoutAttrGet( - ctx::MlirContext, offset::Int64, numStrides::intptr_t, strides::Ptr{Int64} - )::MlirAttribute + @ccall mlir_c.mlirStridedLayoutAttrGet(ctx::MlirContext, offset::Int64, numStrides::intptr_t, strides::Ptr{Int64})::MlirAttribute end function mlirStridedLayoutAttrGetOffset(attr) @@ -5308,9 +4816,7 @@ end 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. """ function mlirVectorTypeGet(rank, shape, elementType) - @ccall mlir_c.mlirVectorTypeGet( - rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType - )::MlirType + @ccall mlir_c.mlirVectorTypeGet(rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType)::MlirType end """ @@ -5319,9 +4825,7 @@ end Same as "[`mlirVectorTypeGet`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirVectorTypeGetChecked(loc, rank, shape, elementType) - @ccall mlir_c.mlirVectorTypeGetChecked( - loc::MlirLocation, rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType - )::MlirType + @ccall mlir_c.mlirVectorTypeGetChecked(loc::MlirLocation, rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType)::MlirType end """ @@ -5330,9 +4834,7 @@ end 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. """ function mlirVectorTypeGetScalable(rank, shape, scalable, elementType) - @ccall mlir_c.mlirVectorTypeGetScalable( - rank::intptr_t, shape::Ptr{Int64}, scalable::Ptr{Bool}, elementType::MlirType - )::MlirType + @ccall mlir_c.mlirVectorTypeGetScalable(rank::intptr_t, shape::Ptr{Int64}, scalable::Ptr{Bool}, elementType::MlirType)::MlirType end """ @@ -5341,13 +4843,7 @@ end Same as "[`mlirVectorTypeGetScalable`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirVectorTypeGetScalableChecked(loc, rank, shape, scalable, elementType) - @ccall mlir_c.mlirVectorTypeGetScalableChecked( - loc::MlirLocation, - rank::intptr_t, - shape::Ptr{Int64}, - scalable::Ptr{Bool}, - elementType::MlirType, - )::MlirType + @ccall mlir_c.mlirVectorTypeGetScalableChecked(loc::MlirLocation, rank::intptr_t, shape::Ptr{Int64}, scalable::Ptr{Bool}, elementType::MlirType)::MlirType end """ @@ -5419,9 +4915,7 @@ end 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`](@ref)() to this parameter. """ function mlirRankedTensorTypeGet(rank, shape, elementType, encoding) - @ccall mlir_c.mlirRankedTensorTypeGet( - rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType, encoding::MlirAttribute - )::MlirType + @ccall mlir_c.mlirRankedTensorTypeGet(rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType, encoding::MlirAttribute)::MlirType end """ @@ -5430,13 +4924,7 @@ end Same as "[`mlirRankedTensorTypeGet`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirRankedTensorTypeGetChecked(loc, rank, shape, elementType, encoding) - @ccall mlir_c.mlirRankedTensorTypeGetChecked( - loc::MlirLocation, - rank::intptr_t, - shape::Ptr{Int64}, - elementType::MlirType, - encoding::MlirAttribute, - )::MlirType + @ccall mlir_c.mlirRankedTensorTypeGetChecked(loc::MlirLocation, rank::intptr_t, shape::Ptr{Int64}, elementType::MlirType, encoding::MlirAttribute)::MlirType end """ @@ -5463,9 +4951,7 @@ end Same as "[`mlirUnrankedTensorTypeGet`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirUnrankedTensorTypeGetChecked(loc, elementType) - @ccall mlir_c.mlirUnrankedTensorTypeGetChecked( - loc::MlirLocation, elementType::MlirType - )::MlirType + @ccall mlir_c.mlirUnrankedTensorTypeGetChecked(loc::MlirLocation, elementType::MlirType)::MlirType end """ @@ -5510,13 +4996,7 @@ end 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. """ function mlirMemRefTypeGet(elementType, rank, shape, layout, memorySpace) - @ccall mlir_c.mlirMemRefTypeGet( - elementType::MlirType, - rank::intptr_t, - shape::Ptr{Int64}, - layout::MlirAttribute, - memorySpace::MlirAttribute, - )::MlirType + @ccall mlir_c.mlirMemRefTypeGet(elementType::MlirType, rank::intptr_t, shape::Ptr{Int64}, layout::MlirAttribute, memorySpace::MlirAttribute)::MlirType end """ @@ -5525,14 +5005,7 @@ end Same as "[`mlirMemRefTypeGet`](@ref)" but returns a nullptr-wrapping [`MlirType`](@ref) o illegal arguments, emitting appropriate diagnostics. """ function mlirMemRefTypeGetChecked(loc, elementType, rank, shape, layout, memorySpace) - @ccall mlir_c.mlirMemRefTypeGetChecked( - loc::MlirLocation, - elementType::MlirType, - rank::intptr_t, - shape::Ptr{Int64}, - layout::MlirAttribute, - memorySpace::MlirAttribute, - )::MlirType + @ccall mlir_c.mlirMemRefTypeGetChecked(loc::MlirLocation, elementType::MlirType, rank::intptr_t, shape::Ptr{Int64}, layout::MlirAttribute, memorySpace::MlirAttribute)::MlirType end """ @@ -5541,9 +5014,7 @@ end 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. """ function mlirMemRefTypeContiguousGet(elementType, rank, shape, memorySpace) - @ccall mlir_c.mlirMemRefTypeContiguousGet( - elementType::MlirType, rank::intptr_t, shape::Ptr{Int64}, memorySpace::MlirAttribute - )::MlirType + @ccall mlir_c.mlirMemRefTypeContiguousGet(elementType::MlirType, rank::intptr_t, shape::Ptr{Int64}, memorySpace::MlirAttribute)::MlirType end """ @@ -5552,13 +5023,7 @@ end Same as "[`mlirMemRefTypeContiguousGet`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirMemRefTypeContiguousGetChecked(loc, elementType, rank, shape, memorySpace) - @ccall mlir_c.mlirMemRefTypeContiguousGetChecked( - loc::MlirLocation, - elementType::MlirType, - rank::intptr_t, - shape::Ptr{Int64}, - memorySpace::MlirAttribute, - )::MlirType + @ccall mlir_c.mlirMemRefTypeContiguousGetChecked(loc::MlirLocation, elementType::MlirType, rank::intptr_t, shape::Ptr{Int64}, memorySpace::MlirAttribute)::MlirType end """ @@ -5567,9 +5032,7 @@ end 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. """ function mlirUnrankedMemRefTypeGet(elementType, memorySpace) - @ccall mlir_c.mlirUnrankedMemRefTypeGet( - elementType::MlirType, memorySpace::MlirAttribute - )::MlirType + @ccall mlir_c.mlirUnrankedMemRefTypeGet(elementType::MlirType, memorySpace::MlirAttribute)::MlirType end """ @@ -5578,9 +5041,7 @@ end Same as "[`mlirUnrankedMemRefTypeGet`](@ref)" but returns a nullptr wrapping [`MlirType`](@ref) on illegal arguments, emitting appropriate diagnostics. """ function mlirUnrankedMemRefTypeGetChecked(loc, elementType, memorySpace) - @ccall mlir_c.mlirUnrankedMemRefTypeGetChecked( - loc::MlirLocation, elementType::MlirType, memorySpace::MlirAttribute - )::MlirType + @ccall mlir_c.mlirUnrankedMemRefTypeGetChecked(loc::MlirLocation, elementType::MlirType, memorySpace::MlirAttribute)::MlirType end """ @@ -5616,9 +5077,7 @@ end 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. """ function mlirMemRefTypeGetStridesAndOffset(type, strides, offset) - @ccall mlir_c.mlirMemRefTypeGetStridesAndOffset( - type::MlirType, strides::Ptr{Int64}, offset::Ptr{Int64} - )::MlirLogicalResult + @ccall mlir_c.mlirMemRefTypeGetStridesAndOffset(type::MlirType, strides::Ptr{Int64}, offset::Ptr{Int64})::MlirLogicalResult end """ @@ -5654,9 +5113,7 @@ end Creates a tuple type that consists of the given list of elemental types. The type is owned by the context. """ function mlirTupleTypeGet(ctx, numElements, elements) - @ccall mlir_c.mlirTupleTypeGet( - ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirType} - )::MlirType + @ccall mlir_c.mlirTupleTypeGet(ctx::MlirContext, numElements::intptr_t, elements::Ptr{MlirType})::MlirType end """ @@ -5701,13 +5158,7 @@ end Creates a function type, mapping a list of input types to result types. """ function mlirFunctionTypeGet(ctx, numInputs, inputs, numResults, results) - @ccall mlir_c.mlirFunctionTypeGet( - ctx::MlirContext, - numInputs::intptr_t, - inputs::Ptr{MlirType}, - numResults::intptr_t, - results::Ptr{MlirType}, - )::MlirType + @ccall mlir_c.mlirFunctionTypeGet(ctx::MlirContext, numInputs::intptr_t, inputs::Ptr{MlirType}, numResults::intptr_t, results::Ptr{MlirType})::MlirType end """ @@ -5770,9 +5221,7 @@ end 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). """ function mlirOpaqueTypeGet(ctx, dialectNamespace, typeData) - @ccall mlir_c.mlirOpaqueTypeGet( - ctx::MlirContext, dialectNamespace::MlirStringRef, typeData::MlirStringRef - )::MlirType + @ccall mlir_c.mlirOpaqueTypeGet(ctx::MlirContext, dialectNamespace::MlirStringRef, typeData::MlirStringRef)::MlirType end """ @@ -5824,9 +5273,7 @@ end Create a new top-level PassManager anchored on `anchorOp`. """ function mlirPassManagerCreateOnOperation(ctx, anchorOp) - @ccall mlir_c.mlirPassManagerCreateOnOperation( - ctx::MlirContext, anchorOp::MlirStringRef - )::MlirPassManager + @ccall mlir_c.mlirPassManagerCreateOnOperation(ctx::MlirContext, anchorOp::MlirStringRef)::MlirPassManager end """ @@ -5853,9 +5300,7 @@ end Cast a top-level PassManager to a generic OpPassManager. """ function mlirPassManagerGetAsOpPassManager(passManager) - @ccall mlir_c.mlirPassManagerGetAsOpPassManager( - passManager::MlirPassManager - )::MlirOpPassManager + @ccall mlir_c.mlirPassManagerGetAsOpPassManager(passManager::MlirPassManager)::MlirOpPassManager end """ @@ -5864,9 +5309,7 @@ end Run the provided `passManager` on the given `op`. """ function mlirPassManagerRunOnOp(passManager, op) - @ccall mlir_c.mlirPassManagerRunOnOp( - passManager::MlirPassManager, op::MlirOperation - )::MlirLogicalResult + @ccall mlir_c.mlirPassManagerRunOnOp(passManager::MlirPassManager, op::MlirOperation)::MlirLogicalResult end """ @@ -5874,26 +5317,8 @@ end Enable IR printing. The treePrintingPath argument is an optional path to a directory where the dumps will be produced. If it isn't provided then dumps are produced to stderr. """ -function mlirPassManagerEnableIRPrinting( - passManager, - printBeforeAll, - printAfterAll, - printModuleScope, - printAfterOnlyOnChange, - printAfterOnlyOnFailure, - flags, - treePrintingPath, -) - @ccall mlir_c.mlirPassManagerEnableIRPrinting( - passManager::MlirPassManager, - printBeforeAll::Bool, - printAfterAll::Bool, - printModuleScope::Bool, - printAfterOnlyOnChange::Bool, - printAfterOnlyOnFailure::Bool, - flags::MlirOpPrintingFlags, - treePrintingPath::MlirStringRef, - )::Cvoid +function mlirPassManagerEnableIRPrinting(passManager, printBeforeAll, printAfterAll, printModuleScope, printAfterOnlyOnChange, printAfterOnlyOnFailure, flags, treePrintingPath) + @ccall mlir_c.mlirPassManagerEnableIRPrinting(passManager::MlirPassManager, printBeforeAll::Bool, printAfterAll::Bool, printModuleScope::Bool, printAfterOnlyOnChange::Bool, printAfterOnlyOnFailure::Bool, flags::MlirOpPrintingFlags, treePrintingPath::MlirStringRef)::Cvoid end """ @@ -5902,9 +5327,7 @@ end Enable / disable verify-each. """ function mlirPassManagerEnableVerifier(passManager, enable) - @ccall mlir_c.mlirPassManagerEnableVerifier( - passManager::MlirPassManager, enable::Bool - )::Cvoid + @ccall mlir_c.mlirPassManagerEnableVerifier(passManager::MlirPassManager, enable::Bool)::Cvoid end """ @@ -5913,9 +5336,7 @@ end 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. """ function mlirPassManagerGetNestedUnder(passManager, operationName) - @ccall mlir_c.mlirPassManagerGetNestedUnder( - passManager::MlirPassManager, operationName::MlirStringRef - )::MlirOpPassManager + @ccall mlir_c.mlirPassManagerGetNestedUnder(passManager::MlirPassManager, operationName::MlirStringRef)::MlirOpPassManager end """ @@ -5924,9 +5345,7 @@ end 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. """ function mlirOpPassManagerGetNestedUnder(passManager, operationName) - @ccall mlir_c.mlirOpPassManagerGetNestedUnder( - passManager::MlirOpPassManager, operationName::MlirStringRef - )::MlirOpPassManager + @ccall mlir_c.mlirOpPassManagerGetNestedUnder(passManager::MlirOpPassManager, operationName::MlirStringRef)::MlirOpPassManager end """ @@ -5935,9 +5354,7 @@ end 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. """ function mlirPassManagerAddOwnedPass(passManager, pass) - @ccall mlir_c.mlirPassManagerAddOwnedPass( - passManager::MlirPassManager, pass::MlirPass - )::Cvoid + @ccall mlir_c.mlirPassManagerAddOwnedPass(passManager::MlirPassManager, pass::MlirPass)::Cvoid end """ @@ -5946,9 +5363,7 @@ end 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. """ function mlirOpPassManagerAddOwnedPass(passManager, pass) - @ccall mlir_c.mlirOpPassManagerAddOwnedPass( - passManager::MlirOpPassManager, pass::MlirPass - )::Cvoid + @ccall mlir_c.mlirOpPassManagerAddOwnedPass(passManager::MlirOpPassManager, pass::MlirPass)::Cvoid end """ @@ -5957,12 +5372,7 @@ end 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. """ function mlirOpPassManagerAddPipeline(passManager, pipelineElements, callback, userData) - @ccall mlir_c.mlirOpPassManagerAddPipeline( - passManager::MlirOpPassManager, - pipelineElements::MlirStringRef, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::MlirLogicalResult + @ccall mlir_c.mlirOpPassManagerAddPipeline(passManager::MlirOpPassManager, pipelineElements::MlirStringRef, callback::MlirStringCallback, userData::Ptr{Cvoid})::MlirLogicalResult end """ @@ -5971,9 +5381,7 @@ end Print a textual MLIR pass pipeline by sending chunks of the string representation and forwarding `userData to `callback`. Note that the callback may be called several times with consecutive chunks of the string. """ function mlirPrintPassPipeline(passManager, callback, userData) - @ccall mlir_c.mlirPrintPassPipeline( - passManager::MlirOpPassManager, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirPrintPassPipeline(passManager::MlirOpPassManager, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -5982,12 +5390,7 @@ end 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. """ function mlirParsePassPipeline(passManager, pipeline, callback, userData) - @ccall mlir_c.mlirParsePassPipeline( - passManager::MlirOpPassManager, - pipeline::MlirStringRef, - callback::MlirStringCallback, - userData::Ptr{Cvoid}, - )::MlirLogicalResult + @ccall mlir_c.mlirParsePassPipeline(passManager::MlirOpPassManager, pipeline::MlirStringRef, callback::MlirStringCallback, userData::Ptr{Cvoid})::MlirLogicalResult end """ @@ -6016,28 +5419,8 @@ end Creates an external [`MlirPass`](@ref) 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. """ -function mlirCreateExternalPass( - passID, - name, - argument, - description, - opName, - nDependentDialects, - dependentDialects, - callbacks, - userData, -) - @ccall mlir_c.mlirCreateExternalPass( - passID::MlirTypeID, - name::MlirStringRef, - argument::MlirStringRef, - description::MlirStringRef, - opName::MlirStringRef, - nDependentDialects::intptr_t, - dependentDialects::Ptr{MlirDialectHandle}, - callbacks::MlirExternalPassCallbacks, - userData::Ptr{Cvoid}, - )::MlirPass +function mlirCreateExternalPass(passID, name, argument, description, opName, nDependentDialects, dependentDialects, callbacks, userData) + @ccall mlir_c.mlirCreateExternalPass(passID::MlirTypeID, name::MlirStringRef, argument::MlirStringRef, description::MlirStringRef, opName::MlirStringRef, nDependentDialects::intptr_t, dependentDialects::Ptr{MlirDialectHandle}, callbacks::MlirExternalPassCallbacks, userData::Ptr{Cvoid})::MlirPass end """ @@ -6752,9 +6135,7 @@ const MlirDiagnosticHandler = Ptr{Cvoid} Prints a diagnostic using the provided callback. """ function mlirDiagnosticPrint(diagnostic, callback, userData) - @ccall mlir_c.mlirDiagnosticPrint( - diagnostic::MlirDiagnostic, callback::MlirStringCallback, userData::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirDiagnosticPrint(diagnostic::MlirDiagnostic, callback::MlirStringCallback, userData::Ptr{Cvoid})::Cvoid end """ @@ -6772,9 +6153,7 @@ end Returns the severity of the diagnostic. """ function mlirDiagnosticGetSeverity(diagnostic) - @ccall mlir_c.mlirDiagnosticGetSeverity( - diagnostic::MlirDiagnostic - )::MlirDiagnosticSeverity + @ccall mlir_c.mlirDiagnosticGetSeverity(diagnostic::MlirDiagnostic)::MlirDiagnosticSeverity end """ @@ -6792,9 +6171,7 @@ end Returns `pos`-th note attached to the diagnostic. Expects `pos` to be a valid zero-based index into the list of notes. """ function mlirDiagnosticGetNote(diagnostic, pos) - @ccall mlir_c.mlirDiagnosticGetNote( - diagnostic::MlirDiagnostic, pos::intptr_t - )::MlirDiagnostic + @ccall mlir_c.mlirDiagnosticGetNote(diagnostic::MlirDiagnostic, pos::intptr_t)::MlirDiagnostic end """ @@ -6803,12 +6180,7 @@ end 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. """ function mlirContextAttachDiagnosticHandler(context, handler, userData, deleteUserData) - @ccall mlir_c.mlirContextAttachDiagnosticHandler( - context::MlirContext, - handler::MlirDiagnosticHandler, - userData::Ptr{Cvoid}, - deleteUserData::Ptr{Cvoid}, - )::MlirDiagnosticHandlerID + @ccall mlir_c.mlirContextAttachDiagnosticHandler(context::MlirContext, handler::MlirDiagnosticHandler, userData::Ptr{Cvoid}, deleteUserData::Ptr{Cvoid})::MlirDiagnosticHandlerID end """ @@ -6817,9 +6189,7 @@ end Detaches an attached diagnostic handler from the context given its identifier. """ function mlirContextDetachDiagnosticHandler(context, id) - @ccall mlir_c.mlirContextDetachDiagnosticHandler( - context::MlirContext, id::MlirDiagnosticHandlerID - )::Cvoid + @ccall mlir_c.mlirContextDetachDiagnosticHandler(context::MlirContext, id::MlirDiagnosticHandlerID)::Cvoid end """ @@ -6913,9 +6283,7 @@ end Sets the argument attribute 'name' of an argument at index 'pos'. Asserts that the operation is a FuncOp. """ function mlirFuncSetArgAttr(op, pos, name, attr) - @ccall mlir_c.mlirFuncSetArgAttr( - op::MlirOperation, pos::intptr_t, name::MlirStringRef, attr::MlirAttribute - )::Cvoid + @ccall mlir_c.mlirFuncSetArgAttr(op::MlirOperation, pos::intptr_t, name::MlirStringRef, attr::MlirAttribute)::Cvoid end function mlirGetDialectHandle__gpu__() @@ -6935,26 +6303,11 @@ function mlirAttributeIsAGPUObjectAttr(attr) end function mlirGPUObjectAttrGet(mlirCtx, target, format, objectStrRef, mlirObjectProps) - @ccall mlir_c.mlirGPUObjectAttrGet( - mlirCtx::MlirContext, - target::MlirAttribute, - format::UInt32, - objectStrRef::MlirStringRef, - mlirObjectProps::MlirAttribute, - )::MlirAttribute -end - -function mlirGPUObjectAttrGetWithKernels( - mlirCtx, target, format, objectStrRef, mlirObjectProps, mlirKernelsAttr -) - @ccall mlir_c.mlirGPUObjectAttrGetWithKernels( - mlirCtx::MlirContext, - target::MlirAttribute, - format::UInt32, - objectStrRef::MlirStringRef, - mlirObjectProps::MlirAttribute, - mlirKernelsAttr::MlirAttribute, - )::MlirAttribute + @ccall mlir_c.mlirGPUObjectAttrGet(mlirCtx::MlirContext, target::MlirAttribute, format::UInt32, objectStrRef::MlirStringRef, mlirObjectProps::MlirAttribute)::MlirAttribute +end + +function mlirGPUObjectAttrGetWithKernels(mlirCtx, target, format, objectStrRef, mlirObjectProps, mlirKernelsAttr) + @ccall mlir_c.mlirGPUObjectAttrGetWithKernels(mlirCtx::MlirContext, target::MlirAttribute, format::UInt32, objectStrRef::MlirStringRef, mlirObjectProps::MlirAttribute, mlirKernelsAttr::MlirAttribute)::MlirAttribute end function mlirGPUObjectAttrGetTarget(mlirObjectAttr) @@ -6974,9 +6327,7 @@ function mlirGPUObjectAttrHasProperties(mlirObjectAttr) end function mlirGPUObjectAttrGetProperties(mlirObjectAttr) - @ccall mlir_c.mlirGPUObjectAttrGetProperties( - mlirObjectAttr::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirGPUObjectAttrGetProperties(mlirObjectAttr::MlirAttribute)::MlirAttribute end function mlirGPUObjectAttrHasKernels(mlirObjectAttr) @@ -7148,12 +6499,7 @@ end Creates an llvm.func type. """ function mlirLLVMFunctionTypeGet(resultType, nArgumentTypes, argumentTypes, isVarArg) - @ccall mlir_c.mlirLLVMFunctionTypeGet( - resultType::MlirType, - nArgumentTypes::intptr_t, - argumentTypes::Ptr{MlirType}, - isVarArg::Bool, - )::MlirType + @ccall mlir_c.mlirLLVMFunctionTypeGet(resultType::MlirType, nArgumentTypes::intptr_t, argumentTypes::Ptr{MlirType}, isVarArg::Bool)::MlirType end """ @@ -7189,9 +6535,7 @@ end Returns the `positions`-th field of the struct. Asserts if the struct is opaque, not yet initialized or if the position is out of range. """ function mlirLLVMStructTypeGetElementType(type, position) - @ccall mlir_c.mlirLLVMStructTypeGetElementType( - type::MlirType, position::intptr_t - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeGetElementType(type::MlirType, position::intptr_t)::MlirType end """ @@ -7227,9 +6571,7 @@ end 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. """ function mlirLLVMStructTypeLiteralGet(ctx, nFieldTypes, fieldTypes, isPacked) - @ccall mlir_c.mlirLLVMStructTypeLiteralGet( - ctx::MlirContext, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeLiteralGet(ctx::MlirContext, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool)::MlirType end """ @@ -7238,9 +6580,7 @@ end Creates an LLVM literal (unnamed) struct type if possible. Emits a diagnostic at the given location and returns null otherwise. """ function mlirLLVMStructTypeLiteralGetChecked(loc, nFieldTypes, fieldTypes, isPacked) - @ccall mlir_c.mlirLLVMStructTypeLiteralGetChecked( - loc::MlirLocation, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeLiteralGetChecked(loc::MlirLocation, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool)::MlirType end """ @@ -7249,9 +6589,7 @@ end Creates an LLVM identified struct type with no body. If a struct type with this name already exists in the context, returns that type. Use [`mlirLLVMStructTypeIdentifiedNewGet`](@ref) to create a fresh struct type, potentially renaming it. The body should be set separatelty by calling [`mlirLLVMStructTypeSetBody`](@ref), if it isn't set already. """ function mlirLLVMStructTypeIdentifiedGet(ctx, name) - @ccall mlir_c.mlirLLVMStructTypeIdentifiedGet( - ctx::MlirContext, name::MlirStringRef - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeIdentifiedGet(ctx::MlirContext, name::MlirStringRef)::MlirType end """ @@ -7260,19 +6598,11 @@ end 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. """ function mlirLLVMStructTypeIdentifiedNewGet(ctx, name, nFieldTypes, fieldTypes, isPacked) - @ccall mlir_c.mlirLLVMStructTypeIdentifiedNewGet( - ctx::MlirContext, - name::MlirStringRef, - nFieldTypes::intptr_t, - fieldTypes::Ptr{MlirType}, - isPacked::Bool, - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeIdentifiedNewGet(ctx::MlirContext, name::MlirStringRef, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool)::MlirType end function mlirLLVMStructTypeOpaqueGet(ctx, name) - @ccall mlir_c.mlirLLVMStructTypeOpaqueGet( - ctx::MlirContext, name::MlirStringRef - )::MlirType + @ccall mlir_c.mlirLLVMStructTypeOpaqueGet(ctx::MlirContext, name::MlirStringRef)::MlirType end """ @@ -7281,12 +6611,7 @@ end Sets the body of the identified struct if it hasn't been set yet. Returns whether the operation was successful. """ function mlirLLVMStructTypeSetBody(structType, nFieldTypes, fieldTypes, isPacked) - @ccall mlir_c.mlirLLVMStructTypeSetBody( - structType::MlirType, - nFieldTypes::intptr_t, - fieldTypes::Ptr{MlirType}, - isPacked::Bool, - )::MlirLogicalResult + @ccall mlir_c.mlirLLVMStructTypeSetBody(structType::MlirType, nFieldTypes::intptr_t, fieldTypes::Ptr{MlirType}, isPacked::Bool)::MlirLogicalResult end @cenum MlirLLVMCConv::UInt32 begin @@ -7345,9 +6670,7 @@ end Creates a LLVM CConv attribute. """ function mlirLLVMCConvAttrGet(ctx, cconv) - @ccall mlir_c.mlirLLVMCConvAttrGet( - ctx::MlirContext, cconv::MlirLLVMCConv - )::MlirAttribute + @ccall mlir_c.mlirLLVMCConvAttrGet(ctx::MlirContext, cconv::MlirLLVMCConv)::MlirAttribute end @cenum MlirLLVMComdat::UInt32 begin @@ -7364,9 +6687,7 @@ end Creates a LLVM Comdat attribute. """ function mlirLLVMComdatAttrGet(ctx, comdat) - @ccall mlir_c.mlirLLVMComdatAttrGet( - ctx::MlirContext, comdat::MlirLLVMComdat - )::MlirAttribute + @ccall mlir_c.mlirLLVMComdatAttrGet(ctx::MlirContext, comdat::MlirLLVMComdat)::MlirAttribute end @cenum MlirLLVMLinkage::UInt32 begin @@ -7389,9 +6710,7 @@ end Creates a LLVM Linkage attribute. """ function mlirLLVMLinkageAttrGet(ctx, linkage) - @ccall mlir_c.mlirLLVMLinkageAttrGet( - ctx::MlirContext, linkage::MlirLLVMLinkage - )::MlirAttribute + @ccall mlir_c.mlirLLVMLinkageAttrGet(ctx::MlirContext, linkage::MlirLLVMLinkage)::MlirAttribute end """ @@ -7409,9 +6728,7 @@ end Creates a LLVM DIExpressionElem attribute. """ function mlirLLVMDIExpressionElemAttrGet(ctx, opcode, nArguments, arguments) - @ccall mlir_c.mlirLLVMDIExpressionElemAttrGet( - ctx::MlirContext, opcode::Cuint, nArguments::intptr_t, arguments::Ptr{UInt64} - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIExpressionElemAttrGet(ctx::MlirContext, opcode::Cuint, nArguments::intptr_t, arguments::Ptr{UInt64})::MlirAttribute end """ @@ -7420,9 +6737,7 @@ end Creates a LLVM DIExpression attribute. """ function mlirLLVMDIExpressionAttrGet(ctx, nOperations, operations) - @ccall mlir_c.mlirLLVMDIExpressionAttrGet( - ctx::MlirContext, nOperations::intptr_t, operations::Ptr{MlirAttribute} - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIExpressionAttrGet(ctx::MlirContext, nOperations::intptr_t, operations::Ptr{MlirAttribute})::MlirAttribute end @cenum MlirLLVMTypeEncoding::UInt32 begin @@ -7454,13 +6769,7 @@ end Creates a LLVM DIBasicType attribute. """ function mlirLLVMDIBasicTypeAttrGet(ctx, tag, name, sizeInBits, encoding) - @ccall mlir_c.mlirLLVMDIBasicTypeAttrGet( - ctx::MlirContext, - tag::Cuint, - name::MlirAttribute, - sizeInBits::UInt64, - encoding::MlirLLVMTypeEncoding, - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIBasicTypeAttrGet(ctx::MlirContext, tag::Cuint, name::MlirAttribute, sizeInBits::UInt64, encoding::MlirLLVMTypeEncoding)::MlirAttribute end """ @@ -7477,46 +6786,8 @@ end Creates a LLVM DICompositeType attribute. """ -function mlirLLVMDICompositeTypeAttrGet( - ctx, - recId, - isRecSelf, - tag, - name, - file, - line, - scope, - baseType, - flags, - sizeInBits, - alignInBits, - nElements, - elements, - dataLocation, - rank, - allocated, - associated, -) - @ccall mlir_c.mlirLLVMDICompositeTypeAttrGet( - ctx::MlirContext, - recId::MlirAttribute, - isRecSelf::Bool, - tag::Cuint, - name::MlirAttribute, - file::MlirAttribute, - line::UInt32, - scope::MlirAttribute, - baseType::MlirAttribute, - flags::Int64, - sizeInBits::UInt64, - alignInBits::UInt64, - nElements::intptr_t, - elements::Ptr{MlirAttribute}, - dataLocation::MlirAttribute, - rank::MlirAttribute, - allocated::MlirAttribute, - associated::MlirAttribute, - )::MlirAttribute +function mlirLLVMDICompositeTypeAttrGet(ctx, recId, isRecSelf, tag, name, file, line, scope, baseType, flags, sizeInBits, alignInBits, nElements, elements, dataLocation, rank, allocated, associated) + @ccall mlir_c.mlirLLVMDICompositeTypeAttrGet(ctx::MlirContext, recId::MlirAttribute, isRecSelf::Bool, tag::Cuint, name::MlirAttribute, file::MlirAttribute, line::UInt32, scope::MlirAttribute, baseType::MlirAttribute, flags::Int64, sizeInBits::UInt64, alignInBits::UInt64, nElements::intptr_t, elements::Ptr{MlirAttribute}, dataLocation::MlirAttribute, rank::MlirAttribute, allocated::MlirAttribute, associated::MlirAttribute)::MlirAttribute end """ @@ -7524,52 +6795,12 @@ end Creates a LLVM DIDerivedType attribute. Note that `dwarfAddressSpace` is an optional field, where [`MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL`](@ref) indicates null and non-negative values indicate a value present. """ -function mlirLLVMDIDerivedTypeAttrGet( - ctx, - tag, - name, - baseType, - sizeInBits, - alignInBits, - offsetInBits, - dwarfAddressSpace, - extraData, -) - @ccall mlir_c.mlirLLVMDIDerivedTypeAttrGet( - ctx::MlirContext, - tag::Cuint, - name::MlirAttribute, - baseType::MlirAttribute, - sizeInBits::UInt64, - alignInBits::UInt32, - offsetInBits::UInt64, - dwarfAddressSpace::Int64, - extraData::MlirAttribute, - )::MlirAttribute -end - -function mlirLLVMDIStringTypeAttrGet( - ctx, - tag, - name, - sizeInBits, - alignInBits, - stringLength, - stringLengthExp, - stringLocationExp, - encoding, -) - @ccall mlir_c.mlirLLVMDIStringTypeAttrGet( - ctx::MlirContext, - tag::Cuint, - name::MlirAttribute, - sizeInBits::UInt64, - alignInBits::UInt32, - stringLength::MlirAttribute, - stringLengthExp::MlirAttribute, - stringLocationExp::MlirAttribute, - encoding::MlirLLVMTypeEncoding, - )::MlirAttribute +function mlirLLVMDIDerivedTypeAttrGet(ctx, tag, name, baseType, sizeInBits, alignInBits, offsetInBits, dwarfAddressSpace, extraData) + @ccall mlir_c.mlirLLVMDIDerivedTypeAttrGet(ctx::MlirContext, tag::Cuint, name::MlirAttribute, baseType::MlirAttribute, sizeInBits::UInt64, alignInBits::UInt32, offsetInBits::UInt64, dwarfAddressSpace::Int64, extraData::MlirAttribute)::MlirAttribute +end + +function mlirLLVMDIStringTypeAttrGet(ctx, tag, name, sizeInBits, alignInBits, stringLength, stringLengthExp, stringLocationExp, encoding) + @ccall mlir_c.mlirLLVMDIStringTypeAttrGet(ctx::MlirContext, tag::Cuint, name::MlirAttribute, sizeInBits::UInt64, alignInBits::UInt32, stringLength::MlirAttribute, stringLengthExp::MlirAttribute, stringLocationExp::MlirAttribute, encoding::MlirLLVMTypeEncoding)::MlirAttribute end """ @@ -7578,9 +6809,7 @@ end Gets the base type from a LLVM DIDerivedType attribute. """ function mlirLLVMDIDerivedTypeAttrGetBaseType(diDerivedType) - @ccall mlir_c.mlirLLVMDIDerivedTypeAttrGetBaseType( - diDerivedType::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIDerivedTypeAttrGetBaseType(diDerivedType::MlirAttribute)::MlirAttribute end """ @@ -7589,9 +6818,7 @@ end Creates a LLVM DIFileAttr attribute. """ function mlirLLVMDIFileAttrGet(ctx, name, directory) - @ccall mlir_c.mlirLLVMDIFileAttrGet( - ctx::MlirContext, name::MlirAttribute, directory::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIFileAttrGet(ctx::MlirContext, name::MlirAttribute, directory::MlirAttribute)::MlirAttribute end @cenum MlirLLVMDIEmissionKind::UInt32 begin @@ -7613,19 +6840,8 @@ end Creates a LLVM DICompileUnit attribute. """ -function mlirLLVMDICompileUnitAttrGet( - ctx, id, sourceLanguage, file, producer, isOptimized, emissionKind, nameTableKind -) - @ccall mlir_c.mlirLLVMDICompileUnitAttrGet( - ctx::MlirContext, - id::MlirAttribute, - sourceLanguage::Cuint, - file::MlirAttribute, - producer::MlirAttribute, - isOptimized::Bool, - emissionKind::MlirLLVMDIEmissionKind, - nameTableKind::MlirLLVMDINameTableKind, - )::MlirAttribute +function mlirLLVMDICompileUnitAttrGet(ctx, id, sourceLanguage, file, producer, isOptimized, emissionKind, nameTableKind) + @ccall mlir_c.mlirLLVMDICompileUnitAttrGet(ctx::MlirContext, id::MlirAttribute, sourceLanguage::Cuint, file::MlirAttribute, producer::MlirAttribute, isOptimized::Bool, emissionKind::MlirLLVMDIEmissionKind, nameTableKind::MlirLLVMDINameTableKind)::MlirAttribute end """ @@ -7643,13 +6859,7 @@ end Creates a LLVM DILexicalBlock attribute. """ function mlirLLVMDILexicalBlockAttrGet(ctx, scope, file, line, column) - @ccall mlir_c.mlirLLVMDILexicalBlockAttrGet( - ctx::MlirContext, - scope::MlirAttribute, - file::MlirAttribute, - line::Cuint, - column::Cuint, - )::MlirAttribute + @ccall mlir_c.mlirLLVMDILexicalBlockAttrGet(ctx::MlirContext, scope::MlirAttribute, file::MlirAttribute, line::Cuint, column::Cuint)::MlirAttribute end """ @@ -7658,9 +6868,7 @@ end Creates a LLVM DILexicalBlockFile attribute. """ function mlirLLVMDILexicalBlockFileAttrGet(ctx, scope, file, discriminator) - @ccall mlir_c.mlirLLVMDILexicalBlockFileAttrGet( - ctx::MlirContext, scope::MlirAttribute, file::MlirAttribute, discriminator::Cuint - )::MlirAttribute + @ccall mlir_c.mlirLLVMDILexicalBlockFileAttrGet(ctx::MlirContext, scope::MlirAttribute, file::MlirAttribute, discriminator::Cuint)::MlirAttribute end """ @@ -7668,20 +6876,8 @@ end Creates a LLVM DILocalVariableAttr attribute. """ -function mlirLLVMDILocalVariableAttrGet( - ctx, scope, name, diFile, line, arg, alignInBits, diType, flags -) - @ccall mlir_c.mlirLLVMDILocalVariableAttrGet( - ctx::MlirContext, - scope::MlirAttribute, - name::MlirAttribute, - diFile::MlirAttribute, - line::Cuint, - arg::Cuint, - alignInBits::Cuint, - diType::MlirAttribute, - flags::Int64, - )::MlirAttribute +function mlirLLVMDILocalVariableAttrGet(ctx, scope, name, diFile, line, arg, alignInBits, diType, flags) + @ccall mlir_c.mlirLLVMDILocalVariableAttrGet(ctx::MlirContext, scope::MlirAttribute, name::MlirAttribute, diFile::MlirAttribute, line::Cuint, arg::Cuint, alignInBits::Cuint, diType::MlirAttribute, flags::Int64)::MlirAttribute end """ @@ -7698,44 +6894,8 @@ end Creates a LLVM DISubprogramAttr attribute. """ -function mlirLLVMDISubprogramAttrGet( - ctx, - recId, - isRecSelf, - id, - compileUnit, - scope, - name, - linkageName, - file, - line, - scopeLine, - subprogramFlags, - type, - nRetainedNodes, - retainedNodes, - nAnnotations, - annotations, -) - @ccall mlir_c.mlirLLVMDISubprogramAttrGet( - ctx::MlirContext, - recId::MlirAttribute, - isRecSelf::Bool, - id::MlirAttribute, - compileUnit::MlirAttribute, - scope::MlirAttribute, - name::MlirAttribute, - linkageName::MlirAttribute, - file::MlirAttribute, - line::Cuint, - scopeLine::Cuint, - subprogramFlags::UInt64, - type::MlirAttribute, - nRetainedNodes::intptr_t, - retainedNodes::Ptr{MlirAttribute}, - nAnnotations::intptr_t, - annotations::Ptr{MlirAttribute}, - )::MlirAttribute +function mlirLLVMDISubprogramAttrGet(ctx, recId, isRecSelf, id, compileUnit, scope, name, linkageName, file, line, scopeLine, subprogramFlags, type, nRetainedNodes, retainedNodes, nAnnotations, annotations) + @ccall mlir_c.mlirLLVMDISubprogramAttrGet(ctx::MlirContext, recId::MlirAttribute, isRecSelf::Bool, id::MlirAttribute, compileUnit::MlirAttribute, scope::MlirAttribute, name::MlirAttribute, linkageName::MlirAttribute, file::MlirAttribute, line::Cuint, scopeLine::Cuint, subprogramFlags::UInt64, type::MlirAttribute, nRetainedNodes::intptr_t, retainedNodes::Ptr{MlirAttribute}, nAnnotations::intptr_t, annotations::Ptr{MlirAttribute})::MlirAttribute end """ @@ -7744,9 +6904,7 @@ end Creates a LLVM DIAnnotation attribute. """ function mlirLLVMDIAnnotationAttrGet(ctx, name, value) - @ccall mlir_c.mlirLLVMDIAnnotationAttrGet( - ctx::MlirContext, name::MlirAttribute, value::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDIAnnotationAttrGet(ctx::MlirContext, name::MlirAttribute, value::MlirAttribute)::MlirAttribute end """ @@ -7755,9 +6913,7 @@ end Gets the scope from this DISubprogramAttr. """ function mlirLLVMDISubprogramAttrGetScope(diSubprogram) - @ccall mlir_c.mlirLLVMDISubprogramAttrGetScope( - diSubprogram::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDISubprogramAttrGetScope(diSubprogram::MlirAttribute)::MlirAttribute end """ @@ -7784,9 +6940,7 @@ end Gets the compile unit from this DISubprogram. """ function mlirLLVMDISubprogramAttrGetCompileUnit(diSubprogram) - @ccall mlir_c.mlirLLVMDISubprogramAttrGetCompileUnit( - diSubprogram::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDISubprogramAttrGetCompileUnit(diSubprogram::MlirAttribute)::MlirAttribute end """ @@ -7795,9 +6949,7 @@ end Gets the file from this DISubprogramAttr. """ function mlirLLVMDISubprogramAttrGetFile(diSubprogram) - @ccall mlir_c.mlirLLVMDISubprogramAttrGetFile( - diSubprogram::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDISubprogramAttrGetFile(diSubprogram::MlirAttribute)::MlirAttribute end """ @@ -7806,9 +6958,7 @@ end Gets the type from this DISubprogramAttr. """ function mlirLLVMDISubprogramAttrGetType(diSubprogram) - @ccall mlir_c.mlirLLVMDISubprogramAttrGetType( - diSubprogram::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirLLVMDISubprogramAttrGetType(diSubprogram::MlirAttribute)::MlirAttribute end """ @@ -7817,12 +6967,7 @@ end Creates a LLVM DISubroutineTypeAttr attribute. """ function mlirLLVMDISubroutineTypeAttrGet(ctx, callingConvention, nTypes, types) - @ccall mlir_c.mlirLLVMDISubroutineTypeAttrGet( - ctx::MlirContext, - callingConvention::Cuint, - nTypes::intptr_t, - types::Ptr{MlirAttribute}, - )::MlirAttribute + @ccall mlir_c.mlirLLVMDISubroutineTypeAttrGet(ctx::MlirContext, callingConvention::Cuint, nTypes::intptr_t, types::Ptr{MlirAttribute})::MlirAttribute end """ @@ -7830,20 +6975,8 @@ end Creates a LLVM DIModuleAttr attribute. """ -function mlirLLVMDIModuleAttrGet( - ctx, file, scope, name, configMacros, includePath, apinotes, line, isDecl -) - @ccall mlir_c.mlirLLVMDIModuleAttrGet( - ctx::MlirContext, - file::MlirAttribute, - scope::MlirAttribute, - name::MlirAttribute, - configMacros::MlirAttribute, - includePath::MlirAttribute, - apinotes::MlirAttribute, - line::Cuint, - isDecl::Bool, - )::MlirAttribute +function mlirLLVMDIModuleAttrGet(ctx, file, scope, name, configMacros, includePath, apinotes, line, isDecl) + @ccall mlir_c.mlirLLVMDIModuleAttrGet(ctx::MlirContext, file::MlirAttribute, scope::MlirAttribute, name::MlirAttribute, configMacros::MlirAttribute, includePath::MlirAttribute, apinotes::MlirAttribute, line::Cuint, isDecl::Bool)::MlirAttribute end """ @@ -7851,20 +6984,8 @@ end Creates a LLVM DIImportedEntityAttr attribute. """ -function mlirLLVMDIImportedEntityAttrGet( - ctx, tag, scope, entity, file, line, name, nElements, elements -) - @ccall mlir_c.mlirLLVMDIImportedEntityAttrGet( - ctx::MlirContext, - tag::Cuint, - scope::MlirAttribute, - entity::MlirAttribute, - file::MlirAttribute, - line::Cuint, - name::MlirAttribute, - nElements::intptr_t, - elements::Ptr{MlirAttribute}, - )::MlirAttribute +function mlirLLVMDIImportedEntityAttrGet(ctx, tag, scope, entity, file, line, name, nElements, elements) + @ccall mlir_c.mlirLLVMDIImportedEntityAttrGet(ctx::MlirContext, tag::Cuint, scope::MlirAttribute, entity::MlirAttribute, file::MlirAttribute, line::Cuint, name::MlirAttribute, nElements::intptr_t, elements::Ptr{MlirAttribute})::MlirAttribute end """ @@ -8009,17 +7130,8 @@ function mlirTypeIsANVGPUTensorMapDescriptorType(type) @ccall mlir_c.mlirTypeIsANVGPUTensorMapDescriptorType(type::MlirType)::Bool end -function mlirNVGPUTensorMapDescriptorTypeGet( - ctx, tensorMemrefType, swizzle, l2promo, oobFill, interleave -) - @ccall mlir_c.mlirNVGPUTensorMapDescriptorTypeGet( - ctx::MlirContext, - tensorMemrefType::MlirType, - swizzle::Cint, - l2promo::Cint, - oobFill::Cint, - interleave::Cint, - )::MlirType +function mlirNVGPUTensorMapDescriptorTypeGet(ctx, tensorMemrefType, swizzle, l2promo, oobFill, interleave) + @ccall mlir_c.mlirNVGPUTensorMapDescriptorTypeGet(ctx::MlirContext, tensorMemrefType::MlirType, swizzle::Cint, l2promo::Cint, oobFill::Cint, interleave::Cint)::MlirType end function mlirGetDialectHandle__nvvm__() @@ -8110,9 +7222,7 @@ end Returns the minimum possible value stored by a quantized type. """ function mlirQuantizedTypeGetDefaultMinimumForInteger(isSigned, integralWidth) - @ccall mlir_c.mlirQuantizedTypeGetDefaultMinimumForInteger( - isSigned::Bool, integralWidth::Cuint - )::Int64 + @ccall mlir_c.mlirQuantizedTypeGetDefaultMinimumForInteger(isSigned::Bool, integralWidth::Cuint)::Int64 end """ @@ -8121,9 +7231,7 @@ end Returns the maximum possible value stored by a quantized type. """ function mlirQuantizedTypeGetDefaultMaximumForInteger(isSigned, integralWidth) - @ccall mlir_c.mlirQuantizedTypeGetDefaultMaximumForInteger( - isSigned::Bool, integralWidth::Cuint - )::Int64 + @ccall mlir_c.mlirQuantizedTypeGetDefaultMaximumForInteger(isSigned::Bool, integralWidth::Cuint)::Int64 end """ @@ -8195,9 +7303,7 @@ end Returns `true` if the `candidate` type is compatible with the given quantized `type`. """ function mlirQuantizedTypeIsCompatibleExpressedType(type, candidate) - @ccall mlir_c.mlirQuantizedTypeIsCompatibleExpressedType( - type::MlirType, candidate::MlirType - )::Bool + @ccall mlir_c.mlirQuantizedTypeIsCompatibleExpressedType(type::MlirType, candidate::MlirType)::Bool end """ @@ -8215,9 +7321,7 @@ end Casts from a type based on the storage type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid. """ function mlirQuantizedTypeCastFromStorageType(type, candidate) - @ccall mlir_c.mlirQuantizedTypeCastFromStorageType( - type::MlirType, candidate::MlirType - )::MlirType + @ccall mlir_c.mlirQuantizedTypeCastFromStorageType(type::MlirType, candidate::MlirType)::MlirType end """ @@ -8235,9 +7339,7 @@ end Casts from a type based on the expressed type of the given type to a corresponding type based on the given type. Returns a null type if the cast is not valid. """ function mlirQuantizedTypeCastFromExpressedType(type, candidate) - @ccall mlir_c.mlirQuantizedTypeCastFromExpressedType( - type::MlirType, candidate::MlirType - )::MlirType + @ccall mlir_c.mlirQuantizedTypeCastFromExpressedType(type::MlirType, candidate::MlirType)::MlirType end """ @@ -8255,9 +7357,7 @@ end Casts from a type based on the expressed type of the given quantized type to equivalent type based on storage type of the same quantized type. """ function mlirQuantizedTypeCastExpressedToStorageType(type, candidate) - @ccall mlir_c.mlirQuantizedTypeCastExpressedToStorageType( - type::MlirType, candidate::MlirType - )::MlirType + @ccall mlir_c.mlirQuantizedTypeCastExpressedToStorageType(type::MlirType, candidate::MlirType)::MlirType end """ @@ -8274,16 +7374,8 @@ end 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. """ -function mlirAnyQuantizedTypeGet( - flags, storageType, expressedType, storageTypeMin, storageTypeMax -) - @ccall mlir_c.mlirAnyQuantizedTypeGet( - flags::Cuint, - storageType::MlirType, - expressedType::MlirType, - storageTypeMin::Int64, - storageTypeMax::Int64, - )::MlirType +function mlirAnyQuantizedTypeGet(flags, storageType, expressedType, storageTypeMin, storageTypeMax) + @ccall mlir_c.mlirAnyQuantizedTypeGet(flags::Cuint, storageType::MlirType, expressedType::MlirType, storageTypeMin::Int64, storageTypeMax::Int64)::MlirType end """ @@ -8300,18 +7392,8 @@ end 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. """ -function mlirUniformQuantizedTypeGet( - flags, storageType, expressedType, scale, zeroPoint, storageTypeMin, storageTypeMax -) - @ccall mlir_c.mlirUniformQuantizedTypeGet( - flags::Cuint, - storageType::MlirType, - expressedType::MlirType, - scale::Cdouble, - zeroPoint::Int64, - storageTypeMin::Int64, - storageTypeMax::Int64, - )::MlirType +function mlirUniformQuantizedTypeGet(flags, storageType, expressedType, scale, zeroPoint, storageTypeMin, storageTypeMax) + @ccall mlir_c.mlirUniformQuantizedTypeGet(flags::Cuint, storageType::MlirType, expressedType::MlirType, scale::Cdouble, zeroPoint::Int64, storageTypeMin::Int64, storageTypeMax::Int64)::MlirType end """ @@ -8355,28 +7437,8 @@ end 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. """ -function mlirUniformQuantizedPerAxisTypeGet( - flags, - storageType, - expressedType, - nDims, - scales, - zeroPoints, - quantizedDimension, - storageTypeMin, - storageTypeMax, -) - @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGet( - flags::Cuint, - storageType::MlirType, - expressedType::MlirType, - nDims::intptr_t, - scales::Ptr{Cdouble}, - zeroPoints::Ptr{Int64}, - quantizedDimension::Int32, - storageTypeMin::Int64, - storageTypeMax::Int64, - )::MlirType +function mlirUniformQuantizedPerAxisTypeGet(flags, storageType, expressedType, nDims, scales, zeroPoints, quantizedDimension, storageTypeMin, storageTypeMax) + @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGet(flags::Cuint, storageType::MlirType, expressedType::MlirType, nDims::intptr_t, scales::Ptr{Cdouble}, zeroPoints::Ptr{Int64}, quantizedDimension::Int32, storageTypeMin::Int64, storageTypeMax::Int64)::MlirType end """ @@ -8394,9 +7456,7 @@ end Returns `pos`-th scale of the given quantized per-axis type. """ function mlirUniformQuantizedPerAxisTypeGetScale(type, pos) - @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetScale( - type::MlirType, pos::intptr_t - )::Cdouble + @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetScale(type::MlirType, pos::intptr_t)::Cdouble end """ @@ -8405,9 +7465,7 @@ end Returns `pos`-th zero point of the given quantized per-axis type. """ function mlirUniformQuantizedPerAxisTypeGetZeroPoint(type, pos) - @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetZeroPoint( - type::MlirType, pos::intptr_t - )::Int64 + @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetZeroPoint(type::MlirType, pos::intptr_t)::Int64 end """ @@ -8416,9 +7474,7 @@ end Returns the index of the quantized dimension in the given quantized per-axis type. """ function mlirUniformQuantizedPerAxisTypeGetQuantizedDimension(type) - @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetQuantizedDimension( - type::MlirType - )::Int32 + @ccall mlir_c.mlirUniformQuantizedPerAxisTypeGetQuantizedDimension(type::MlirType)::Int32 end """ @@ -8445,9 +7501,7 @@ end 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. """ function mlirCalibratedQuantizedTypeGet(expressedType, min, max) - @ccall mlir_c.mlirCalibratedQuantizedTypeGet( - expressedType::MlirType, min::Cdouble, max::Cdouble - )::MlirType + @ccall mlir_c.mlirCalibratedQuantizedTypeGet(expressedType::MlirType, min::Cdouble, max::Cdouble)::MlirType end """ @@ -8524,20 +7578,8 @@ end Creates a `sparse\\_tensor.encoding` attribute with the given parameters. """ -function mlirSparseTensorEncodingAttrGet( - ctx, lvlRank, lvlTypes, dimToLvl, lvlTodim, posWidth, crdWidth, explicitVal, implicitVal -) - @ccall mlir_c.mlirSparseTensorEncodingAttrGet( - ctx::MlirContext, - lvlRank::intptr_t, - lvlTypes::Ptr{MlirSparseTensorLevelType}, - dimToLvl::MlirAffineMap, - lvlTodim::MlirAffineMap, - posWidth::Cint, - crdWidth::Cint, - explicitVal::MlirAttribute, - implicitVal::MlirAttribute, - )::MlirAttribute +function mlirSparseTensorEncodingAttrGet(ctx, lvlRank, lvlTypes, dimToLvl, lvlTodim, posWidth, crdWidth, explicitVal, implicitVal) + @ccall mlir_c.mlirSparseTensorEncodingAttrGet(ctx::MlirContext, lvlRank::intptr_t, lvlTypes::Ptr{MlirSparseTensorLevelType}, dimToLvl::MlirAffineMap, lvlTodim::MlirAffineMap, posWidth::Cint, crdWidth::Cint, explicitVal::MlirAttribute, implicitVal::MlirAttribute)::MlirAttribute end """ @@ -8555,9 +7597,7 @@ end Returns a specified level-type of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetLvlType(attr, lvl) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlType( - attr::MlirAttribute, lvl::intptr_t - )::MlirSparseTensorLevelType + @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlType(attr::MlirAttribute, lvl::intptr_t)::MlirSparseTensorLevelType end """ @@ -8566,9 +7606,7 @@ end Returns a specified level-format of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetLvlFmt(attr, lvl) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlFmt( - attr::MlirAttribute, lvl::intptr_t - )::MlirSparseTensorLevelFormat + @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlFmt(attr::MlirAttribute, lvl::intptr_t)::MlirSparseTensorLevelFormat end """ @@ -8577,9 +7615,7 @@ end Returns the dimension-to-level mapping of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetDimToLvl(attr) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetDimToLvl( - attr::MlirAttribute - )::MlirAffineMap + @ccall mlir_c.mlirSparseTensorEncodingAttrGetDimToLvl(attr::MlirAttribute)::MlirAffineMap end """ @@ -8588,9 +7624,7 @@ end Returns the level-to-dimension mapping of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetLvlToDim(attr) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlToDim( - attr::MlirAttribute - )::MlirAffineMap + @ccall mlir_c.mlirSparseTensorEncodingAttrGetLvlToDim(attr::MlirAttribute)::MlirAffineMap end """ @@ -8617,9 +7651,7 @@ end Returns the explicit value of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetExplicitVal(attr) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetExplicitVal( - attr::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirSparseTensorEncodingAttrGetExplicitVal(attr::MlirAttribute)::MlirAttribute end """ @@ -8628,31 +7660,19 @@ end Returns the implicit value of the `sparse\\_tensor.encoding` attribute. """ function mlirSparseTensorEncodingAttrGetImplicitVal(attr) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetImplicitVal( - attr::MlirAttribute - )::MlirAttribute + @ccall mlir_c.mlirSparseTensorEncodingAttrGetImplicitVal(attr::MlirAttribute)::MlirAttribute end function mlirSparseTensorEncodingAttrGetStructuredN(lvlType) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetStructuredN( - lvlType::MlirSparseTensorLevelType - )::Cuint + @ccall mlir_c.mlirSparseTensorEncodingAttrGetStructuredN(lvlType::MlirSparseTensorLevelType)::Cuint end function mlirSparseTensorEncodingAttrGetStructuredM(lvlType) - @ccall mlir_c.mlirSparseTensorEncodingAttrGetStructuredM( - lvlType::MlirSparseTensorLevelType - )::Cuint + @ccall mlir_c.mlirSparseTensorEncodingAttrGetStructuredM(lvlType::MlirSparseTensorLevelType)::Cuint end function mlirSparseTensorEncodingAttrBuildLvlType(lvlFmt, properties, propSize, n, m) - @ccall mlir_c.mlirSparseTensorEncodingAttrBuildLvlType( - lvlFmt::MlirSparseTensorLevelFormat, - properties::Ptr{MlirSparseTensorLevelPropertyNondefault}, - propSize::Cuint, - n::Cuint, - m::Cuint, - )::MlirSparseTensorLevelType + @ccall mlir_c.mlirSparseTensorEncodingAttrBuildLvlType(lvlFmt::MlirSparseTensorLevelFormat, properties::Ptr{MlirSparseTensorLevelPropertyNondefault}, propSize::Cuint, n::Cuint, m::Cuint)::MlirSparseTensorLevelType end function mlirRegisterSparseTensorPasses() @@ -8840,9 +7860,7 @@ function mlirTransformOperationTypeGetTypeID() end function mlirTransformOperationTypeGet(ctx, operationName) - @ccall mlir_c.mlirTransformOperationTypeGet( - ctx::MlirContext, operationName::MlirStringRef - )::MlirType + @ccall mlir_c.mlirTransformOperationTypeGet(ctx::MlirContext, operationName::MlirStringRef)::MlirType end function mlirTransformOperationTypeGetOperationName(type) @@ -8884,9 +7902,7 @@ end Enables or disables expensive checks in transform options. """ function mlirTransformOptionsEnableExpensiveChecks(transformOptions, enable) - @ccall mlir_c.mlirTransformOptionsEnableExpensiveChecks( - transformOptions::MlirTransformOptions, enable::Bool - )::Cvoid + @ccall mlir_c.mlirTransformOptionsEnableExpensiveChecks(transformOptions::MlirTransformOptions, enable::Bool)::Cvoid end """ @@ -8895,9 +7911,7 @@ end Returns true if expensive checks are enabled in transform options. """ function mlirTransformOptionsGetExpensiveChecksEnabled(transformOptions) - @ccall mlir_c.mlirTransformOptionsGetExpensiveChecksEnabled( - transformOptions::MlirTransformOptions - )::Bool + @ccall mlir_c.mlirTransformOptionsGetExpensiveChecksEnabled(transformOptions::MlirTransformOptions)::Bool end """ @@ -8906,9 +7920,7 @@ end Enables or disables the enforcement of the top-level transform op being single in transform options. """ function mlirTransformOptionsEnforceSingleTopLevelTransformOp(transformOptions, enable) - @ccall mlir_c.mlirTransformOptionsEnforceSingleTopLevelTransformOp( - transformOptions::MlirTransformOptions, enable::Bool - )::Cvoid + @ccall mlir_c.mlirTransformOptionsEnforceSingleTopLevelTransformOp(transformOptions::MlirTransformOptions, enable::Bool)::Cvoid end """ @@ -8917,9 +7929,7 @@ end Returns true if the enforcement of the top-level transform op being single is enabled in transform options. """ function mlirTransformOptionsGetEnforceSingleTopLevelTransformOp(transformOptions) - @ccall mlir_c.mlirTransformOptionsGetEnforceSingleTopLevelTransformOp( - transformOptions::MlirTransformOptions - )::Bool + @ccall mlir_c.mlirTransformOptionsGetEnforceSingleTopLevelTransformOp(transformOptions::MlirTransformOptions)::Bool end """ @@ -8936,15 +7946,8 @@ end 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. """ -function mlirTransformApplyNamedSequence( - payload, transformRoot, transformModule, transformOptions -) - @ccall mlir_c.mlirTransformApplyNamedSequence( - payload::MlirOperation, - transformRoot::MlirOperation, - transformModule::MlirOperation, - transformOptions::MlirTransformOptions, - )::MlirLogicalResult +function mlirTransformApplyNamedSequence(payload, transformRoot, transformModule, transformOptions) + @ccall mlir_c.mlirTransformApplyNamedSequence(payload::MlirOperation, transformRoot::MlirOperation, transformModule::MlirOperation, transformOptions::MlirTransformOptions)::MlirLogicalResult end """ @@ -8955,9 +7958,7 @@ Merge the symbols from `other` into `target`, potentially renaming them to avoid Note that this clones the `other` operation unlike the C++ counterpart that takes ownership. """ function mlirMergeSymbolsIntoFromClone(target, other) - @ccall mlir_c.mlirMergeSymbolsIntoFromClone( - target::MlirOperation, other::MlirOperation - )::MlirLogicalResult + @ccall mlir_c.mlirMergeSymbolsIntoFromClone(target::MlirOperation, other::MlirOperation)::MlirLogicalResult end function mlirGetDialectHandle__vector__() @@ -8974,13 +7975,7 @@ end 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. """ function mlirExecutionEngineCreate(op, optLevel, numPaths, sharedLibPaths, enableObjectDump) - @ccall mlir_c.mlirExecutionEngineCreate( - op::MlirModule, - optLevel::Cint, - numPaths::Cint, - sharedLibPaths::Ptr{MlirStringRef}, - enableObjectDump::Bool, - )::MlirExecutionEngine + @ccall mlir_c.mlirExecutionEngineCreate(op::MlirModule, optLevel::Cint, numPaths::Cint, sharedLibPaths::Ptr{MlirStringRef}, enableObjectDump::Bool)::MlirExecutionEngine end """ @@ -9007,9 +8002,7 @@ end 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). """ function mlirExecutionEngineInvokePacked(jit, name, arguments) - @ccall mlir_c.mlirExecutionEngineInvokePacked( - jit::MlirExecutionEngine, name::MlirStringRef, arguments::Ptr{Ptr{Cvoid}} - )::MlirLogicalResult + @ccall mlir_c.mlirExecutionEngineInvokePacked(jit::MlirExecutionEngine, name::MlirStringRef, arguments::Ptr{Ptr{Cvoid}})::MlirLogicalResult end """ @@ -9018,9 +8011,7 @@ end Lookup the wrapper of the native function in the execution engine with the given name, returns nullptr if the function can't be looked-up. """ function mlirExecutionEngineLookupPacked(jit, name) - @ccall mlir_c.mlirExecutionEngineLookupPacked( - jit::MlirExecutionEngine, name::MlirStringRef - )::Ptr{Cvoid} + @ccall mlir_c.mlirExecutionEngineLookupPacked(jit::MlirExecutionEngine, name::MlirStringRef)::Ptr{Cvoid} end """ @@ -9029,9 +8020,7 @@ end Lookup a native function in the execution engine by name, returns nullptr if the name can't be looked-up. """ function mlirExecutionEngineLookup(jit, name) - @ccall mlir_c.mlirExecutionEngineLookup( - jit::MlirExecutionEngine, name::MlirStringRef - )::Ptr{Cvoid} + @ccall mlir_c.mlirExecutionEngineLookup(jit::MlirExecutionEngine, name::MlirStringRef)::Ptr{Cvoid} end """ @@ -9040,9 +8029,7 @@ end Register a symbol with the jit: this symbol will be accessible to the jitted code. """ function mlirExecutionEngineRegisterSymbol(jit, name, sym) - @ccall mlir_c.mlirExecutionEngineRegisterSymbol( - jit::MlirExecutionEngine, name::MlirStringRef, sym::Ptr{Cvoid} - )::Cvoid + @ccall mlir_c.mlirExecutionEngineRegisterSymbol(jit::MlirExecutionEngine, name::MlirStringRef, sym::Ptr{Cvoid})::Cvoid end """ @@ -9051,9 +8038,7 @@ end Dump as an object in `fileName`. """ function mlirExecutionEngineDumpToObjectFile(jit, fileName) - @ccall mlir_c.mlirExecutionEngineDumpToObjectFile( - jit::MlirExecutionEngine, fileName::MlirStringRef - )::Cvoid + @ccall mlir_c.mlirExecutionEngineDumpToObjectFile(jit::MlirExecutionEngine, fileName::MlirStringRef)::Cvoid end """ @@ -9062,9 +8047,7 @@ end Returns `true` if the given operation implements an interface identified by its TypeID. """ function mlirOperationImplementsInterface(operation, interfaceTypeID) - @ccall mlir_c.mlirOperationImplementsInterface( - operation::MlirOperation, interfaceTypeID::MlirTypeID - )::Bool + @ccall mlir_c.mlirOperationImplementsInterface(operation::MlirOperation, interfaceTypeID::MlirTypeID)::Bool end """ @@ -9073,9 +8056,7 @@ end 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. """ function mlirOperationImplementsInterfaceStatic(operationName, context, interfaceTypeID) - @ccall mlir_c.mlirOperationImplementsInterfaceStatic( - operationName::MlirStringRef, context::MlirContext, interfaceTypeID::MlirTypeID - )::Bool + @ccall mlir_c.mlirOperationImplementsInterfaceStatic(operationName::MlirStringRef, context::MlirContext, interfaceTypeID::MlirTypeID)::Bool end """ @@ -9098,32 +8079,8 @@ const MlirTypesCallback = Ptr{Cvoid} 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. """ -function mlirInferTypeOpInterfaceInferReturnTypes( - opName, - context, - location, - nOperands, - operands, - attributes, - properties, - nRegions, - regions, - callback, - userData, -) - @ccall mlir_c.mlirInferTypeOpInterfaceInferReturnTypes( - opName::MlirStringRef, - context::MlirContext, - location::MlirLocation, - nOperands::intptr_t, - operands::Ptr{MlirValue}, - attributes::MlirAttribute, - properties::Ptr{Cvoid}, - nRegions::intptr_t, - regions::Ptr{MlirRegion}, - callback::MlirTypesCallback, - userData::Ptr{Cvoid}, - )::MlirLogicalResult +function mlirInferTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, nRegions, regions, callback, userData) + @ccall mlir_c.mlirInferTypeOpInterfaceInferReturnTypes(opName::MlirStringRef, context::MlirContext, location::MlirLocation, nOperands::intptr_t, operands::Ptr{MlirValue}, attributes::MlirAttribute, properties::Ptr{Cvoid}, nRegions::intptr_t, regions::Ptr{MlirRegion}, callback::MlirTypesCallback, userData::Ptr{Cvoid})::MlirLogicalResult end """ @@ -9146,32 +8103,8 @@ const MlirShapedTypeComponentsCallback = Ptr{Cvoid} Infers the return shaped type components of the operation. Calls `callback` with the types of inferred arguments on success. Returns failure otherwise. """ -function mlirInferShapedTypeOpInterfaceInferReturnTypes( - opName, - context, - location, - nOperands, - operands, - attributes, - properties, - nRegions, - regions, - callback, - userData, -) - @ccall mlir_c.mlirInferShapedTypeOpInterfaceInferReturnTypes( - opName::MlirStringRef, - context::MlirContext, - location::MlirLocation, - nOperands::intptr_t, - operands::Ptr{MlirValue}, - attributes::MlirAttribute, - properties::Ptr{Cvoid}, - nRegions::intptr_t, - regions::Ptr{MlirRegion}, - callback::MlirShapedTypeComponentsCallback, - userData::Ptr{Cvoid}, - )::MlirLogicalResult +function mlirInferShapedTypeOpInterfaceInferReturnTypes(opName, context, location, nOperands, operands, attributes, properties, nRegions, regions, callback, userData) + @ccall mlir_c.mlirInferShapedTypeOpInterfaceInferReturnTypes(opName::MlirStringRef, context::MlirContext, location::MlirLocation, nOperands::intptr_t, operands::Ptr{MlirValue}, attributes::MlirAttribute, properties::Ptr{Cvoid}, nRegions::intptr_t, regions::Ptr{MlirRegion}, callback::MlirShapedTypeComponentsCallback, userData::Ptr{Cvoid})::MlirLogicalResult end """ @@ -9241,9 +8174,7 @@ end Sets the insertion point to the specified operation, which will cause subsequent insertions to go right before it. """ function mlirRewriterBaseSetInsertionPointBefore(rewriter, op) - @ccall mlir_c.mlirRewriterBaseSetInsertionPointBefore( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseSetInsertionPointBefore(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9252,9 +8183,7 @@ end Sets the insertion point to the node after the specified operation, which will cause subsequent insertions to go right after it. """ function mlirRewriterBaseSetInsertionPointAfter(rewriter, op) - @ccall mlir_c.mlirRewriterBaseSetInsertionPointAfter( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseSetInsertionPointAfter(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9263,9 +8192,7 @@ end Sets the insertion point to the node after the specified value. If value has a defining operation, sets the insertion point to the node after such defining operation. This will cause subsequent insertions to go right after it. Otherwise, value is a BlockArgument. Sets the insertion point to the start of its block. """ function mlirRewriterBaseSetInsertionPointAfterValue(rewriter, value) - @ccall mlir_c.mlirRewriterBaseSetInsertionPointAfterValue( - rewriter::MlirRewriterBase, value::MlirValue - )::Cvoid + @ccall mlir_c.mlirRewriterBaseSetInsertionPointAfterValue(rewriter::MlirRewriterBase, value::MlirValue)::Cvoid end """ @@ -9274,9 +8201,7 @@ end Sets the insertion point to the start of the specified block. """ function mlirRewriterBaseSetInsertionPointToStart(rewriter, block) - @ccall mlir_c.mlirRewriterBaseSetInsertionPointToStart( - rewriter::MlirRewriterBase, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseSetInsertionPointToStart(rewriter::MlirRewriterBase, block::MlirBlock)::Cvoid end """ @@ -9285,9 +8210,7 @@ end Sets the insertion point to the end of the specified block. """ function mlirRewriterBaseSetInsertionPointToEnd(rewriter, block) - @ccall mlir_c.mlirRewriterBaseSetInsertionPointToEnd( - rewriter::MlirRewriterBase, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseSetInsertionPointToEnd(rewriter::MlirRewriterBase, block::MlirBlock)::Cvoid end """ @@ -9313,16 +8236,8 @@ end Add new block with 'argTypes' arguments and set the insertion point to the end of it. The block is placed before 'insertBefore'. `locs` contains the locations of the inserted arguments, and should match the size of `argTypes`. """ -function mlirRewriterBaseCreateBlockBefore( - rewriter, insertBefore, nArgTypes, argTypes, locations -) - @ccall mlir_c.mlirRewriterBaseCreateBlockBefore( - rewriter::MlirRewriterBase, - insertBefore::MlirBlock, - nArgTypes::intptr_t, - argTypes::Ptr{MlirType}, - locations::Ptr{MlirLocation}, - )::MlirBlock +function mlirRewriterBaseCreateBlockBefore(rewriter, insertBefore, nArgTypes, argTypes, locations) + @ccall mlir_c.mlirRewriterBaseCreateBlockBefore(rewriter::MlirRewriterBase, insertBefore::MlirBlock, nArgTypes::intptr_t, argTypes::Ptr{MlirType}, locations::Ptr{MlirLocation})::MlirBlock end """ @@ -9331,9 +8246,7 @@ end Insert the given operation at the current insertion point and return it. """ function mlirRewriterBaseInsert(rewriter, op) - @ccall mlir_c.mlirRewriterBaseInsert( - rewriter::MlirRewriterBase, op::MlirOperation - )::MlirOperation + @ccall mlir_c.mlirRewriterBaseInsert(rewriter::MlirRewriterBase, op::MlirOperation)::MlirOperation end """ @@ -9342,9 +8255,7 @@ end Creates a deep copy of the specified operation. """ function mlirRewriterBaseClone(rewriter, op) - @ccall mlir_c.mlirRewriterBaseClone( - rewriter::MlirRewriterBase, op::MlirOperation - )::MlirOperation + @ccall mlir_c.mlirRewriterBaseClone(rewriter::MlirRewriterBase, op::MlirOperation)::MlirOperation end """ @@ -9353,9 +8264,7 @@ end Creates a deep copy of this operation but keep the operation regions empty. """ function mlirRewriterBaseCloneWithoutRegions(rewriter, op) - @ccall mlir_c.mlirRewriterBaseCloneWithoutRegions( - rewriter::MlirRewriterBase, op::MlirOperation - )::MlirOperation + @ccall mlir_c.mlirRewriterBaseCloneWithoutRegions(rewriter::MlirRewriterBase, op::MlirOperation)::MlirOperation end """ @@ -9364,9 +8273,7 @@ end Clone the blocks that belong to "region" before the given position in another region "parent". """ function mlirRewriterBaseCloneRegionBefore(rewriter, region, before) - @ccall mlir_c.mlirRewriterBaseCloneRegionBefore( - rewriter::MlirRewriterBase, region::MlirRegion, before::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseCloneRegionBefore(rewriter::MlirRewriterBase, region::MlirRegion, before::MlirBlock)::Cvoid end """ @@ -9375,9 +8282,7 @@ end Move the blocks that belong to "region" before the given position in another region "parent". The two regions must be different. The caller is responsible for creating or updating the operation transferring flow of control to the region and passing it the correct block arguments. """ function mlirRewriterBaseInlineRegionBefore(rewriter, region, before) - @ccall mlir_c.mlirRewriterBaseInlineRegionBefore( - rewriter::MlirRewriterBase, region::MlirRegion, before::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseInlineRegionBefore(rewriter::MlirRewriterBase, region::MlirRegion, before::MlirBlock)::Cvoid end """ @@ -9386,12 +8291,7 @@ end Replace the results of the given (original) operation with the specified list of values (replacements). The result types of the given op and the replacements must match. The original op is erased. """ function mlirRewriterBaseReplaceOpWithValues(rewriter, op, nValues, values) - @ccall mlir_c.mlirRewriterBaseReplaceOpWithValues( - rewriter::MlirRewriterBase, - op::MlirOperation, - nValues::intptr_t, - values::Ptr{MlirValue}, - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceOpWithValues(rewriter::MlirRewriterBase, op::MlirOperation, nValues::intptr_t, values::Ptr{MlirValue})::Cvoid end """ @@ -9400,9 +8300,7 @@ end Replace the results of the given (original) operation with the specified new op (replacement). The result types of the two ops must match. The original op is erased. """ function mlirRewriterBaseReplaceOpWithOperation(rewriter, op, newOp) - @ccall mlir_c.mlirRewriterBaseReplaceOpWithOperation( - rewriter::MlirRewriterBase, op::MlirOperation, newOp::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceOpWithOperation(rewriter::MlirRewriterBase, op::MlirOperation, newOp::MlirOperation)::Cvoid end """ @@ -9411,9 +8309,7 @@ end Erases an operation that is known to have no uses. """ function mlirRewriterBaseEraseOp(rewriter, op) - @ccall mlir_c.mlirRewriterBaseEraseOp( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseEraseOp(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9422,9 +8318,7 @@ end Erases a block along with all operations inside it. """ function mlirRewriterBaseEraseBlock(rewriter, block) - @ccall mlir_c.mlirRewriterBaseEraseBlock( - rewriter::MlirRewriterBase, block::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseEraseBlock(rewriter::MlirRewriterBase, block::MlirBlock)::Cvoid end """ @@ -9435,13 +8329,7 @@ Inline the operations of block 'source' before the operation 'op'. The source bl The source block must have no successors. Otherwise, the resulting IR would have unreachable operations. """ function mlirRewriterBaseInlineBlockBefore(rewriter, source, op, nArgValues, argValues) - @ccall mlir_c.mlirRewriterBaseInlineBlockBefore( - rewriter::MlirRewriterBase, - source::MlirBlock, - op::MlirOperation, - nArgValues::intptr_t, - argValues::Ptr{MlirValue}, - )::Cvoid + @ccall mlir_c.mlirRewriterBaseInlineBlockBefore(rewriter::MlirRewriterBase, source::MlirBlock, op::MlirOperation, nArgValues::intptr_t, argValues::Ptr{MlirValue})::Cvoid end """ @@ -9452,13 +8340,7 @@ Inline the operations of block 'source' into the end of block 'dest'. The source The dest block must have no successors. Otherwise, the resulting IR would have unreachable operation. """ function mlirRewriterBaseMergeBlocks(rewriter, source, dest, nArgValues, argValues) - @ccall mlir_c.mlirRewriterBaseMergeBlocks( - rewriter::MlirRewriterBase, - source::MlirBlock, - dest::MlirBlock, - nArgValues::intptr_t, - argValues::Ptr{MlirValue}, - )::Cvoid + @ccall mlir_c.mlirRewriterBaseMergeBlocks(rewriter::MlirRewriterBase, source::MlirBlock, dest::MlirBlock, nArgValues::intptr_t, argValues::Ptr{MlirValue})::Cvoid end """ @@ -9467,9 +8349,7 @@ end Unlink this operation from its current block and insert it right before `existingOp` which may be in the same or another block in the same function. """ function mlirRewriterBaseMoveOpBefore(rewriter, op, existingOp) - @ccall mlir_c.mlirRewriterBaseMoveOpBefore( - rewriter::MlirRewriterBase, op::MlirOperation, existingOp::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseMoveOpBefore(rewriter::MlirRewriterBase, op::MlirOperation, existingOp::MlirOperation)::Cvoid end """ @@ -9478,9 +8358,7 @@ end Unlink this operation from its current block and insert it right after `existingOp` which may be in the same or another block in the same function. """ function mlirRewriterBaseMoveOpAfter(rewriter, op, existingOp) - @ccall mlir_c.mlirRewriterBaseMoveOpAfter( - rewriter::MlirRewriterBase, op::MlirOperation, existingOp::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseMoveOpAfter(rewriter::MlirRewriterBase, op::MlirOperation, existingOp::MlirOperation)::Cvoid end """ @@ -9489,9 +8367,7 @@ end Unlink this block and insert it right before `existingBlock`. """ function mlirRewriterBaseMoveBlockBefore(rewriter, block, existingBlock) - @ccall mlir_c.mlirRewriterBaseMoveBlockBefore( - rewriter::MlirRewriterBase, block::MlirBlock, existingBlock::MlirBlock - )::Cvoid + @ccall mlir_c.mlirRewriterBaseMoveBlockBefore(rewriter::MlirRewriterBase, block::MlirBlock, existingBlock::MlirBlock)::Cvoid end """ @@ -9500,9 +8376,7 @@ end This method is used to notify the rewriter that an in-place operation modification is about to happen. A call to this function *must* be followed by a call to either `finalizeOpModification` or `cancelOpModification`. This is a minor efficiency win (it avoids creating a new operation and removing the old one) but also often allows simpler code in the client. """ function mlirRewriterBaseStartOpModification(rewriter, op) - @ccall mlir_c.mlirRewriterBaseStartOpModification( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseStartOpModification(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9511,9 +8385,7 @@ end This method is used to signal the end of an in-place modification of the given operation. This can only be called on operations that were provided to a call to `startOpModification`. """ function mlirRewriterBaseFinalizeOpModification(rewriter, op) - @ccall mlir_c.mlirRewriterBaseFinalizeOpModification( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseFinalizeOpModification(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9522,9 +8394,7 @@ end This method cancels a pending in-place modification. This can only be called on operations that were provided to a call to `startOpModification`. """ function mlirRewriterBaseCancelOpModification(rewriter, op) - @ccall mlir_c.mlirRewriterBaseCancelOpModification( - rewriter::MlirRewriterBase, op::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseCancelOpModification(rewriter::MlirRewriterBase, op::MlirOperation)::Cvoid end """ @@ -9533,9 +8403,7 @@ end Find uses of `from` and replace them with `to`. Also notify the listener about every in-place op modification (for every use that was replaced). """ function mlirRewriterBaseReplaceAllUsesWith(rewriter, from, to) - @ccall mlir_c.mlirRewriterBaseReplaceAllUsesWith( - rewriter::MlirRewriterBase, from::MlirValue, to::MlirValue - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceAllUsesWith(rewriter::MlirRewriterBase, from::MlirValue, to::MlirValue)::Cvoid end """ @@ -9544,12 +8412,7 @@ end Find uses of `from` and replace them with `to`. Also notify the listener about every in-place op modification (for every use that was replaced). """ function mlirRewriterBaseReplaceAllValueRangeUsesWith(rewriter, nValues, from, to) - @ccall mlir_c.mlirRewriterBaseReplaceAllValueRangeUsesWith( - rewriter::MlirRewriterBase, - nValues::intptr_t, - from::Ptr{MlirValue}, - to::Ptr{MlirValue}, - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceAllValueRangeUsesWith(rewriter::MlirRewriterBase, nValues::intptr_t, from::Ptr{MlirValue}, to::Ptr{MlirValue})::Cvoid end """ @@ -9558,9 +8421,7 @@ end Find uses of `from` and replace them with `to`. Also notify the listener about every in-place op modification (for every use that was replaced) and that the `from` operation is about to be replaced. """ function mlirRewriterBaseReplaceAllOpUsesWithValueRange(rewriter, from, nTo, to) - @ccall mlir_c.mlirRewriterBaseReplaceAllOpUsesWithValueRange( - rewriter::MlirRewriterBase, from::MlirOperation, nTo::intptr_t, to::Ptr{MlirValue} - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceAllOpUsesWithValueRange(rewriter::MlirRewriterBase, from::MlirOperation, nTo::intptr_t, to::Ptr{MlirValue})::Cvoid end """ @@ -9569,9 +8430,7 @@ end Find uses of `from` and replace them with `to`. Also notify the listener about every in-place op modification (for every use that was replaced) and that the `from` operation is about to be replaced. """ function mlirRewriterBaseReplaceAllOpUsesWithOperation(rewriter, from, to) - @ccall mlir_c.mlirRewriterBaseReplaceAllOpUsesWithOperation( - rewriter::MlirRewriterBase, from::MlirOperation, to::MlirOperation - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceAllOpUsesWithOperation(rewriter::MlirRewriterBase, from::MlirOperation, to::MlirOperation)::Cvoid end """ @@ -9579,16 +8438,8 @@ end Find uses of `from` within `block` and replace them with `to`. Also notify the listener about every in-place op modification (for every use that was replaced). The optional `allUsesReplaced` flag is set to "true" if all uses were replaced. """ -function mlirRewriterBaseReplaceOpUsesWithinBlock( - rewriter, op, nNewValues, newValues, block -) - @ccall mlir_c.mlirRewriterBaseReplaceOpUsesWithinBlock( - rewriter::MlirRewriterBase, - op::MlirOperation, - nNewValues::intptr_t, - newValues::Ptr{MlirValue}, - block::MlirBlock, - )::Cvoid +function mlirRewriterBaseReplaceOpUsesWithinBlock(rewriter, op, nNewValues, newValues, block) + @ccall mlir_c.mlirRewriterBaseReplaceOpUsesWithinBlock(rewriter::MlirRewriterBase, op::MlirOperation, nNewValues::intptr_t, newValues::Ptr{MlirValue}, block::MlirBlock)::Cvoid end """ @@ -9597,12 +8448,7 @@ end Find uses of `from` and replace them with `to` except if the user is `exceptedUser`. Also notify the listener about every in-place op modification (for every use that was replaced). """ function mlirRewriterBaseReplaceAllUsesExcept(rewriter, from, to, exceptedUser) - @ccall mlir_c.mlirRewriterBaseReplaceAllUsesExcept( - rewriter::MlirRewriterBase, - from::MlirValue, - to::MlirValue, - exceptedUser::MlirOperation, - )::Cvoid + @ccall mlir_c.mlirRewriterBaseReplaceAllUsesExcept(rewriter::MlirRewriterBase, from::MlirValue, to::MlirValue, exceptedUser::MlirOperation)::Cvoid end """ @@ -9638,9 +8484,7 @@ end FrozenRewritePatternSet API """ function mlirFreezeRewritePattern(op) - @ccall mlir_c.mlirFreezeRewritePattern( - op::MlirRewritePatternSet - )::MlirFrozenRewritePatternSet + @ccall mlir_c.mlirFreezeRewritePattern(op::MlirRewritePatternSet)::MlirFrozenRewritePatternSet end function mlirFrozenRewritePatternSetDestroy(op) @@ -9648,11 +8492,7 @@ function mlirFrozenRewritePatternSetDestroy(op) end function mlirApplyPatternsAndFoldGreedily(op, patterns, arg3) - @ccall mlir_c.mlirApplyPatternsAndFoldGreedily( - op::MlirModule, - patterns::MlirFrozenRewritePatternSet, - arg3::MlirGreedyRewriteDriverConfig, - )::MlirLogicalResult + @ccall mlir_c.mlirApplyPatternsAndFoldGreedily(op::MlirModule, patterns::MlirFrozenRewritePatternSet, arg3::MlirGreedyRewriteDriverConfig)::MlirLogicalResult end """ @@ -9667,7 +8507,7 @@ mutable struct LLVMOpaqueMemoryBuffer end """ Used to pass regions of memory through LLVM interfaces. -# See also +### See also llvm::MemoryBuffer """ const LLVMMemoryBufferRef = Ptr{LLVMOpaqueMemoryBuffer} @@ -9684,7 +8524,7 @@ mutable struct LLVMOpaqueModule end """ The top-level container for all other LLVM Intermediate Representation (IR) objects. -# See also +### See also llvm::Module """ const LLVMModuleRef = Ptr{LLVMOpaqueModule} @@ -9694,7 +8534,7 @@ mutable struct LLVMOpaqueType end """ Each value in the LLVM IR has a type, an [`LLVMTypeRef`](@ref). -# See also +### See also llvm::Type """ const LLVMTypeRef = Ptr{LLVMOpaqueType} @@ -9772,7 +8612,7 @@ const LLVMModuleProviderRef = Ptr{LLVMOpaqueModuleProvider} mutable struct LLVMOpaquePassManager end """ -# See also +### See also llvm::PassManagerBase """ const LLVMPassManagerRef = Ptr{LLVMOpaquePassManager} @@ -9782,7 +8622,7 @@ mutable struct LLVMOpaqueUse end """ Used to get the users and usees of a Value. -# See also +### See also llvm::Use """ const LLVMUseRef = Ptr{LLVMOpaqueUse} @@ -9790,7 +8630,7 @@ const LLVMUseRef = Ptr{LLVMOpaqueUse} mutable struct LLVMOpaqueOperandBundle end """ -# See also +### See also llvm::OperandBundleDef """ const LLVMOperandBundleRef = Ptr{LLVMOpaqueOperandBundle} @@ -9800,7 +8640,7 @@ mutable struct LLVMOpaqueAttributeRef end """ Used to represent an attributes. -# See also +### See also llvm::Attribute """ const LLVMAttributeRef = Ptr{LLVMOpaqueAttributeRef} @@ -9808,7 +8648,7 @@ const LLVMAttributeRef = Ptr{LLVMOpaqueAttributeRef} mutable struct LLVMOpaqueDiagnosticInfo end """ -# See also +### See also llvm::DiagnosticInfo """ const LLVMDiagnosticInfoRef = Ptr{LLVMOpaqueDiagnosticInfo} @@ -9816,7 +8656,7 @@ const LLVMDiagnosticInfoRef = Ptr{LLVMOpaqueDiagnosticInfo} mutable struct LLVMComdat end """ -# See also +### See also llvm::Comdat """ const LLVMComdatRef = Ptr{LLVMComdat} @@ -9824,7 +8664,7 @@ const LLVMComdatRef = Ptr{LLVMComdat} mutable struct LLVMOpaqueModuleFlagEntry end """ -# See also +### See also llvm::Module::ModuleFlagEntry """ const LLVMModuleFlagEntry = LLVMOpaqueModuleFlagEntry @@ -9832,7 +8672,7 @@ const LLVMModuleFlagEntry = LLVMOpaqueModuleFlagEntry mutable struct LLVMOpaqueJITEventListener end """ -# See also +### See also llvm::JITEventListener """ const LLVMJITEventListenerRef = Ptr{LLVMOpaqueJITEventListener} @@ -9840,7 +8680,7 @@ const LLVMJITEventListenerRef = Ptr{LLVMOpaqueJITEventListener} mutable struct LLVMOpaqueBinary end """ -# See also +### See also llvm::object::Binary """ const LLVMBinaryRef = Ptr{LLVMOpaqueBinary} @@ -9848,7 +8688,7 @@ const LLVMBinaryRef = Ptr{LLVMOpaqueBinary} mutable struct LLVMOpaqueDbgRecord end """ -# See also +### See also llvm::DbgRecord """ const LLVMDbgRecordRef = Ptr{LLVMOpaqueDbgRecord} @@ -9858,7 +8698,7 @@ const LLVMDbgRecordRef = Ptr{LLVMOpaqueDbgRecord} 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 +### See also sys::DynamicLibrary::LoadLibraryPermanently() """ function LLVMLoadLibraryPermanently(Filename) @@ -9870,13 +8710,11 @@ end 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 +### See also llvm::cl::ParseCommandLineOptions() """ function LLVMParseCommandLineOptions(argc, argv, Overview) - @ccall mlir_c.LLVMParseCommandLineOptions( - argc::Cint, argv::Ptr{Cstring}, Overview::Cstring - )::Cvoid + @ccall mlir_c.LLVMParseCommandLineOptions(argc::Cint, argv::Ptr{Cstring}, Overview::Cstring)::Cvoid end """ @@ -9884,7 +8722,7 @@ end 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 +### See also sys::DynamicLibrary::SearchForAddressOfSymbol() """ function LLVMSearchForAddressOfSymbol(symbolName) @@ -9896,7 +8734,7 @@ end This functions permanently adds the symbol `symbolName` with the value `symbolValue`. These symbols are searched before any libraries. -# See also +### See also sys::DynamicLibrary::AddSymbol() """ function LLVMAddSymbol(symbolName, symbolValue) @@ -9908,13 +8746,11 @@ end 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 +### Returns the generated LLVM IR Module from the translated MLIR module, it is owned by the caller. """ function mlirTranslateModuleToLLVMIR(_module, context) - @ccall mlir_c.mlirTranslateModuleToLLVMIR( - _module::MlirOperation, context::LLVMContextRef - )::LLVMModuleRef + @ccall mlir_c.mlirTranslateModuleToLLVMIR(_module::MlirOperation, context::LLVMContextRef)::LLVMModuleRef end function mlirRegisterTransformsPasses() @@ -10081,34 +8917,8 @@ function mlirRegisterTransformsViewOpGraph() @ccall mlir_c.mlirRegisterTransformsViewOpGraph()::Cvoid end -function stablehloScatterDimensionNumbersGet( - ctx, - nUpdateWindowDims, - updateWindowDims, - nInsertedWindowDims, - insertedWindowDims, - nInputBatchingDims, - inputBatchingDims, - nScatterIndicesBatchingDims, - scatterIndicesBatchingDims, - nScatteredDimsToOperandDims, - scatteredDimsToOperandDims, - indexVectorDim, -) - @ccall mlir_c.stablehloScatterDimensionNumbersGet( - ctx::MlirContext, - nUpdateWindowDims::intptr_t, - updateWindowDims::Ptr{Int64}, - nInsertedWindowDims::intptr_t, - insertedWindowDims::Ptr{Int64}, - nInputBatchingDims::intptr_t, - inputBatchingDims::Ptr{Int64}, - nScatterIndicesBatchingDims::intptr_t, - scatterIndicesBatchingDims::Ptr{Int64}, - nScatteredDimsToOperandDims::intptr_t, - scatteredDimsToOperandDims::Ptr{Int64}, - indexVectorDim::Int64, - )::MlirAttribute +function stablehloScatterDimensionNumbersGet(ctx, nUpdateWindowDims, updateWindowDims, nInsertedWindowDims, insertedWindowDims, nInputBatchingDims, inputBatchingDims, nScatterIndicesBatchingDims, scatterIndicesBatchingDims, nScatteredDimsToOperandDims, scatteredDimsToOperandDims, indexVectorDim) + @ccall mlir_c.stablehloScatterDimensionNumbersGet(ctx::MlirContext, nUpdateWindowDims::intptr_t, updateWindowDims::Ptr{Int64}, nInsertedWindowDims::intptr_t, insertedWindowDims::Ptr{Int64}, nInputBatchingDims::intptr_t, inputBatchingDims::Ptr{Int64}, nScatterIndicesBatchingDims::intptr_t, scatterIndicesBatchingDims::Ptr{Int64}, nScatteredDimsToOperandDims::intptr_t, scatteredDimsToOperandDims::Ptr{Int64}, indexVectorDim::Int64)::MlirAttribute end function stablehloAttributeIsAScatterDimensionNumbers(attr) @@ -10116,97 +8926,51 @@ function stablehloAttributeIsAScatterDimensionNumbers(attr) end function stablehloScatterDimensionNumbersGetUpdateWindowDimsSize(attr) - @ccall mlir_c.stablehloScatterDimensionNumbersGetUpdateWindowDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloScatterDimensionNumbersGetUpdateWindowDimsSize(attr::MlirAttribute)::intptr_t end function stablehloScatterDimensionNumbersGetUpdateWindowDimsElem(attr, pos) - @ccall mlir_c.stablehloScatterDimensionNumbersGetUpdateWindowDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloScatterDimensionNumbersGetUpdateWindowDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloScatterDimensionNumbersGetInsertedWindowDimsSize(attr) - @ccall mlir_c.stablehloScatterDimensionNumbersGetInsertedWindowDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloScatterDimensionNumbersGetInsertedWindowDimsSize(attr::MlirAttribute)::intptr_t end function stablehloScatterDimensionNumbersGetInsertedWindowDimsElem(attr, pos) - @ccall mlir_c.stablehloScatterDimensionNumbersGetInsertedWindowDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloScatterDimensionNumbersGetInsertedWindowDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloScatterDimensionNumbersGetInputBatchingDimsSize(attr) - @ccall mlir_c.stablehloScatterDimensionNumbersGetInputBatchingDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloScatterDimensionNumbersGetInputBatchingDimsSize(attr::MlirAttribute)::intptr_t end function stablehloScatterDimensionNumbersGetInputBatchingDimsElem(attr, pos) - @ccall mlir_c.stablehloScatterDimensionNumbersGetInputBatchingDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloScatterDimensionNumbersGetInputBatchingDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsSize(attr) - @ccall mlir_c.stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsSize(attr::MlirAttribute)::intptr_t end function stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsElem(attr, pos) - @ccall mlir_c.stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloScatterDimensionNumbersGetScatterIndicesBatchingDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsSize(attr) - @ccall mlir_c.stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsSize(attr::MlirAttribute)::intptr_t end function stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsElem(attr, pos) - @ccall mlir_c.stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloScatterDimensionNumbersGetScatteredDimsToOperandDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloDimensionNumbersGetIndexVectorDim(attr) @ccall mlir_c.stablehloDimensionNumbersGetIndexVectorDim(attr::MlirAttribute)::Int64 end -function stablehloGatherDimensionNumbersGet( - ctx, - nOffsetDims, - offsetDims, - nCollapsedSliceDims, - collapsedSliceDims, - nOperandBatchingDims, - operandBatchingDims, - nStartIndicesBatchingDims, - startIndicesBatchingDims, - nStartIndexMap, - startIndexMap, - indexVectorDim, -) - @ccall mlir_c.stablehloGatherDimensionNumbersGet( - ctx::MlirContext, - nOffsetDims::intptr_t, - offsetDims::Ptr{Int64}, - nCollapsedSliceDims::intptr_t, - collapsedSliceDims::Ptr{Int64}, - nOperandBatchingDims::intptr_t, - operandBatchingDims::Ptr{Int64}, - nStartIndicesBatchingDims::intptr_t, - startIndicesBatchingDims::Ptr{Int64}, - nStartIndexMap::intptr_t, - startIndexMap::Ptr{Int64}, - indexVectorDim::Int64, - )::MlirAttribute +function stablehloGatherDimensionNumbersGet(ctx, nOffsetDims, offsetDims, nCollapsedSliceDims, collapsedSliceDims, nOperandBatchingDims, operandBatchingDims, nStartIndicesBatchingDims, startIndicesBatchingDims, nStartIndexMap, startIndexMap, indexVectorDim) + @ccall mlir_c.stablehloGatherDimensionNumbersGet(ctx::MlirContext, nOffsetDims::intptr_t, offsetDims::Ptr{Int64}, nCollapsedSliceDims::intptr_t, collapsedSliceDims::Ptr{Int64}, nOperandBatchingDims::intptr_t, operandBatchingDims::Ptr{Int64}, nStartIndicesBatchingDims::intptr_t, startIndicesBatchingDims::Ptr{Int64}, nStartIndexMap::intptr_t, startIndexMap::Ptr{Int64}, indexVectorDim::Int64)::MlirAttribute end function stablehloAttributeIsAGatherDimensionNumbers(attr) @@ -10214,91 +8978,51 @@ function stablehloAttributeIsAGatherDimensionNumbers(attr) end function stablehloGatherDimensionNumbersGetOffsetDimsSize(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetOffsetDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloGatherDimensionNumbersGetOffsetDimsSize(attr::MlirAttribute)::intptr_t end function stablehloGatherDimensionNumbersGetOffsetDimsElem(attr, pos) - @ccall mlir_c.stablehloGatherDimensionNumbersGetOffsetDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloGatherDimensionNumbersGetOffsetDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloGatherDimensionNumbersGetCollapsedSliceDimsSize(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetCollapsedSliceDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloGatherDimensionNumbersGetCollapsedSliceDimsSize(attr::MlirAttribute)::intptr_t end function stablehloGatherDimensionNumbersGetCollapsedSliceDimsElem(attr, pos) - @ccall mlir_c.stablehloGatherDimensionNumbersGetCollapsedSliceDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloGatherDimensionNumbersGetCollapsedSliceDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloGatherDimensionNumbersGetOperandBatchingDimsSize(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetOperandBatchingDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloGatherDimensionNumbersGetOperandBatchingDimsSize(attr::MlirAttribute)::intptr_t end function stablehloGatherDimensionNumbersGetOperandBatchingDimsElem(attr, pos) - @ccall mlir_c.stablehloGatherDimensionNumbersGetOperandBatchingDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloGatherDimensionNumbersGetOperandBatchingDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsSize(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsSize(attr::MlirAttribute)::intptr_t end function stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsElem(attr, pos) - @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndicesBatchingDimsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloGatherDimensionNumbersGetStartIndexMapSize(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndexMapSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndexMapSize(attr::MlirAttribute)::intptr_t end function stablehloGatherDimensionNumbersGetStartIndexMapElem(attr, pos) - @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndexMapElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloGatherDimensionNumbersGetStartIndexMapElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloGatherDimensionNumbersGetIndexVectorDim(attr) - @ccall mlir_c.stablehloGatherDimensionNumbersGetIndexVectorDim( - attr::MlirAttribute - )::Int64 -end - -function stablehloDotAlgorithmGet( - ctx, - lhsPrecisionType, - rhsPrecisionType, - accumulationType, - lhsComponentCount, - rhsComponentCount, - numPrimitiveOperations, - allowImpreciseAccumulation, -) - @ccall mlir_c.stablehloDotAlgorithmGet( - ctx::MlirContext, - lhsPrecisionType::MlirType, - rhsPrecisionType::MlirType, - accumulationType::MlirType, - lhsComponentCount::Int64, - rhsComponentCount::Int64, - numPrimitiveOperations::Int64, - allowImpreciseAccumulation::Bool, - )::MlirAttribute + @ccall mlir_c.stablehloGatherDimensionNumbersGetIndexVectorDim(attr::MlirAttribute)::Int64 +end + +function stablehloDotAlgorithmGet(ctx, lhsPrecisionType, rhsPrecisionType, accumulationType, lhsComponentCount, rhsComponentCount, numPrimitiveOperations, allowImpreciseAccumulation) + @ccall mlir_c.stablehloDotAlgorithmGet(ctx::MlirContext, lhsPrecisionType::MlirType, rhsPrecisionType::MlirType, accumulationType::MlirType, lhsComponentCount::Int64, rhsComponentCount::Int64, numPrimitiveOperations::Int64, allowImpreciseAccumulation::Bool)::MlirAttribute end function stablehloAttributeIsADotAlgorithm(attr) @@ -10330,33 +9054,11 @@ function stablehloDotAlgorithmGetNumPrimitiveOperations(attr) end function stablehloDotAlgorithmGetAllowImpreciseAccumulation(attr) - @ccall mlir_c.stablehloDotAlgorithmGetAllowImpreciseAccumulation( - attr::MlirAttribute - )::Bool -end - -function stablehloDotDimensionNumbersGet( - ctx, - nLhsBatchingDimensions, - lhsBatchingDimensions, - nRhsBatchingDimensions, - rhsBatchingDimensions, - nLhsContractingDimensions, - lhsContractingDimensions, - nRhsContractingDimensions, - rhsContractingDimensions, -) - @ccall mlir_c.stablehloDotDimensionNumbersGet( - ctx::MlirContext, - nLhsBatchingDimensions::intptr_t, - lhsBatchingDimensions::Ptr{Int64}, - nRhsBatchingDimensions::intptr_t, - rhsBatchingDimensions::Ptr{Int64}, - nLhsContractingDimensions::intptr_t, - lhsContractingDimensions::Ptr{Int64}, - nRhsContractingDimensions::intptr_t, - rhsContractingDimensions::Ptr{Int64}, - )::MlirAttribute + @ccall mlir_c.stablehloDotAlgorithmGetAllowImpreciseAccumulation(attr::MlirAttribute)::Bool +end + +function stablehloDotDimensionNumbersGet(ctx, nLhsBatchingDimensions, lhsBatchingDimensions, nRhsBatchingDimensions, rhsBatchingDimensions, nLhsContractingDimensions, lhsContractingDimensions, nRhsContractingDimensions, rhsContractingDimensions) + @ccall mlir_c.stablehloDotDimensionNumbersGet(ctx::MlirContext, nLhsBatchingDimensions::intptr_t, lhsBatchingDimensions::Ptr{Int64}, nRhsBatchingDimensions::intptr_t, rhsBatchingDimensions::Ptr{Int64}, nLhsContractingDimensions::intptr_t, lhsContractingDimensions::Ptr{Int64}, nRhsContractingDimensions::intptr_t, rhsContractingDimensions::Ptr{Int64})::MlirAttribute end function stablehloAttributeIsADotDimensionNumbers(attr) @@ -10364,83 +9066,39 @@ function stablehloAttributeIsADotDimensionNumbers(attr) end function stablehloDotDimensionNumbersGetLhsBatchingDimensionsSize(attr) - @ccall mlir_c.stablehloDotDimensionNumbersGetLhsBatchingDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloDotDimensionNumbersGetLhsBatchingDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloDotDimensionNumbersGetLhsBatchingDimensionsElem(attr, pos) - @ccall mlir_c.stablehloDotDimensionNumbersGetLhsBatchingDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloDotDimensionNumbersGetLhsBatchingDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloDotDimensionNumbersGetRhsBatchingDimensionsSize(attr) - @ccall mlir_c.stablehloDotDimensionNumbersGetRhsBatchingDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloDotDimensionNumbersGetRhsBatchingDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloDotDimensionNumbersGetRhsBatchingDimensionsElem(attr, pos) - @ccall mlir_c.stablehloDotDimensionNumbersGetRhsBatchingDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloDotDimensionNumbersGetRhsBatchingDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloDotDimensionNumbersGetLhsContractingDimensionsSize(attr) - @ccall mlir_c.stablehloDotDimensionNumbersGetLhsContractingDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloDotDimensionNumbersGetLhsContractingDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloDotDimensionNumbersGetLhsContractingDimensionsElem(attr, pos) - @ccall mlir_c.stablehloDotDimensionNumbersGetLhsContractingDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloDotDimensionNumbersGetLhsContractingDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloDotDimensionNumbersGetRhsContractingDimensionsSize(attr) - @ccall mlir_c.stablehloDotDimensionNumbersGetRhsContractingDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloDotDimensionNumbersGetRhsContractingDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloDotDimensionNumbersGetRhsContractingDimensionsElem(attr, pos) - @ccall mlir_c.stablehloDotDimensionNumbersGetRhsContractingDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 -end - -function stablehloConvDimensionNumbersGet( - ctx, - inputBatchDimension, - inputFeatureDimension, - nInputSpatialDimensions, - inputSpatialDimensions, - kernelInputFeatureDimension, - kernelOutputFeatureDimension, - nKernelSpatialDimensions, - kernelSpatialDimensions, - outputBatchDimension, - outputFeatureDimension, - nOutputSpatialDimensions, - outputSpatialDimensions, -) - @ccall mlir_c.stablehloConvDimensionNumbersGet( - ctx::MlirContext, - inputBatchDimension::Int64, - inputFeatureDimension::Int64, - nInputSpatialDimensions::intptr_t, - inputSpatialDimensions::Ptr{Int64}, - kernelInputFeatureDimension::Int64, - kernelOutputFeatureDimension::Int64, - nKernelSpatialDimensions::intptr_t, - kernelSpatialDimensions::Ptr{Int64}, - outputBatchDimension::Int64, - outputFeatureDimension::Int64, - nOutputSpatialDimensions::intptr_t, - outputSpatialDimensions::Ptr{Int64}, - )::MlirAttribute + @ccall mlir_c.stablehloDotDimensionNumbersGetRhsContractingDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 +end + +function stablehloConvDimensionNumbersGet(ctx, inputBatchDimension, inputFeatureDimension, nInputSpatialDimensions, inputSpatialDimensions, kernelInputFeatureDimension, kernelOutputFeatureDimension, nKernelSpatialDimensions, kernelSpatialDimensions, outputBatchDimension, outputFeatureDimension, nOutputSpatialDimensions, outputSpatialDimensions) + @ccall mlir_c.stablehloConvDimensionNumbersGet(ctx::MlirContext, inputBatchDimension::Int64, inputFeatureDimension::Int64, nInputSpatialDimensions::intptr_t, inputSpatialDimensions::Ptr{Int64}, kernelInputFeatureDimension::Int64, kernelOutputFeatureDimension::Int64, nKernelSpatialDimensions::intptr_t, kernelSpatialDimensions::Ptr{Int64}, outputBatchDimension::Int64, outputFeatureDimension::Int64, nOutputSpatialDimensions::intptr_t, outputSpatialDimensions::Ptr{Int64})::MlirAttribute end function stablehloAttributeIsAConvDimensionNumbers(attr) @@ -10448,93 +9106,55 @@ function stablehloAttributeIsAConvDimensionNumbers(attr) end function stablehloConvDimensionNumbersGetInputBatchDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetInputBatchDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetInputBatchDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetInputFeatureDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetInputFeatureDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetInputFeatureDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetInputSpatialDimensionsSize(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetInputSpatialDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloConvDimensionNumbersGetInputSpatialDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloConvDimensionNumbersGetInputSpatialDimensionsElem(attr, pos) - @ccall mlir_c.stablehloConvDimensionNumbersGetInputSpatialDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetInputSpatialDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloConvDimensionNumbersGetKernelInputFeatureDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetKernelInputFeatureDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetKernelInputFeatureDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetKernelOutputFeatureDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetKernelOutputFeatureDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetKernelOutputFeatureDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetKernelSpatialDimensionsSize(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetKernelSpatialDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloConvDimensionNumbersGetKernelSpatialDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloConvDimensionNumbersGetKernelSpatialDimensionsElem(attr, pos) - @ccall mlir_c.stablehloConvDimensionNumbersGetKernelSpatialDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetKernelSpatialDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloConvDimensionNumbersGetOutputBatchDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetOutputBatchDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetOutputBatchDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetOutputFeatureDimension(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetOutputFeatureDimension( - attr::MlirAttribute - )::Int64 + @ccall mlir_c.stablehloConvDimensionNumbersGetOutputFeatureDimension(attr::MlirAttribute)::Int64 end function stablehloConvDimensionNumbersGetOutputSpatialDimensionsSize(attr) - @ccall mlir_c.stablehloConvDimensionNumbersGetOutputSpatialDimensionsSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloConvDimensionNumbersGetOutputSpatialDimensionsSize(attr::MlirAttribute)::intptr_t end function stablehloConvDimensionNumbersGetOutputSpatialDimensionsElem(attr, pos) - @ccall mlir_c.stablehloConvDimensionNumbersGetOutputSpatialDimensionsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 -end - -function stablehloOutputOperandAliasGet( - ctx, - nOutputTupleIndices, - outputTupleIndices, - operandIndex, - nOperandTupleIndices, - operandTupleIndices, -) - @ccall mlir_c.stablehloOutputOperandAliasGet( - ctx::MlirContext, - nOutputTupleIndices::intptr_t, - outputTupleIndices::Ptr{Int64}, - operandIndex::Int64, - nOperandTupleIndices::intptr_t, - operandTupleIndices::Ptr{Int64}, - )::MlirAttribute + @ccall mlir_c.stablehloConvDimensionNumbersGetOutputSpatialDimensionsElem(attr::MlirAttribute, pos::intptr_t)::Int64 +end + +function stablehloOutputOperandAliasGet(ctx, nOutputTupleIndices, outputTupleIndices, operandIndex, nOperandTupleIndices, operandTupleIndices) + @ccall mlir_c.stablehloOutputOperandAliasGet(ctx::MlirContext, nOutputTupleIndices::intptr_t, outputTupleIndices::Ptr{Int64}, operandIndex::Int64, nOperandTupleIndices::intptr_t, operandTupleIndices::Ptr{Int64})::MlirAttribute end function stablehloAttributeIsAOutputOperandAlias(attr) @@ -10542,15 +9162,11 @@ function stablehloAttributeIsAOutputOperandAlias(attr) end function stablehloOutputOperandAliasGetOutputTupleIndicesSize(attr) - @ccall mlir_c.stablehloOutputOperandAliasGetOutputTupleIndicesSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloOutputOperandAliasGetOutputTupleIndicesSize(attr::MlirAttribute)::intptr_t end function stablehloOutputOperandAliasGetOutputTupleIndicesElem(attr, pos) - @ccall mlir_c.stablehloOutputOperandAliasGetOutputTupleIndicesElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloOutputOperandAliasGetOutputTupleIndicesElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloOutputOperandAliasGetOperandIndex(attr) @@ -10558,21 +9174,15 @@ function stablehloOutputOperandAliasGetOperandIndex(attr) end function stablehloOutputOperandAliasGetOperandTupleIndicesSize(attr) - @ccall mlir_c.stablehloOutputOperandAliasGetOperandTupleIndicesSize( - attr::MlirAttribute - )::intptr_t + @ccall mlir_c.stablehloOutputOperandAliasGetOperandTupleIndicesSize(attr::MlirAttribute)::intptr_t end function stablehloOutputOperandAliasGetOperandTupleIndicesElem(attr, pos) - @ccall mlir_c.stablehloOutputOperandAliasGetOperandTupleIndicesElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloOutputOperandAliasGetOperandTupleIndicesElem(attr::MlirAttribute, pos::intptr_t)::Int64 end function stablehloComparisonDirectionAttrGet(ctx, value) - @ccall mlir_c.stablehloComparisonDirectionAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloComparisonDirectionAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsAComparisonDirectionAttr(attr) @@ -10580,15 +9190,11 @@ function stablehloAttributeIsAComparisonDirectionAttr(attr) end function stablehloComparisonDirectionAttrGetValue(attr) - @ccall mlir_c.stablehloComparisonDirectionAttrGetValue( - attr::MlirAttribute - )::MlirStringRef + @ccall mlir_c.stablehloComparisonDirectionAttrGetValue(attr::MlirAttribute)::MlirStringRef end function stablehloComparisonTypeAttrGet(ctx, value) - @ccall mlir_c.stablehloComparisonTypeAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloComparisonTypeAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsAComparisonTypeAttr(attr) @@ -10600,9 +9206,7 @@ function stablehloComparisonTypeAttrGetValue(attr) end function stablehloPrecisionAttrGet(ctx, value) - @ccall mlir_c.stablehloPrecisionAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloPrecisionAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsAPrecisionAttr(attr) @@ -10614,9 +9218,7 @@ function stablehloPrecisionAttrGetValue(attr) end function stablehloFftTypeAttrGet(ctx, value) - @ccall mlir_c.stablehloFftTypeAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloFftTypeAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsAFftTypeAttr(attr) @@ -10628,9 +9230,7 @@ function stablehloFftTypeAttrGetValue(attr) end function stablehloTransposeAttrGet(ctx, value) - @ccall mlir_c.stablehloTransposeAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloTransposeAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsATransposeAttr(attr) @@ -10642,9 +9242,7 @@ function stablehloTransposeAttrGetValue(attr) end function stablehloRngDistributionAttrGet(ctx, value) - @ccall mlir_c.stablehloRngDistributionAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloRngDistributionAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsARngDistributionAttr(attr) @@ -10656,9 +9254,7 @@ function stablehloRngDistributionAttrGetValue(attr) end function stablehloRngAlgorithmAttrGet(ctx, value) - @ccall mlir_c.stablehloRngAlgorithmAttrGet( - ctx::MlirContext, value::MlirStringRef - )::MlirAttribute + @ccall mlir_c.stablehloRngAlgorithmAttrGet(ctx::MlirContext, value::MlirStringRef)::MlirAttribute end function stablehloAttributeIsARngAlgorithmAttr(attr) @@ -10670,9 +9266,7 @@ function stablehloRngAlgorithmAttrGetValue(attr) end function stablehloChannelHandleGet(ctx, handle, type) - @ccall mlir_c.stablehloChannelHandleGet( - ctx::MlirContext, handle::Int64, type::Int64 - )::MlirAttribute + @ccall mlir_c.stablehloChannelHandleGet(ctx::MlirContext, handle::Int64, type::Int64)::MlirAttribute end function stablehloAttributeIsChannelHandle(attr) @@ -10688,9 +9282,7 @@ function stablehloChannelHandleGetType(attr) end function stablehloTypeExtensionsGet(ctx, nBounds, bounds) - @ccall mlir_c.stablehloTypeExtensionsGet( - ctx::MlirContext, nBounds::intptr_t, bounds::Ptr{Int64} - )::MlirAttribute + @ccall mlir_c.stablehloTypeExtensionsGet(ctx::MlirContext, nBounds::intptr_t, bounds::Ptr{Int64})::MlirAttribute end function stablehloAttributeIsTypeExtensions(attr) @@ -10702,9 +9294,8 @@ function stablehloTypeExtensionsGetBoundsSize(attr) end function stablehloTypeExtensionsGetBoundsElem(attr, pos) - @ccall mlir_c.stablehloTypeExtensionsGetBoundsElem( - attr::MlirAttribute, pos::intptr_t - )::Int64 + @ccall mlir_c.stablehloTypeExtensionsGetBoundsElem(attr::MlirAttribute, pos::intptr_t)::Int64 end const MLIR_CAPI_DWARF_ADDRESS_SPACE_NULL = -1 + diff --git a/src/utils.jl b/src/utils.jl index ebc937cac..d1130ed90 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -95,6 +95,13 @@ function should_rewrite_ft(@nospecialize(ft)) return false end if ft <: Core.Function + if hasfield(typeof(ft), :name) && hasfield(typeof(ft.name), :name) && isdefined(ft.name, :name) + namestr = String(ft.name.name) + if startswith(namestr, "##(overlay (. Reactant (inert REACTANT_METHOD_TABLE)") + return false + end + end + # We need this for closures to work if hasfield(typeof(ft), :name) && hasfield(typeof(ft.name), :module) mod = ft.name.module diff --git a/test/integration/cuda.jl b/test/integration/cuda.jl index 47bb8c23a..2573c8997 100644 --- a/test/integration/cuda.jl +++ b/test/integration/cuda.jl @@ -2,6 +2,7 @@ using Reactant using Test using CUDA +@static if false function square_kernel!(x, y) i = threadIdx().x x[i] *= y[i] @@ -27,3 +28,54 @@ end @code_hlo optimize = :before_kernel square!(A, B) end end + +end + +function sin_kernel!(x, y) + i = threadIdx().x + x[i] *= sin(y[i]) + return nothing +end + +# basic squaring on GPU +function sin!(x, y) + @cuda blocks = 1 threads = length(x) sin_kernel!(x, y) + return nothing +end + +@testset "Sin Kernel" begin + oA = collect(1:1:64) + A = Reactant.to_rarray(oA) + B = Reactant.to_rarray(100 .* oA) + if CUDA.functional() + @jit sin!(A, B) + @test all(Array(A) .≈ oA .* sin.(oA .* 100)) + @test all(Array(B) .≈ (oA .* 100)) + else + @code_hlo optimize = :before_kernel sin!(A, B) + end +end + +function smul_kernel!(x, y) + i = threadIdx().x + x[i] *= y + return nothing +end + +# basic squaring on GPU +function smul!(x) + @cuda blocks = 1 threads = length(x) smul_kernel!(x, 3) + @cuda blocks = 1 threads = length(x) smul_kernel!(x, 5) + return nothing +end + +@testset "Constant Op Kernel" begin + oA = collect(1:1:64) + A = Reactant.to_rarray(oA) + if CUDA.functional() + @jit smul!(A, B) + @test all(Array(A) .≈ oA .* 15) + else + @code_hlo optimize = :before_kernel smul!(A) + end +end