Skip to content

Commit

Permalink
Use CUDA conditionally in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuebel committed Apr 23, 2024
1 parent c080902 commit 16bcc27
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ using Test
# Setup a list of rngs to loop over
cpurng = Random.default_rng()
Random.seed!(cpurng, 42)
curng = CUDA.default_rng()
Random.seed!(curng, 42)
# replace in test files
# rngs = (cpurng,)
rngs = (cpurng, curng)
if CUDA.functional()
# Use CUDA only if available
curng = CUDA.default_rng()
Random.seed!(curng, 42)
rngs = (cpurng, curng)
else
rngs = (cpurng,)
end

CUDA.allowscalar(false)

Expand Down

0 comments on commit 16bcc27

Please sign in to comment.