Skip to content

Parallel prefix sum

Category: Parallelism · Status: stub

One line: Computing every running total of a sequence in a number of rounds that grows with the logarithm of its length — a building block of many data-parallel algorithms.

Also called: prefix scan, scan.

How it connects

flowchart LR
  n_data_parallelism["Data parallelism"]
  n_parallel_prefix_sum["Parallel prefix sum"]
  n_parallel_prefix_sum -->|is a| n_data_parallelism
  classDef center stroke-width:3px
  class n_parallel_prefix_sum center
  classDef outside stroke-dasharray: 4 3
  class n_data_parallelism outside

In each language

C++ std::inclusive_scan and std::exclusive_scan (C++17) accept an execution policy
Java Arrays.parallelPrefix

Where to read more