Skip to content

Commit d839714

Browse files
committed
dont out of bounds!
1 parent 37151dc commit d839714

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mapreduce.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ end
4848

4949
function mapreducedim_kernel(state, f, op, R::AbstractArray{T1, N}, A::AbstractArray{T, N}, slice_size, sizeA, dim) where {T1, T, N}
5050
ilin = Cuint(linear_index(state))
51+
ilin > length(R) && return
5152
accum = zero(T1)
5253
@inbounds for i = Cuint(1):slice_size
5354
idx = N == dim ? (ilin, i) : (i, ilin)

0 commit comments

Comments
 (0)