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 @@ -62,7 +62,7 @@ CEnum = "0.5, 1"
ChainRulesCore = "1"
EnzymeCore = "0.8"
GPUArrays = "12.1"
GPUCompiler = "2.23"
GPUCompiler = "2.24"
GPUToolbox = "3.6"
KernelAbstractions = "0.10"
KernelInterface = "0.4"
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,11 @@ function hipcompile(@nospecialize(job::CompilerJob))
# check the arguments before GPUCompiler infers the kernel (slow with unconverted ones)
job.config.validate && GPUCompiler.check_invocation(job)

# the IR in `meta` is ours: inspect it in here, and dispose of it so that it does not leak
obj, entry, late_hostcalls, extinit_globals, relocations, exception_sites = JuliaContext() do ctx
image, meta = GPUCompiler.compile(:obj, job)
@dispose ir=meta.ir begin
# the IR is freed when the block returns, and may belong to another LLVM library than
# Julia's (with GPUCompiler's llvmgpu toolchain), so inspect it only in here
obj, entry, late_hostcalls, extinit_globals, relocations, exception_sites =
GPUCompiler.compile(:obj, job) do image, meta
ir = meta.ir
# Filter out extinit global from `relocations` that :patch strategy emits.
relocated = Set(rec.name for rec in meta.relocations.records)
extinit = [gv.name for gv in ir.globals
Expand All @@ -445,7 +446,6 @@ function hipcompile(@nospecialize(job::CompilerJob))
image, meta.entry.name, find_global_hostcalls(ir), extinit, meta.relocations,
meta.exception_sites
end
end

# Collect early-detected hostcalls written by link_libraries! on this task.
# Falls back gracefully to empty if link_libraries! was not called.
Expand Down