boost::compute::inclusive_scan
// In header: <boost/compute/algorithm/inclusive_scan.hpp> template<typename InputIterator, typename OutputIterator> OutputIterator inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, command_queue & queue = system::default_queue());
Performs an inclusive scan of the elements in the range [first, last) and stores the results in the range beginning at result.
Each element in the output is assigned to the sum of the current value in the input with the sum of every previous value in the input.
// setup input int data[] = { 1, 2, 3, 4 }; boost::compute::vector<int> input(data, data + 4, queue); // setup output boost::compute::vector<int> output(4, context); // scan values boost::compute::inclusive_scan( input.begin(), input.end(), output.begin(), queue ); // output = [ 1, 3, 6, 10 ]
See Also:
exclusive_scan()
Parameters: |
|
||||||||
Returns: |
|