| Home | Libraries | People | FAQ | More

## Function template partial_sum

boost::compute::partial_sum

## Synopsis

    // In header: <boost/compute/algorithm/partial_sum.hpp>

    template<typename InputIterator, typename OutputIterator>
      OutputIterator
      partial_sum(InputIterator first, InputIterator last, OutputIterator result,
                  command_queue & queue = system::default_queue());

## Description

Calculates the cumulative sum of the elements in the range [`first`, `last`) and writes the resulting values to the range beginning at `result`.

Space complexity on GPUs: (n)
Space complexity on GPUs when `first` == `result:` (2n)
Space complexity on CPUs: (1)