Skip to content

Commit c23e09f

Browse files
committed
Use host memory to prevent OOM.
1 parent 0bbeb97 commit c23e09f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/base/random.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ end
200200

201201
@testset "counter overflow" begin
202202
rng = CUDA.RNG()
203-
c = CUDA.zeros(Float16, (64, 32, 512, 32, 64))
204-
rand!(rng, c)
205-
randn!(rng, c)
203+
# we may not be able to allocate over 4GB on the GPU, so use CPU memory
204+
#c = CUDA.zeros(Float16, (64, 32, 512, 32, 64))
205+
c = Array{Float16}(undef, 64, 32, 512, 32, 64)
206+
GC.@preserve c begin
207+
dc = unsafe_wrap(CuArray, c)
208+
rand!(rng, dc)
209+
randn!(rng, dc)
210+
end
206211
end

0 commit comments

Comments
 (0)