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

fix ambiguity for Random.seed!(rng, nothing) #717

Merged
merged 1 commit into from May 12, 2020

Conversation

marius311
Copy link
Contributor

@marius311 marius311 commented May 11, 2020

Prior to this PR we had that:

julia> Random.seed!(Random.default_rng(), nothing)
MersenneTwister(...)

julia> Random.seed!(CuArrays.CURAND.generator(), nothing)
ERROR: MethodError: seed!(::CuArrays.CURAND.RNG, ::Nothing) is ambiguous. Candidates:
  seed!(rng::CuArrays.CURAND.RNG, seed) in CuArrays.CURAND at /home/marius/.julia/packages/CuArrays/l0gXB/src/rand/random.jl:44
  seed!(rng::AbstractRNG, ::Nothing) in Random at /home/marius/src/julia-1.4/usr/share/julia/stdlib/v1.4/Random/src/Random.jl:426

Now the second one works as expected.

I wasn't sure what to make of the calls to Random.seed! outside of a @test but I put the extra one with them, let me know if that's ok.

@maleadt
Copy link
Member

maleadt commented May 12, 2020

Thanks! I guess this would also need to be added to the GPUArrays RNG, for completeness?
bors try

bors bot added a commit that referenced this pull request May 12, 2020
@bors
Copy link
Contributor

bors bot commented May 12, 2020

try

Build failed:

@maleadt maleadt added the bugfix label May 12, 2020
@maleadt maleadt merged commit e39a017 into JuliaGPU:master May 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants