Skip to content

Commit 0e11ec8

Browse files
committed
Fix map kernel.
1 parent b569102 commit 0e11ec8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/host/broadcast.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ function Base.map!(f, dest::AnyGPUArray, xs::AbstractArray...)
116116
bc = Broadcast.preprocess(dest, bc)
117117
end
118118

119-
# grid-stride kernel
120119
@kernel function map_kernel(dest, bc)
121-
j = @index(Global, Linear)
122-
@inbounds dest[j] = bc[j]
120+
i = @index(Global, Linear)
121+
I = CartesianIndices(axes(bc))[i]
122+
@inbounds dest[i] = bc[I]
123123
end
124124

125125
kernel = map_kernel(get_backend(dest))

0 commit comments

Comments
 (0)