Skip to content

Commit e92d887

Browse files
authored
Restore map! behaviour (#584)
1 parent b7bc068 commit e92d887

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/host/broadcast.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function Base.map(f, xs::AnyGPUArray...)
103103
return map!(f, dest, xs...)
104104
end
105105

106-
function Base.map!(f, dest::AnyGPUArray, xs::AnyGPUArray...)
106+
function Base.map!(f, dest::AnyGPUArray, xs::AbstractArray...)
107107
# custom broadcast, ignoring the container size mismatches
108108
# (avoids the reshape + view that our mapreduce impl has to do)
109109
indices = LinearIndices.((dest, xs...))

test/testsuite/broadcasting.jl

+3
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ function broadcasting(AT, eltypes)
143143
@test compare(AT, rand(ET, 2,2), rand(ET, 2)) do x,y
144144
map!(+, x, y)
145145
end
146+
@test compare(AT, rand(ET, 2), 1:2) do x, y
147+
map!(+, x, y)
148+
end
146149
end
147150

148151
@testset "map $ET" begin

0 commit comments

Comments
 (0)