Skip to content

Commit 3d278b6

Browse files
Fix memory corruption in mapreduce (#2907)
1 parent bb88163 commit 3d278b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function GPUArrays.mapreducedim!(f::F, op::OP, R::AnyCuArray{T},
276276
partial_shmem = partial_reduce_shmem
277277
partial_blocks = partial_reduce_blocks*other_blocks
278278

279-
partial = similar(R, (size(R)..., partial_blocks))
279+
partial = similar(R, (size(R)..., partial_reduce_blocks))
280280
if init === nothing
281281
# without an explicit initializer we need to copy from the output container
282282
partial .= R

0 commit comments

Comments
 (0)