diff --git a/src/host/broadcast.jl b/src/host/broadcast.jl index eaa50bb51..b02d2a33c 100644 --- a/src/host/broadcast.jl +++ b/src/host/broadcast.jl @@ -103,7 +103,7 @@ function Base.map(f, xs::AnyGPUArray...) return map!(f, dest, xs...) end -function Base.map!(f, dest::AnyGPUArray, xs::AnyGPUArray...) +function Base.map!(f, dest::AnyGPUArray, xs::AbstractArray...) # custom broadcast, ignoring the container size mismatches # (avoids the reshape + view that our mapreduce impl has to do) indices = LinearIndices.((dest, xs...)) diff --git a/test/testsuite/broadcasting.jl b/test/testsuite/broadcasting.jl index 81b028f32..e305202f1 100644 --- a/test/testsuite/broadcasting.jl +++ b/test/testsuite/broadcasting.jl @@ -143,6 +143,9 @@ function broadcasting(AT, eltypes) @test compare(AT, rand(ET, 2,2), rand(ET, 2)) do x,y map!(+, x, y) end + @test compare(AT, rand(ET, 2), 1:2) do x, y + map!(+, x, y) + end end @testset "map $ET" begin