Skip to content

Commit eeaff67

Browse files
committed
Implement the general case for map_localparts over DArray
Also implements operations between Array and DArray in terms of the efficent map_localparts implementation.
1 parent 23c329e commit eeaff67

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mapreduce.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,17 @@ for f in (:+, :-, :div, :mod, :rem, :&, :|, :$)
208208
B = samedist(A, B)
209209
map_localparts($f, A, B)
210210
end
211-
($f){T}(A::DArray{T}, B::Array{T}) = ($f)(A, distribute(B, A))
212-
($f){T}(A::Array{T}, B::DArray{T}) = ($f)(distribute(A, B), B)
211+
($f){T}(A::DArray{T}, B::Array{T}) = map_localparts($f, A, B)
212+
($f){T}(A::Array{T}, B::DArray{T}) = map_localparts($f, A, B)
213213
end
214214
end
215215
for f in (:.+, :.-, :.*, :./, :.%, :.<<, :.>>)
216216
@eval begin
217217
function ($f){T}(A::DArray{T}, B::DArray{T})
218218
map_localparts($f, A, B)
219219
end
220-
($f){T}(A::DArray{T}, B::Array{T}) = ($f)(A, distribute(B, A))
221-
($f){T}(A::Array{T}, B::DArray{T}) = ($f)(distribute(A, B), B)
220+
($f){T}(A::DArray{T}, B::Array{T}) = map_localparts($f, A, B)
221+
($f){T}(A::Array{T}, B::DArray{T}) = map_localparts($f, A, B)
222222
end
223223
end
224224

0 commit comments

Comments
 (0)