Skip to content

Commit

Permalink
Try diferent name for gpu exception (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Aug 22, 2024
1 parent 8bf8b48 commit 71ae713
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6079,10 +6079,12 @@ function GPUCompiler.codegen(output::Symbol, job::CompilerJob{<:EnzymeTarget};

# annotate
annotate!(mod, mode)
if haskey(functions(mod), "gpu_report_exception")
exc = functions(mod)["gpu_report_exception"]
if !isempty(blocks(exc))
linkage!(exc, LLVM.API.LLVMExternalLinkage)
for name in ("gpu_report_exception", "report_exception")
if haskey(functions(mod), name)
exc = functions(mod)[name]
if !isempty(blocks(exc))
linkage!(exc, LLVM.API.LLVMExternalLinkage)
end
end
end

Expand All @@ -6097,10 +6099,12 @@ function GPUCompiler.codegen(output::Symbol, job::CompilerJob{<:EnzymeTarget};
GPUCompiler.optimize_module!(parent_job, mod)
end

if haskey(functions(mod), "gpu_report_exception")
exc = functions(mod)["gpu_report_exception"]
if !isempty(blocks(exc))
linkage!(exc, LLVM.API.LLVMInternalLinkage)
for name in ("gpu_report_exception", "report_exception")
if haskey(functions(mod), name)
exc = functions(mod)[name]
if !isempty(blocks(exc))
linkage!(exc, LLVM.API.LLVMInternalLinkage)
end
end
end

Expand Down

0 comments on commit 71ae713

Please sign in to comment.