Bolt
1.1
C++ template library with support for OpenCL
|
Functions | |
template<typename InputIterator , typename EqualityComparable > | |
bolt::amp::iterator_traits < InputIterator > ::difference_type | bolt::amp::count (control &ctl, InputIterator first, InputIterator last, const EqualityComparable &value) |
count counts the number of elements in the specified range which compare equal to the specified value . | |
template<typename InputIterator , typename EqualityComparable > | |
bolt::amp::iterator_traits < InputIterator > ::difference_type | bolt::amp::count (InputIterator first, InputIterator last, const EqualityComparable &value) |
template<typename InputIterator , typename Predicate > | |
bolt::amp::iterator_traits < InputIterator > ::difference_type | bolt::amp::count_if (control &ctl, InputIterator first, InputIterator last, Predicate predicate=bolt::amp::detail::CountIfEqual< int >()) |
count_if counts the number of elements in the specified range for which the specified predicate is true . | |
template<typename InputIterator , typename Predicate > | |
bolt::amp::iterator_traits < InputIterator > ::difference_type | bolt::amp::count_if (InputIterator first, InputIterator last, Predicate predicate) |
bolt::amp::iterator_traits<InputIterator>::difference_type bolt::amp::count | ( | control & | ctl, |
InputIterator | first, | ||
InputIterator | last, | ||
const EqualityComparable & | value | ||
) |
count
counts the number of elements in the specified range which compare equal to the specified value
.
ctl | Optional Control structure to control accelerator,debug, tuning. See bolt::amp::control. |
first | Beginning of the source copy sequence. |
last | End of the source copy sequence. |
value | Equality Comparable value. |
value
.InputIterator | is a model of InputIterator |
Example:
bolt::amp::iterator_traits< InputIterator >::difference_type bolt::amp::count_if | ( | control & | ctl, |
InputIterator | first, | ||
InputIterator | last, | ||
Predicate | predicate = bolt::amp::detail::CountIfEqual< int >() |
||
) |
count_if
counts the number of elements in the specified range for which the specified predicate
is true
.
ctl | Optional Control structure to control accelerator,debug, tuning. See bolt::amp::control. |
first | The first position in the sequence to be counted. |
last | The last position in the sequence to be counted. |
predicate | The count is incremented for each element which returns true when passed to the predicate function. |
predicate
is true.InputIterator | is a model of InputIterator |
OutputIterator | is a model of OutputIterator |
This example returns the number of elements in the range 1-60.
Example to show how to use UDD type for count.