Skip to content

Add additional inbounds propagation annotations. #548

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

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jul 5, 2024

I guess my mental model was wrong; I thought we only needed @propagate_inbounds on the in-between layers, but apparently we also need it on

function vectorized_getindex!(dest::AbstractGPUArray, src::AbstractArray, Is...)
any(isempty, Is) && return dest # indexing with empty array
idims = map(length, Is)
# NOTE: we are pretty liberal here supporting non-GPU indices...
Is = map(adapt(ToGPU(dest)), Is)
@boundscheck checkbounds(src, Is...)
gpu_call(getindex_kernel, dest, src, idims, Is...)
return dest
end

Note that the function below was missing the annotation too, as an in-between layer.

Fixes #542

@maleadt maleadt merged commit cb7d20f into master Jul 5, 2024
13 of 14 checks passed
@maleadt maleadt deleted the tb/propagate_inbounds branch July 5, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vectorized getindex ignores @inbounds
1 participant