Skip to content

Commit a2806aa

Browse files
committed
Also implement checkbounds_indices
1 parent 768dc22 commit a2806aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/DistributedArrays.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,10 @@ import Base: _chkbnds
675675
# Generic bounds checking
676676
@inline _chkbnds{T,N}(A::AbstractArray{T,N}, checked::NTuple{N,Bool}, I1::MergedIndicesOrSub, I...) = _chkbnds(A, checked, parent(parent(I1)).indices..., I...)
677677
@inline _chkbnds{T,N,M}(A::AbstractArray{T,N}, checked::NTuple{M,Bool}, I1::MergedIndicesOrSub, I...) = _chkbnds(A, checked, parent(parent(I1)).indices..., I...)
678+
import Base: checkbounds_indices
679+
@inline checkbounds_indices(::Tuple{}, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices((), (parent(parent(I[1])).indices..., tail(I)...))
680+
@inline checkbounds_indices(inds::Tuple{Any}, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices(inds, (parent(parent(I[1])).indices..., tail(I)...))
681+
@inline checkbounds_indices(inds::Tuple, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices(inds, (parent(parent(I[1])).indices..., tail(I)...))
678682

679683
# The tricky thing here is that we want to optimize the accesses into the
680684
# distributed array, but in doing so, we lose track of which indices in I we

0 commit comments

Comments
 (0)