|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > |
void | bolt::amp::gather (::bolt::amp::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result) |
| 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::amp::gather (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 input_first, OutputIterator result) |
|
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator > |
void | bolt::amp::gather_if (bolt::amp::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result) |
| 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::amp::gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input_first, OutputIterator result) |
|
template<typename InputIterator1 , typename InputIterator2 , typename InputIterator3 , typename OutputIterator , typename Predicate > |
void | bolt::amp::gather_if (bolt::amp::control &ctl, InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred) |
| 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::amp::gather_if (InputIterator1 map_first, InputIterator1 map_last, InputIterator2 stencil, InputIterator3 input, OutputIterator result, Predicate pred) |
|
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator >
void bolt::amp::gather |
( |
::bolt::amp::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
input_first, |
|
|
OutputIterator |
result |
|
) |
| |
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::amp::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. |
- 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::amp::gather_if |
( |
bolt::amp::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
stencil, |
|
|
InputIterator3 |
input_first, |
|
|
OutputIterator |
result |
|
) |
| |
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::amp::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. |
- 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::amp::gather_if |
( |
bolt::amp::control & |
ctl, |
|
|
InputIterator1 |
map_first, |
|
|
InputIterator1 |
map_last, |
|
|
InputIterator2 |
stencil, |
|
|
InputIterator3 |
input, |
|
|
OutputIterator |
result, |
|
|
Predicate |
pred |
|
) |
| |
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::amp::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. |
- 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;