KernelAbstractions.jl
KernelAbstractions.jl copied to clipboard
Offsetting kernel indices
It'd be extremely useful to have a feature for offsetting the kernel index, either at launch time or setup time.
Not sure what the best design or interface would be. @simone-silvestri and I discussed possibly embellishing StaticSize:
https://github.com/JuliaGPU/KernelAbstractions.jl/blob/4128c3db26f4b9fef59d9589655ea96c35ea2db1/src/nditeration.jl#L14-L17
Our work exclusively uses statically sized kernels so I think we'd prefer a way to specify the offsets statically; eg the size and offset are simultaneously determined.
But another possibility would be to accept offsets as a kwarg similar to how ndrange is accepted for DynamicSize?
I talked with Simone and I think expressing this as an Index projection similar to LinearIndicies and CartesianIndices is the right direction.
In WaterLily we could also benefit from this as we are currently passing index offsets manually too.