-
Notifications
You must be signed in to change notification settings - Fork 25
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
Vectorized version ? #67
Comments
That's interesting idea although I don't know anything about state of SIMD in GHC. AFAIR they never landed properly but I may be mistaken. It raises two interesting problems
|
I'm not sure to understand, what do you mean? If we don't have SIMD (or another vectorization instruction set) available, I don't see how we can vectorize by hand?
In the spirit of
Yes, maybe it would make sense as you say, even without vectorization, to have an API that provides a stream of values. This was the idea I was trying to address in #66, although I made it only for Word32. |
RE SIMD support. I meant that we may just have bunch of rather low-level primitives in And about API. I'm thinking about making fork of |
Using a state vector containing the information of 4 seeds, we could provide a new API where we get 4 random numbers at a time (using SIMD instructions for example).
The state vector would have to be "interleaved" to optimize cache usage, so that when reading or writing 4 elements, we read or write contiguous memory.
(I use the number 4 but it could be a different number depending on the Variate type (to build a double we need 2 Word32), and on the vectorization primitives available.)
I'm not familiar with haskell vector primitives but looking at GHC.Exts I saw some there, so I guess it is possible to go this way... What do you think?
The text was updated successfully, but these errors were encountered: