Skip to content

Commit 2b22e89

Browse files
committed
Preserve source array when calling memset.
1 parent 159345f commit 2b22e89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ function Base.fill!(A::DenseCuArray{T}, x) where T <: MemsetCompatTypes
780780
U = memsettype(T)
781781
y = reinterpret(U, convert(T, x))
782782
context!(context(A)) do
783-
memset(convert(CuPtr{U}, pointer(A)), y, length(A))
783+
GC.@preserve A memset(convert(CuPtr{U}, pointer(A)), y, length(A))
784784
end
785785
A
786786
end

0 commit comments

Comments
 (0)