Skip to content

adding attempt to force inbounds at the kernel level

Churavy, Valentin requested to merge github/fork/leios/force_inbounds into main

Created by: leios

This adds an additional flag at the @kernel level to force @inbounds across the entire kernel. It works like:

julia> @kernel inbounds=true function check_inline(a)
           a[5] = 5
       end
julia> a = [0,0];
julia> backend = get_backend(a);
julia> kernel! = check_inline(backend, 256);
julia> kernel!(a, ndrange = 10) # no error!

Note that this comes with all the caveats of using @inbounds and is certainly not good for default behaviour, but... Geez I'm tired of all the @inbounds

I'll rebase and add some tests soon if people think this could be useful.

Merge request reports

Loading