镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Discussion options

You must be logged in to vote

Zip is for iteration and parallel iteration, and it allows creating arrays.

Maybe you could use Zip and .par_map_collect() to create the array.
It will only make sense if the element creating computation is heavy enough. Otherwise it will just be overhead and no gain from using rayon.

Zip needs some input to map, you can use indices or a no-allocation array for that?

Zip::from(ndarray::indices((1, 3, size.width as usize, size.height as usize)))
.par_map_collect(|(i, j, k)| ...)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bluss
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nilgoyette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants