|
| template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > |
| void | bolt::cl::gather (::bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result, const std::string &user_code="") |
| | This version of gather copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ].
|
| |
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > |
| void | bolt::cl::gather (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result, const std::string &user_code="") |
| |
| template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator > |
| void | bolt::cl::gather_if (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result, const std::string &user_code="") |
| | This version of gather_if copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather_if copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if stencil[ i - map_first ] is true.
|
| |
|
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator > |
| void | bolt::cl::gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result, const std::string &user_code="") |
| |
| template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate > |
| void | bolt::cl::gather_if (bolt::cl::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred, const std::string &user_code="") |
| | This version of gather_if copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather_if copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if pred (stencil[ i - map_first ]) is true.
|
| |
|
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate > |
| void | bolt::cl::gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred, const std::string &user_code="") |
| |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
| void bolt::cl::gather |
( |
::bolt::cl::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
input_first, |
|
|
OutputIterator |
result, |
|
|
const std::string & |
user_code = "" |
|
) |
| |
This version of gather copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ].
gather APIs copy elements from a source array to a destination range (conditionally) according to a specified map. For common code between the host and device, one can take a look at the ClCode and TypeName implementations. See Bolt Tools for Split-Source for a detailed description.
- Parameters
-
| ctl | Optional Control structure to control command-queue, debug, tuning, etc.See bolt::cl::control. |
| map_first | The beginning of map sequence. |
| map_last | The end of map sequence. |
| input | The beginning of the source sequence. |
| result | The beginning of the output sequence. |
| 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. |
- Template Parameters
-
| InputIterator1 | is a model of InputIterator |
| InputIterator2 | is a model of InputIterator |
| OutputIterator | is a model of OutputIterator |
The following code snippet demonstrates how to use gather
int map[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
int input[10] = {0, 11, 22, 33, 44, 55, 66, 77, 88, 99};
int output[10];
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator >
| void bolt::cl::gather_if |
( |
bolt::cl::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
stencil, |
|
|
InputIterator3 |
input_first, |
|
|
OutputIterator |
result, |
|
|
const std::string & |
user_code = "" |
|
) |
| |
This version of gather_if copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather_if copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if stencil[ i - map_first ] is true.
- Parameters
-
| ctl | Optional Control structure to control command-queue, debug, tuning, etc.See bolt::cl::control. |
| map_first | The beginning of map sequence. |
| map_last | The end of map sequence. |
| stencil | The beginning of the stencil sequence. |
| input | The beginning of the source sequence. |
| result | The beginning of the output sequence. |
| 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. |
- Template Parameters
-
| InputIterator1 | is a model of InputIterator |
| InputIterator2 | is a model of InputIterator |
| InputIterator3 | is a model of InputIterator |
| OutputIterator | is a model of OutputIterator |
The following code snippet demonstrates how to use gather_if
int map[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
int input[10] = {0, 11, 22, 33, 44, 55, 66, 77, 88, 99};
int stencil[10] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1};
int output[10];
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate >
| void bolt::cl::gather_if |
( |
bolt::cl::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
stencil, |
|
|
InputIterator3 |
input, |
|
|
OutputIterator |
result, |
|
|
Predicate |
pred, |
|
|
const std::string & |
user_code = "" |
|
) |
| |
This version of gather_if copies elements from a source array to a destination range according to a specified map. For each i in InputIterator1 in the range [map_first, map_last), gather_if copies the corresponding input_first[ map [ i ] ] to result[ i - map_first ] if pred (stencil[ i - map_first ]) is true.
- Parameters
-
| ctl | Optional Control structure to control command-queue, debug, tuning, etc.See bolt::cl::control. |
| map_first | The beginning of map sequence. |
| map_last | The end of map sequence. |
| stencil | The beginning of the stencil sequence. |
| input | The beginning of the source sequence. |
| result | The beginning of the output sequence. |
| pred | A predicate for stencil. |
| 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. |
- Template Parameters
-
| InputIterator1 | is a model of InputIterator |
| InputIterator2 | is a model of InputIterator |
| InputIterator3 | is a model of InputIterator |
| OutputIterator | is a model of OutputIterator |
| Predicate | is a model of Predicate |
The following code snippet demonstrates how to use gather_if
struct greater_pred{
bool operator () (int x)
{
return ( (x > 5)?1:0 );
}
};
);
...
int map[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
int input[10] = {0, 11, 22, 33, 44, 55, 66, 77, 88, 99};
int stencil[10] = {2, 3, 1, 4, 5, 10, 6, 8, 7, 9};
int output[10];
greater_pred is_gt_5;