Skip to content

Commit

Permalink
adapt to upstream changes to Base.return_types
Browse files Browse the repository at this point in the history
Especially this commits adds the update corresponding to 
<JuliaLang/julia#44515>.
  • Loading branch information
aviatesk committed Mar 16, 2022
1 parent 893a662 commit 0b307a4
Showing 1 changed file with 6 additions and 1 deletion.
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 VERSION v"1.8-beta2"
# 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

0 comments on commit 0b307a4

Please sign in to comment.