pub fn parallel_scan<T, F>(
data: &[T],
identity: T,
op: F,
mode: ScanMode,
n_threads: usize,
) -> CoreResult<Vec<T>>Expand description
Parallel prefix scan (generalised prefix sum) using Blelloch’s algorithm.
The op must be associative (but need not be commutative).
§Arguments
data– input sliceidentity– identity element forop(needed forExclusivescans)op– associative binary operatormode–ScanMode::InclusiveorScanMode::Exclusiven_threads– degree of parallelism (0 = auto)