Skip to content

Commit

Permalink
Use host memory to prevent OOM.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Dec 10, 2024
1 parent 67bbd41 commit acc31db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ end

@testset "counter overflow" begin
rng = CUDA.RNG()
c = CUDA.zeros(Float16, (64, 32, 512, 32, 64))
rand!(rng, c)
randn!(rng, c)
# we may not be able to allocate over 4GB on the GPU, so use CPU memory
#c = CUDA.zeros(Float16, (64, 32, 512, 32, 64))
c = Array{Float16}(undef, 64, 32, 512, 32, 64)
GC.@preserve c begin
dc = unsafe_wrap(CuArray, c)
rand!(rng, dc)
randn!(rng, dc)
end
end

0 comments on commit acc31db

Please sign in to comment.