-
Notifications
You must be signed in to change notification settings - Fork 510
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
Implementing a parallel version of array::from_fn() #1222
Comments
Could you expand a bit on the use case you have for this? Arrays are usually relatively small so that parallelism wont help if the elements are cheap to compute. If the elements are indeed expensive to compute, I suspect the overhead of collecting a |
Currently, I'm using a large 2 dimensional array as the main storage for my application. And, I frequently need to recompute the entire array. So I think it would be good to have a "nicer" way of doing this instead of collecting into a vec. (Especially when they're nested) |
For 2d arrays, you will probably fare better with a serialized inner loop, unless the work is very imbalanced so you benefit from work-stealing. So you would be collecting Another way to do it on the stack is to start with a |
An initial implementation could probably be built with |
I would like to know if a parallel implementation of array::from_fn() could be added to rayon. If not, are there any ways to use it in a parallel manner with some lower level functions?
The text was updated successfully, but these errors were encountered: