Skip to content

Commit

Permalink
Merge pull request #2632 from JuliaGPU/tb/fixes
Browse files Browse the repository at this point in the history
NFC fixes
  • Loading branch information
maleadt authored Jan 25, 2025
2 parents b2ee7e7 + 7db9e3c commit 34767a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ function Base.fill!(A::DenseCuArray{T}, x) where T <: MemsetCompatTypes
U = memsettype(T)
y = reinterpret(U, convert(T, x))
context!(context(A)) do
memset(convert(CuPtr{U}, pointer(A)), y, length(A))
GC.@preserve A memset(convert(CuPtr{U}, pointer(A)), y, length(A))
end
A
end
Expand Down Expand Up @@ -823,6 +823,8 @@ the first `n` elements will be retained. If `n` is larger, the new elements are
guaranteed to be initialized.
"""
function Base.resize!(A::CuVector{T}, n::Integer) where T
n == length(A) && return A

# TODO: add additional space to allow for quicker resizing
maxsize = n * sizeof(T)
bufsize = if isbitstype(T)
Expand All @@ -839,8 +841,7 @@ function Base.resize!(A::CuVector{T}, n::Integer) where T
ptr = convert(CuPtr{T}, mem)
m = min(length(A), n)
if m > 0
synchronize(A)
unsafe_copyto!(ptr, pointer(A), m)
GC.@preserve A unsafe_copyto!(ptr, pointer(A), m)
end
DataRef(pool_free, mem)
end
Expand Down
1 change: 1 addition & 0 deletions src/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ function nsight()
end



"""
start()
Expand Down

0 comments on commit 34767a3

Please sign in to comment.