Bolt  1.3
C++ template library with support for OpenCL
Functions

Functions

template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::inclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.
 
template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename BinaryFunction >
OutputIterator bolt::cl::inclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op, const std::string &user_code="")
 inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.
 
template<typename InputIterator , typename OutputIterator , typename BinaryFunction >
OutputIterator bolt::cl::inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator bolt::cl::exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, T init, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator bolt::cl::exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryFunction >
OutputIterator bolt::cl::exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op, const std::string &user_code="")
 exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.
 
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryFunction >
OutputIterator bolt::cl::exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op, const std::string &user_code="")
 

Detailed Description

Function Documentation

template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::exclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
const std::string &  user_code = "" 
)

exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.

Parameters
ctlA Optional Bolt control object, to describe the environment under which the function runs.
firstThe first iterator in the input range to be scanned.
lastThe last iterator in the input range to be scanned.
resultThe first iterator in the output range.
user_codeA client-specified string that is appended to the generated OpenCL kernel.
Template Parameters
InputIteratorAn iterator signifying the range is used as input.
OutputIteratorAn iterator signifying the range is used as output.
Returns
An iterator pointing at the end of the result range.
#include "bolt/cl/scan.h"
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// Calculate the exclusive scan of an input range, modifying the values in-place.
// a => {0, 1, 3, 6, 10, 15, 21, 28, 36, 45}
See Also
http://www.sgi.com/tech/stl/partial_sum.html
template<typename InputIterator , typename OutputIterator , typename T >
OutputIterator bolt::cl::exclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
init,
const std::string &  user_code = "" 
)

exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.

Parameters
ctlA Optional Bolt control object, to describe the environment under which the function runs.
firstThe first iterator in the input range to be scanned.
lastThe last iterator in the input range to be scanned.
resultThe first iterator in the output range.
initThe value used to initialize the output scan sequence.
user_codeA client-specified string that is appended to the generated OpenCL kernel.
Template Parameters
InputIteratorimplements an input iterator.
OutputIteratorimplements an output iterator.
Tis convertible to std::iterator_traits< OutputIterator >::value_type.
Returns
An iterator pointing at the end of the result range.
#include "bolt/cl/scan.h"
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int init = 0;
// Calculate the exclusive scan of an input range, modifying the values in-place.
bolt::cl::exclusive_scan( a, a+10, a, init );
// a => {0, 1, 3, 6, 10, 15, 21, 28, 36, 45}
See Also
http://www.sgi.com/tech/stl/partial_sum.html
template<typename InputIterator , typename OutputIterator , typename T , typename BinaryFunction >
OutputIterator bolt::cl::exclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
init,
BinaryFunction  binary_op,
const std::string &  user_code = "" 
)

exclusive_scan calculates a running sum over a range of values, exclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. exclusive_scan requires associativity of the binary operation to parallelize it.

Parameters
ctlA Optional Bolt control object, to describe the environment under which the function runs.
firstThe first iterator in the input range to be scanned.
lastThe last iterator in the input range to be scanned.
resultThe first iterator in the output range.
initThe value used to initialize the output scan sequence.
binary_opA functor object specifying the operation between two elements in the input range.
user_codeA client-specified string that is appended to the generated OpenCL kernel.
Template Parameters
InputIteratorAn iterator signifying the range is used as input.
OutputIteratorAn iterator signifying the range is used as output.
Tis convertible to std::iterator_traits< OutputIterator >::value_type.
BinaryFunctionimplements a binary function; its result should be {{** Is ? **}}convertible to std::iterator_traits< OutputIterator >::value_type.
Returns
An iterator pointing at the end of the result range.
#include "bolt/cl/scan.h"
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// Calculate the exclusive scan of an input range, modifying the values in-place
bolt::cl::exclusive_scan( a, a+10, a, 0, bolt::cl::plus< int >( ) );
// a => {0, 1, 3, 6, 10, 15, 21, 28, 36, 45}
See Also
http://www.sgi.com/tech/stl/partial_sum.html
template<typename InputIterator , typename OutputIterator >
OutputIterator bolt::cl::inclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
const std::string &  user_code = "" 
)

inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.

Parameters
ctlA Optional Bolt control object, to describe the environment under which the function runs.
firstThe first iterator in the input range to be scanned.
lastThe last iterator in the input range to be scanned.
resultThe first iterator in the output range.
user_codeA client-specified string that is appended to the generated OpenCL kernel.
Template Parameters
InputIteratorAn iterator signifying the range is used as input.
OutputIteratorAn iterator signifying the range is used as output.
Returns
Iterator at the end of result sequence.

Example

#include "bolt/cl/scan.h"
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// Calculate the inclusive scan of an input range, modifying the values in-place.
// a => {1, 3, 6, 10, 15, 21, 28, 36, 45, 55}
See Also
http://www.sgi.com/tech/stl/partial_sum.html
template<typename InputIterator , typename OutputIterator , typename BinaryFunction >
OutputIterator bolt::cl::inclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
BinaryFunction  binary_op,
const std::string &  user_code = "" 
)

inclusive_scan calculates a running sum over a range of values, inclusive of the current value. The result value at iterator position i is the running sum of all values less than i in the input range. inclusive_scan requires associativity of the binary operation to parallelize the prefix sum.

Parameters
ctlA Optional Bolt control object, to describe the environment under which the function runs.
firstThe first iterator in the input range to be scanned.
lastThe last iterator in the input range to be scanned.
resultThe first iterator in the output range.
binary_opA functor object specifying the operation between two elements in the input range.
user_codeA client-specified string that is appended to the generated OpenCL kernel.
Template Parameters
InputIteratorAn iterator signifying the range is used as input.
OutputIteratorAn iterator signifying the range is used as output.
Returns
Iterator at the end of result sequence.

Example

#include "bolt/cl/scan.h"
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
// Calculate the inclusive scan of an input range, modifying the values in-place.
// a => {1, 3, 6, 10, 15, 21, 28, 36, 45, 55}
See Also
http://www.sgi.com/tech/stl/partial_sum.html