Bolt
1.3
C++ template library with support for OpenCL
|
Functions | |
template<typename DerivedPolicy , typename InputIterator , typename OutputIterator , typename Predicate > | |
OutputIterator | bolt::amp::copy_if (const bolt::amp::control &ctl, InputIterator first, InputIterator last, OutputIterator result, Predicate pred) |
template<typename InputIterator , typename OutputIterator , typename Predicate > | |
OutputIterator | bolt::amp::copy_if (InputIterator first, InputIterator last, OutputIterator result, Predicate pred) |
template<typename DerivedPolicy , typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Predicate > | |
OutputIterator | bolt::amp::copy_if (const bolt::amp::control &ctl, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred) |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator , typename Predicate > | |
OutputIterator | bolt::amp::copy_if (InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred) |
OutputIterator bolt::amp::copy_if | ( | const bolt::amp::control & | ctl, |
InputIterator | first, | ||
InputIterator | last, | ||
OutputIterator | result, | ||
Predicate | pred | ||
) |
This version of copy_if
copies elements from the range [first,last)
to a range beginning at \ presult, except that any element which causes pred
to be pred
to be false
is not copied.
More precisely, for every integer n
such that 0 <= n < last-first
, copy_if
performs the assignment *result = *(first+n)
and result
is advanced one position if pred(*(first+n))
. Otherwise, no assignment occurs and result
is not advanced.
The algorithm's execution is parallelized as determined by system
.
ctl | Optional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control. |
first | The beginning of the sequence from which to copy. |
last | The end of the sequence from which to copy. |
result | The beginning of the sequence into which to copy. |
pred | The predicate to test on every value of the range [first, last) . |
result + n
, where n
is equal to the number of times pred
evaluated to true
in the range [first, last)
.InputIterator | is a model of Input Iterator, and InputIterator's value_type is convertible to Predicate's argument_type . |
OutputIterator | is a model of Output Iterator. |
Predicate | is a model of Predicate. |
[first, last)
and [result, result + (last - first))
shall not overlap.The following code snippet demonstrates how to use copy_if
to perform stream compaction
remove_copy_if
OutputIterator bolt::amp::copy_if | ( | const bolt::amp::control & | ctl, |
InputIterator1 | first, | ||
InputIterator1 | last, | ||
InputIterator2 | stencil, | ||
OutputIterator | result, | ||
Predicate | pred | ||
) |
This version of copy_if
copies elements from the range [first,last)
to a range beginning at result
, except that any element whose corresponding stencil element causes pred
to be false
is not copied.
More precisely, for every integer n
such that 0 <= n < last-first
, copy_if
performs the assignment *result = *(first+n)
and result
is advanced one position if pred(*(stencil+n))
. Otherwise, no assignment occurs and result
is not advanced.
The algorithm's execution is parallelized as determined by exec
.
ctl | Optional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control. |
first | The beginning of the sequence from which to copy. |
last | The end of the sequence from which to copy. |
stencil | The beginning of the stencil sequence. |
result | The beginning of the sequence into which to copy. |
pred | The predicate to test on every value of the range [stencil, stencil + (last-first)) . |
result + n
, where n
is equal to the number of times pred
evaluated to true
in the range [stencil, stencil + (last-first))
.DerivedPolicy | The name of the derived execution policy. |
InputIterator1 | is a model of Input Iterator. |
InputIterator2 | is a model of Input Iterator, and InputIterator2's value_type is convertible to Predicate's argument_type . |
OutputIterator | is a model of Output Iterator. |
Predicate | is a model of Predicate. |
[first, last)
and [result, result + (last - first))
shall not overlap. [stencil, stencil + (last - first))
and [result, result + (last - first))
shall not overlap.remove_copy_if