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

Offsetting kernel indices #3068

Closed
glwagner opened this issue Apr 18, 2023 · 0 comments · Fixed by #3125
Closed

Offsetting kernel indices #3068

glwagner opened this issue Apr 18, 2023 · 0 comments · Fixed by #3125
Assignees
Labels
abstractions 🎨 Whatever that means

Comments

@glwagner
Copy link
Member

glwagner commented Apr 18, 2023

Increasingly we have the need to offset kernel indices; ie to perform computations over "windows" for incomplete Field indices:

@kernel function _compute!(data, operand, index_ranges)
i, j, k = @index(Global, NTuple)
i′ = offset_compute_index(index_ranges[1], i)
j′ = offset_compute_index(index_ranges[2], j)
k′ = offset_compute_index(index_ranges[3], k)
@inbounds data[i′, j′, k′] = operand[i′, j′, k′]
end

or for @simone-silvestri's work to overlap communication and computation, eg #3067.

Possibly, such a feature can be supported by KernelAbstractions eg JuliaGPU/KernelAbstractions.jl#384 which would simplify our code a lot (since we won't have to pass the offsets into the kernel explicitly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment