Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to upstream changes to return_types #312

Merged
merged 3 commits into from
Mar 16, 2022
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 src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ end

if isdefined(Base.Experimental, Symbol("@overlay"))
using Core.Compiler: OverlayMethodTable
if VERSION >= v"1.9.0-DEV.120"
if v"1.8-beta2" <= VERSION < v"1.9-" || VERSION >= v"1.9.0-DEV.120"
Core.Compiler.method_table(interp::GPUInterpreter) =
OverlayMethodTable(interp.world, interp.method_table)
else
Expand Down
7 changes: 6 additions & 1 deletion src/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ function check_method(@nospecialize(job::CompilerJob))
cache = ci_cache(job)
mt = method_table(job)
interp = GPUInterpreter(cache, mt, job.source.world)
rt = Base.return_types(job.source.f, job.source.tt, interp)[1]
@static if v"1.8-beta2" <= VERSION < v"1.9-" || VERSION ≥ v"1.9.0-DEV.190"
# https://github.com/JuliaLang/julia/pull/44515
rt = Base.return_types(job.source.f, job.source.tt; interp)[1]
else
rt = Base.return_types(job.source.f, job.source.tt, interp)[1]
end
if rt != Nothing
throw(KernelError(job, "kernel returns a value of type `$rt`",
"""Make sure your kernel function ends in `return`, `return nothing` or `nothing`.
Expand Down
2 changes: 1 addition & 1 deletion test/native.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ end

# Test ABI removal
ir = sprint(io->native_code_llvm(io, call_real, Tuple{ComplexF64}))
if VERSION < v"1.8-"
if VERSION < v"1.8-" || v"1.8-beta2" <= VERSION < v"1.9-" || VERSION ≥ v"1.9.0-DEV.190"
@test !occursin("alloca", ir)
else
@test_broken !occursin("alloca", ir)
Expand Down