@@ -363,8 +363,7 @@ _localindex(i::AbstractUnitRange, offset) = (first(i)-offset):(last(i)-offset)
363363Equivalent to `Array(view(A, I...))` but optimised for the case that the data is local.
364364Can return a view into `localpart(A)`
365365"""
366- function makelocal (A:: DArray{<:Any, <:Any, AT} , I:: Vararg{Any, N} ) where {N, AT}
367- Base. @_inline_meta
366+ @inline function makelocal (A:: DArray{<:Any, <:Any, AT} , I:: Vararg{Any, N} ) where {N, AT}
368367 J = map (i-> Base. unalias (A, i), to_indices (A, I))
369368 J = map (j-> isa (j, Base. Slice) ? j. indices : j, J)
370369 @boundscheck checkbounds (A, J... )
@@ -597,12 +596,7 @@ function Base.copyto!(a::Array, s::SubDArray)
597596 return a
598597end
599598
600- if VERSION < v " 1.2"
601- # This is an internal API that has changed
602- reindex (A, I, J) = Base. reindex (A, I, J)
603- else
604- reindex (A, I, J) = Base. reindex (I, J)
605- end
599+ reindex (A, I, J) = Base. reindex (I, J)
606600
607601function DArray (SD:: SubArray{T,N} ) where {T,N}
608602 D = SD. parent
@@ -661,9 +655,7 @@ function Base.getindex(d::DArray, i::Int...)
661655end
662656
663657Base. getindex (d:: DArray ) = d[1 ]
664- if VERSION > v " 1.1-"
665658Base. getindex (d:: SubDArray , I:: Int... ) = invoke (getindex, Tuple{SubArray{<: Any ,N},Vararg{Int,N}} where N, d, I... )
666- end
667659Base. getindex (d:: SubOrDArray , I:: Union{Int,UnitRange{Int},Colon,Vector{Int},StepRange{Int,Int}} ...) = view (d, I... )
668660
669661function Base. isassigned (D:: DArray , i:: Integer... )
@@ -793,13 +785,12 @@ Base.@propagate_inbounds Base.getindex(M::MergedIndices{J,N}, I::Vararg{Int, N})
793785const ReshapedMergedIndices{T,N,M<: MergedIndices } = Base. ReshapedArray{T,N,M}
794786const SubMergedIndices{T,N,M<: Union{MergedIndices, ReshapedMergedIndices} } = SubArray{T,N,M}
795787const MergedIndicesOrSub = Union{MergedIndices, ReshapedMergedIndices, SubMergedIndices}
796- import Base: checkbounds_indices
797- @inline checkbounds_indices (:: Type{Bool} , inds:: Tuple{} , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
798- checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
799- @inline checkbounds_indices (:: Type{Bool} , inds:: Tuple{Any} , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
800- checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
801- @inline checkbounds_indices (:: Type{Bool} , inds:: Tuple , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
802- checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
788+ @inline Base. checkbounds_indices (:: Type{Bool} , inds:: Tuple{} , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
789+ Base. checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
790+ @inline Base. checkbounds_indices (:: Type{Bool} , inds:: Tuple{Any} , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
791+ Base. checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
792+ @inline Base. checkbounds_indices (:: Type{Bool} , inds:: Tuple , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
793+ Base. checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
803794
804795# The tricky thing here is that we want to optimize the accesses into the
805796# distributed array, but in doing so, we lose track of which indices in I we
@@ -851,8 +842,6 @@ function Base.fill!(A::DArray, x)
851842 return A
852843end
853844
854- using Random
855-
856845function Random. rand! (A:: DArray , :: Type{T} ) where T
857846 asyncmap (procs (A)) do p
858847 remotecall_wait ((A, T)-> rand! (localpart (A), T), p, A, T)
0 commit comments