Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

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: \Omega(n)
Space complexity on GPUs when first == result: \Omega(2n)
Space complexity on CPUs: \Omega(1)


PrevUpHomeNext