Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 6 additions & 10 deletions src/pocl/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading