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

RFC: Rename CuArrays.CURAND.curand -> CuArrays.CURAND.rand #310

Closed
mohamed82008 opened this issue Mar 29, 2019 · 2 comments
Closed

RFC: Rename CuArrays.CURAND.curand -> CuArrays.CURAND.rand #310

mohamed82008 opened this issue Mar 29, 2019 · 2 comments

Comments

@mohamed82008
Copy link
Contributor

Following up on a discussion on Slack, I suggest that CuArrays should have its own rand function different from Base.rand. To avoid namespace confusion though, CuArrays.rand should not be exported. A PR is somewhat straight-forward, but I am opening an issue first to get some opinions.

@maleadt
Copy link
Member

maleadt commented Mar 29, 2019

@MikeInnes @vchuravy @kshyatt @andreasnoack

I was initially opposed, thinking it could be confusing and we should export curand instead, but that's pretty similar to CuArrays.rand. Besides, we've been doing this anyway for eg. CUDAnative.sin.

Note that in the long term we should be moving towards CuArray{T}(rand, dims), but that would need some design consideration and isn't as straightforward (eg. how to implement rand(1:2, 3)).

@MikeInnes
Copy link
Collaborator

CuArrays.rand seems fine to me. CuArray{T}(rand, ...) seems kind of backwards to me but I guess it's not that inconsistent with undef; though it seems stranger for things like fill. rand(CuArray, ...) is another option that has some precedent with similar.

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

No branches or pull requests

3 participants