JuliaGPU / JuliaGPU/KernelAbstractions.jl
Allow `return` or `return nothing` in kernels
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 523
- Forks
- 88
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 25
Description
I use JuliaFormatter to format my source code. This adds explicit return statements. This leads to
ERROR: LoadError: Return statement not permitted in a kernel function sum2_kernel!
even if the return statement is just return nothing.
At the same time, ending a kernel with an expression (which is equivalent to a return statement) is allowed.
Could this check be changed to allow only empty return or return nothing statements?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the kernel-function validation that emits “Return statement not permitted in a kernel function” and compare it with the handling of an ending expression. Confirm the desired behavior for empty return and return nothing, then add coverage showing both forms are accepted while other return statements remain rejected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100