Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #717 from marius311/seedambiguity
Browse files Browse the repository at this point in the history
fix ambiguity for Random.seed!(rng, nothing)
  • Loading branch information
maleadt committed May 12, 2020
2 parents 6a5c584 + 43c1248 commit e39a017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rand/random.jl
Expand Up @@ -47,6 +47,8 @@ function Random.seed!(rng::RNG, seed=Base.rand(UInt64), offset=0)
return
end

Random.seed!(rng::RNG, ::Nothing) = Random.seed!(rng)

# convenience function that seeds both generators
function seed!(seed=Base.rand(UInt64))
Random.seed!(generator(), seed)
Expand Down
1 change: 1 addition & 0 deletions test/rand.jl
Expand Up @@ -4,6 +4,7 @@ using CuArrays.CURAND

rng = CURAND.generator()
Random.seed!(rng)
Random.seed!(rng, nothing)
Random.seed!(rng, 1)
Random.seed!(rng, 1, 0)

Expand Down

0 comments on commit e39a017

Please sign in to comment.