diff --git a/Project.toml b/Project.toml index ea9dcc65..f609e60b 100644 --- a/Project.toml +++ b/Project.toml @@ -34,7 +34,7 @@ SPIRVIntrinsics = {path = "lib/intrinsics"} [compat] Adapt = "4" GPUArrays = "12.1" -GPUCompiler = "2.23.2" +GPUCompiler = "2.24" GPUToolbox = "3.6" KernelAbstractions = "0.10" KernelInterface = "0.4" diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl index 8b208ad3..8f5f50aa 100644 --- a/src/compiler/compilation.jl +++ b/src/compiler/compilation.jl @@ -247,15 +247,11 @@ const compilations = Threads.Atomic{Int}(0) function compile_to_obj(@nospecialize(job::CompilerJob)) Threads.atomic_add!(compilations, 1) - JuliaContext() do ctx - obj, meta = 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 + # the IR is only valid within the block: return plain data + GPUCompiler.compile(:obj, job) do obj, meta + entry = meta.entry.name + device_rng = haskey(meta.entry.function_attributes, "julia.opencl.rng") + (; obj, entry, device_rng, meta.exception_sites) end end