diff --git a/Project.toml b/Project.toml index 33712e2a7..2b7339697 100644 --- a/Project.toml +++ b/Project.toml @@ -53,7 +53,7 @@ AMDGPU = "2" Adapt = "0.4, 1.0, 2.0, 3.0, 4" Atomix = "1.5" EnzymeCore = "0.8.25" -GPUCompiler = "2.23" +GPUCompiler = "2.24" GPUToolbox = "3.6" KernelInterface = "0.4.7" LLVM = "10" diff --git a/src/pocl/compiler/compilation.jl b/src/pocl/compiler/compilation.jl index a2b02775c..36bab0662 100644 --- a/src/pocl/compiler/compilation.jl +++ b/src/pocl/compiler/compilation.jl @@ -293,16 +293,12 @@ const compilations = Threads.Atomic{Int}(0) function compile_to_obj(@nospecialize(job::CompilerJob)) compilations[] += 1 - return JuliaContext() do ctx - obj, meta = invoke_frozen(GPUCompiler.compile, :obj, job) - - # we own the IR: inspect it, then dispose of it - @dispose ir = meta.ir begin - entry = meta.entry.name - device_rng = haskey(meta.entry.function_attributes, "julia.opencl.rng") - (; obj, entry, device_rng, meta.exception_sites) - end - end + # (runs in the context of the IR, which GPUCompiler frees afterwards) + inspect(obj, meta) = (; + obj, entry = meta.entry.name, meta.exception_sites, + device_rng = haskey(meta.entry.function_attributes, "julia.opencl.rng"), + ) + return invoke_frozen(GPUCompiler.compile, inspect, :obj, job) end # link the SPIR-V bytes into a session-local `cl.Kernel` on the active context.