Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend new RNG to Complex numbers & normal distributions #726

Closed
nickkeepfer opened this issue Feb 19, 2021 · 3 comments
Closed

Extend new RNG to Complex numbers & normal distributions #726

nickkeepfer opened this issue Feb 19, 2021 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nickkeepfer
Copy link

nickkeepfer commented Feb 19, 2021

I am trying to generate a Wiener noise on the GPU which requires a complex value noise, I also require to work in double precision. The generation of such a noise seems currently impossible without support for ComplexF64 type.

@nickkeepfer nickkeepfer added the enhancement New feature or request label Feb 19, 2021
@RobbeCeulemans
Copy link

I get the same error for type ComplexF32, so I don't think it is related to the double precision

@maleadt
Copy link
Member

maleadt commented Apr 2, 2021

This now works:

julia> CUDA.rand(ComplexF32, 1)
1-element CuArray{ComplexF32, 1}:
 0.60832024f0 + 0.34425035f0im

julia> CUDA.rand(ComplexF64, 1)
1-element CuArray{ComplexF64, 1}:
 0.6419787518680106 + 0.8088343231938792im

It only works with the old GPUArrays-based RNG, and would be good to port to the new one from #788. From a quick glance, this needs two pieces:

@maleadt maleadt changed the title CUDA.jl does not support generating normally-distributed random numbers of type Complex{Float64} Extend new RNG to Complex numbers & normal distributions Apr 2, 2021
@maleadt maleadt added the good first issue Good for newcomers label Apr 2, 2021
@maleadt
Copy link
Member

maleadt commented Nov 9, 2021

Both now work with the new RNG.

@maleadt maleadt closed this as completed Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants