Bolt  1.3
C++ template library with support for OpenCL
Functions
CL-Transformed Prefix Sums

Functions

template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::cl::transform_inclusive_scan (bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op, const std::string &user_code="")
 transform_inclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the inclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::cl::transform_inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op, const std::string &user_code="")
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::cl::transform_exclusive_scan (bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op, const std::string &user_code="")
 transform_exclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the exclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::cl::transform_exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op, const std::string &user_code="")
 

Detailed Description

Function Documentation

template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::cl::transform_exclusive_scan ( bolt::cl::control ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
UnaryFunction  unary_op,
init,
BinaryFunction  binary_op,
const std::string &  user_code = "" 
)

transform_exclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the exclusive scan defined by a binary operator.

Parameters
ctlOptional control structure to control command-queue, debug, tuning, etc. See bolt::cl::control.
firstThe first element of the input sequence.
lastThe last element of the input sequence.
resultThe first element of the output sequence.
unary_opUnary operator for transformation.
initThe value used to initialize the output scan sequence.
binary_opBinary operator for scanning transformed elements.
user_codeA user-specified string that is prepended to the generated OpenCL kernel.
Template Parameters
InputIteratoris a model of Input Iterator.
OutputIteratoris a model of Output Iterator.
UnaryFunctionis a model of Unary Function which takes as input InputIterator's value_type and whose return type is convertible to BinaryFunction's input types.
Tis convertible to OutputIterator's value_type.
BinaryFunctionis a model of Binary Function which takes as input two values convertible from UnaryFunction's return type and whose return type is convertible to OutputIterator's value_type.
Returns
result+(last-first).
...
bolt::cl::square<int> sqInt;
bolt::cl::plus<int> plInt;
...
int a[10] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
bolt::cl::transform_exclusive_scan( ctrl, a, a+10, a, sqInt, 0, plInt );
// a => { 0, 1, 5, 14, 30, 55, 91, 140, 204, 285}
See Also
transform
exclusive_scan
http://www.sgi.com/tech/stl/transform.html
http://www.sgi.com/tech/stl/partial_sum.html
http://www.sgi.com/tech/stl/InputIterator.html
http://www.sgi.com/tech/stl/OutputIterator.html
http://www.sgi.com/tech/stl/UnaryFunction.html
http://www.sgi.com/tech/stl/BinaryFunction.html
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::cl::transform_inclusive_scan ( bolt::cl::control ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
UnaryFunction  unary_op,
BinaryFunction  binary_op,
const std::string &  user_code = "" 
)

transform_inclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the inclusive scan defined by a binary operator.

Parameters
ctlOptional control structure to control command-queue, debug, tuning, etc. See bolt::cl::control.
firstThe first element of the input sequence.
lastThe last element of the input sequence.
resultThe first element of the output sequence.
unary_opUnary operator for transformation.
binary_opBinary operator for scanning transformed elements.
user_codeA user-specified string that is prepended to the generated OpenCL kernel.
Template Parameters
InputIteratoris a model of Input Iterator.
OutputIteratoris a model of Output Iterator.
UnaryFunctionis a model of Unary Function which takes as input InputIterator's value_type and whose return type is convertible to BinaryFunction's input types.
BinaryFunctionis a model of Binary Function which takes as input two values convertible from UnaryFunction's return type and whose return type is convertible to OutputIterator's value_type.
Returns
result+(last-first).
...
bolt::cl::square<int> sqInt;
bolt::cl::plus<int> plInt;
...
int a[10] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
bolt::cl::transform_inclusive_scan( ctrl, a, a+10, a, sqInt, plInt );
// a => {1, 5, 14, 30, 55, 91, 140, 204, 285, 385}
See Also
transform
inclusive_scan
http://www.sgi.com/tech/stl/transform.html
http://www.sgi.com/tech/stl/partial_sum.html
http://www.sgi.com/tech/stl/InputIterator.html
http://www.sgi.com/tech/stl/OutputIterator.html
http://www.sgi.com/tech/stl/UnaryFunction.html
http://www.sgi.com/tech/stl/BinaryFunction.html