It seems that it is not supported to pass a specified rng as argument to rand in CUDA.jl.
The codes below raise an error:
using CUDA
rng = CUDA.RNG(42)
a = CUDA.rand(rng, 1)
ERROR: MethodError: no method matching rand(::CUDA.RNG, ::Int64)
You may have intended to import Base.rand
The function `rand` exists, but no method is defined for this combination of argument types.
Closest candidates are:
rand(::Integer, ::Integer...)
@ CUDA E:\Softwares\Julia\.julia\packages\CUDA\x8d2s\src\random.jl:340
rand(::Union{Type{Float32}, Type{Float64}, Type{UInt32}}, ::Integer, Integer...)
@ CUDA E:\Softwares\Julia\.julia\packages\CUDA\x8d2s\src\random.jl:306
rand(::Type, ::Integer, Integer...)
@ CUDA E:\Softwares\Julia\.julia\packages\CUDA\x8d2s\src\random.jl:330