Skip to content

Commit 8277b55

Browse files
mbaumanandreasnoack
authored andcommitted
Also implement checkbounds_indices
1 parent faae054 commit 8277b55

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
@@ -718,6 +718,10 @@ import Base: _chkbnds
718718
# Generic bounds checking
719719
@inline _chkbnds{T,N}(A::AbstractArray{T,N}, checked::NTuple{N,Bool}, I1::MergedIndicesOrSub, I...) = _chkbnds(A, checked, parent(parent(I1)).indices..., I...)
720720
@inline _chkbnds{T,N,M}(A::AbstractArray{T,N}, checked::NTuple{M,Bool}, I1::MergedIndicesOrSub, I...) = _chkbnds(A, checked, parent(parent(I1)).indices..., I...)
721+
import Base: checkbounds_indices
722+
@inline checkbounds_indices(::Tuple{}, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices((), (parent(parent(I[1])).indices..., tail(I)...))
723+
@inline checkbounds_indices(inds::Tuple{Any}, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices(inds, (parent(parent(I[1])).indices..., tail(I)...))
724+
@inline checkbounds_indices(inds::Tuple, I::Tuple{MergedIndicesOrSub,Vararg{Any}}) = checkbounds_indices(inds, (parent(parent(I[1])).indices..., tail(I)...))
721725

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

0 commit comments

Comments
 (0)