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

Support kernels returning Union{} #62

Closed
maleadt opened this issue Jan 27, 2019 · 2 comments
Closed

Support kernels returning Union{} #62

maleadt opened this issue Jan 27, 2019 · 2 comments
Labels
cuda kernels Stuff about writing CUDA kernels. enhancement New feature or request

Comments

@maleadt
Copy link
Member

maleadt commented Jan 27, 2019

Now that we support some exceptions, we should treat these kernels as valid and just have them throw at run time. This should make it much easier to debug issues like that -- assuming we can report something useful for eg. MethodErrors.

@maleadt
Copy link
Member Author

maleadt commented Jun 7, 2019

Interesting example: method ambiguities. Result in a returned bottom, but it should be able to spot them at IR validation time.

@maleadt maleadt transferred this issue from JuliaGPU/CUDAnative.jl May 27, 2020
@maleadt maleadt added cuda kernels Stuff about writing CUDA kernels. enhancement New feature or request labels May 27, 2020
@maleadt
Copy link
Member Author

maleadt commented Apr 27, 2024

This is allowed now:

julia> @device_code_warntype @cuda (()->throw(1))()
PTX CompilerJob of MethodInstance for (::var"#11#12")() for sm_86

MethodInstance for (::var"#11#12")()
  from (::var"#11#12")() @ Main REPL[33]:1
Arguments
  #self#::Core.Const(var"#11#12"())
Body::Union{}
1 ─     Main.throw(1)
└──     Core.Const(:(return %1))


julia> ERROR: a exception was thrown during kernel execution on thread (1, 1, 1) in block (1, 1, 1).
Stacktrace not available, run Julia on debug level 2 for more details (by passing -g2 to the executable).

@maleadt maleadt closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda kernels Stuff about writing CUDA kernels. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant