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 authored and maleadt committed Mar 16, 2022
1 parent edef568 commit 53c6db9
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 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

0 comments on commit 53c6db9

Please sign in to comment.