Skip to main content

parallel_prefix_scan

Function parallel_prefix_scan 

Source
pub fn parallel_prefix_scan(data: &[f64], n_chunks: usize) -> Vec<f64>
Expand description

Parallel-style prefix sum using a two-pass approach.

Phase 1: Compute local prefix sums for each chunk in parallel. Phase 2: Adjust each chunk by the cumulative sum of previous chunks.

In practice both phases run sequentially here (correctness reference).