Skip to main content

parallel_sum

Function parallel_sum 

Source
pub fn parallel_sum<T>(data: &[T], identity: T) -> T
where T: Copy + Send + Sync + Add<Output = T>,
Expand description

Perform a parallel pairwise sum on a slice.

Uses rayon tree-reduce for large slices (which is inherently pairwise), and iterative pairwise summation for smaller slices.