Skip to content

Commit d605698

Browse files
committed
Preserve source array when resizing.
1 parent 13e7f0f commit d605698

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/array.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,7 @@ function Base.resize!(A::CuVector{T}, n::Integer) where T
841841
ptr = convert(CuPtr{T}, mem)
842842
m = min(length(A), n)
843843
if m > 0
844-
synchronize(A)
845-
unsafe_copyto!(ptr, pointer(A), m)
844+
GC.@preserve A unsafe_copyto!(ptr, pointer(A), m)
846845
end
847846
DataRef(pool_free, mem)
848847
end

0 commit comments

Comments
 (0)