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

Use AbstractRNG type #1

Open
wildart opened this issue Sep 28, 2015 · 1 comment
Open

Use AbstractRNG type #1

wildart opened this issue Sep 28, 2015 · 1 comment

Comments

@wildart
Copy link

wildart commented Sep 28, 2015

Use an Base.AbstractRNG as a super type for your RNG class and implement necessary methods to work with AbstractRNG derivatives. This would provide compatibility with Julia RNG interface.

@dfdx
Copy link
Contributor

dfdx commented Sep 28, 2015

I didn't know Julia has AbstractRNG type, thanks. However, I don't think it's a good idea to bind CURAND functions to it. Here's a couple of reasons:

  • original cuRAND doesn't support most operations that AbstractRNG should support (e.g. randexp, randperm. shuffle, sprand, etc.); probably we can add them using custom kernels, but it's not trivial at all
  • most AbstractRNG-related methods operate on AbstractArray, and CudaArray doesn't implement it (for a good reason);
  • two APIs are not consistent anyway, e.g. cuRAND's randn() takes mean and stddev parameters, while Julia's doesn't; cuRAND has curand_logn and curand_poisson, Julia instead has randexp, etc.

On other hand, it's worth to make API more "similar" to that of Julia, so I'll work it out today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants