JuliaGPU / JuliaGPU/KernelAbstractions.jl

Function calls in kernels not called

Open
#263 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
523
Forks
88
Avg merge
1d 11h
Merged PRs (30d)
25

Description

```julia
using KernelAbstractions

@kernel function kernel(v)
I = @index(Global, Linear)
@show I # loops over 1:10

end

function inlined_function(v, I)
@show I
end

@kernel function nested_kernel(v)
I = @index(Global, Linear)
@show I # I only loop over 1:1

inlined_function(v, I)
end

v = ones(10)
wait(kernel(CPU())(v, ndrange = 10))
wait(nested_kernel(CPU())(v, ndrange = 10))
```
Edit: Updated with working code.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the Julia reproducer from the issue with KernelAbstractions and compare the output from kernel and nested_kernel. Trace how the nested kernel function call is handled, and consider the issue resolved when the function executes for each of the 10 indices rather than only once.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.