From 3f9cde3a885560d5868830058d358235b7b4b4cd Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 16 Apr 2024 16:34:43 +0200 Subject: [PATCH] Fixes. --- src/compiler/compilation.jl | 7 +++++-- test/core/execution.jl | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl index 0b731852b3..0f7d21cd03 100644 --- a/src/compiler/compilation.jl +++ b/src/compiler/compilation.jl @@ -530,20 +530,23 @@ function generate_opaque_closure(config::CompilerConfig, src::CodeInfo, mi = ccall(:jl_specializations_get_linfo, Ref{MethodInstance}, (Any, Any, Any), meth, full_sig, Core.svec()) job = CompilerJob(mi, config) # this captures the current world age + Base.@atomic meth.primary_world = job.world + Base.@atomic meth.deleted_world = typemax(UInt) # create a code instance and store it in the cache interp = GPUCompiler.get_interpreter(job) owner = Core.Compiler.cache_owner(interp) exctype = Any inferred_const = C_NULL + inferred = src const_flags = Int32(0) min_world = meth.primary_world - max_world = typemax(UInt) + max_world = meth.deleted_world ipo_effects = UInt32(0) effects = UInt32(0) analysis_results = nothing relocatability = UInt8(0) - ci = CodeInstance(mi, owner, rt, exctype, inferred_const, const_flags, + ci = CodeInstance(mi, owner, rt, exctype, inferred_const, inferred, const_flags, min_world, max_world, ipo_effects, effects, analysis_results, relocatability, src.debuginfo) Core.Compiler.setindex!(GPUCompiler.ci_cache(job), ci, mi) diff --git a/test/core/execution.jl b/test/core/execution.jl index 6326f3ff1c..6e3a132400 100644 --- a/test/core/execution.jl +++ b/test/core/execution.jl @@ -1094,7 +1094,7 @@ end ############################################################################################ -if VERSION >= v"1.10-" +if VERSION >= v"1.12-" @testset "opaque closures" begin # basic closure, constructed from IRCode @@ -1118,8 +1118,8 @@ end # basic closure, constructed from CodeInfo let - ir, rettyp = only(Base.code_typed(*, (Int, Int, Int))) - oc = CUDA.OpaqueClosure(ir) + ir, rettype = only(Base.code_typed(*, (Int, Int, Int))) + oc = CUDA.OpaqueClosure(ir; sig=Tuple{Int,Int,Int}, rettype, nargs=3) d = CuArray([1]) a = CuArray([2])