Skip to content

Commit

Permalink
Try using unified memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Dec 11, 2024
1 parent c23e09f commit 150af15
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,8 @@ end

@testset "counter overflow" begin
rng = CUDA.RNG()
# 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
# we may not be able to allocate over 4GB on the GPU, so use unified memory
c = CuArray{Float16, 5, CUDA.UnifiedMemory}(undef, 64, 32, 512, 32, 64)
rand!(rng, c)
randn!(rng, c)
end

0 comments on commit 150af15

Please sign in to comment.