Skip to content

Commit c0caf9a

Browse files
authored
GPU report exception: fix linkage (#1659)
1 parent 4f3365d commit c0caf9a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/compiler.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5796,13 +5796,26 @@ function GPUCompiler.codegen(output::Symbol, job::CompilerJob{<:EnzymeTarget};
57965796

57975797
# annotate
57985798
annotate!(mod, mode)
5799+
if haskey(functions(mod), "gpu_report_exception")
5800+
exc = functions(mod)["gpu_report_exception"]
5801+
if !isempty(blocks(exc))
5802+
linkage!(exc, LLVM.API.LLVMExternalLinkage)
5803+
end
5804+
end
57995805

58005806
# Run early pipeline
58015807
optimize!(mod, target_machine)
58025808

58035809
if process_module
58045810
GPUCompiler.optimize_module!(parent_job, mod)
58055811
end
5812+
5813+
if haskey(functions(mod), "gpu_report_exception")
5814+
exc = functions(mod)["gpu_report_exception"]
5815+
if !isempty(blocks(exc))
5816+
linkage!(exc, LLVM.API.LLVMInternalLinkage)
5817+
end
5818+
end
58065819

58075820
seen = TypeTreeTable()
58085821
T_jlvalue = LLVM.StructType(LLVMType[])

0 commit comments

Comments
 (0)