|
template<typename InputIterator , typename OutputIterator , typename UnaryFunction > |
void | bolt::cl::transform (::bolt::cl::control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction op, const std::string &user_code="") |
| This version of transform applies a unary operation on input sequences and stores the result in the corresponding position in an output sequence.The input and output sequences can coincide, resulting in an in-place transformation.
|
|
template<typename InputIterator , typename OutputIterator , typename UnaryFunction > |
void | bolt::cl::transform (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction op, const std::string &user_code="") |
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryFunction > |
void | bolt::cl::transform (bolt::cl::control &ctl, InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryFunction op, const std::string &user_code="") |
| This version of transform applies a binary function to each pair of elements from two input sequences and stores the result in the corresponding position in an output sequence. The input and output sequences can coincide, resulting in an in-place transformation.
|
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryFunction > |
void | bolt::cl::transform (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryFunction op, const std::string &user_code="") |
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename BinaryFunction >
void bolt::cl::transform |
( |
bolt::cl::control & |
ctl, |
|
|
InputIterator1 |
first1, |
|
|
InputIterator1 |
last1, |
|
|
InputIterator2 |
first2, |
|
|
OutputIterator |
result, |
|
|
BinaryFunction |
op, |
|
|
const std::string & |
user_code = "" |
|
) |
| |
This version of transform
applies a binary function to each pair of elements from two input sequences and stores the result in the corresponding position in an output sequence. The input and output sequences can coincide, resulting in an in-place transformation.
- Parameters
-
ctl | Optional Control structure to control command-queue, debug, tuning, etc.See bolt::cl::control. |
first1 | The beginning of the first input sequence. |
last1 | The end of the first input sequence. |
first2 | The beginning of the second input sequence. |
result | The beginning of the output sequence. |
op | The tranformation operation. |
user_code | Optional OpenCL™ code to be passed to the OpenCL compiler. The cl_code is inserted first in the generated code, before the cl_code trait. |
- Returns
- The end of the output sequence.
- Template Parameters
-
InputIterator1 | is a model of InputIterator and InputIterator1's value_type is convertible to BinaryFunction's first_argument_type . |
InputIterator2 | is a model of InputIterator and InputIterator2's value_type is convertible to BinaryFunction's second_argument_type . |
OutputIterator | is a model of OutputIterator |
BinaryFunction | is a model of BinaryFunction and BinaryFunction's result_type is convertible to OutputIterator's value_type . |
The following code snippet demonstrates how to use transform
.
int input1[6] = {-5, 0, 2, 3, 2, 4};
int input2[6] = { 3, 6, -2, 1, 2, 3};
int output[6];
bolt::cl::plus<int> op;
- See Also
- http://www.sgi.com/tech/stl/transform.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