Bolt
1.3
C++ template library with support for OpenCL
|
Functions | |
template<typename InputIterator , typename Predicate > | |
bolt::cl::iterator_traits < InputIterator > ::difference_type | bolt::cl::count_if (control &ctl, InputIterator first, InputIterator last, Predicate predicate=bolt::cl::detail::CountIfEqual< int >(), const std::string &cl_code="") |
count_if counts the number of elements in the specified range for which the specified predicate is true . | |
template<typename InputIterator , typename Predicate > | |
bolt::cl::iterator_traits < InputIterator > ::difference_type | bolt::cl::count_if (InputIterator first, InputIterator last, Predicate predicate, const std::string &cl_code="") |
template<typename InputIterator , typename EqualityComparable > | |
bolt::cl::iterator_traits < InputIterator > ::difference_type | bolt::cl::count (control &ctl, InputIterator first, InputIterator last, const EqualityComparable &value, const std::string &cl_code="") |
count counts the number of elements in the specified range which compare equal to the specified value . | |
template<typename InputIterator , typename EqualityComparable > | |
bolt::cl::iterator_traits < InputIterator > ::difference_type | bolt::cl::count (InputIterator first, InputIterator last, const EqualityComparable &value, const std::string &cl_code="") |
bolt::cl::iterator_traits<InputIterator>::difference_type bolt::cl::count | ( | control & | ctl, |
InputIterator | first, | ||
InputIterator | last, | ||
const EqualityComparable & | value, | ||
const std::string & | cl_code = "" |
||
) |
count
counts the number of elements in the specified range which compare equal to the specified value
.
ctl | Optional Control structure to control command-queue, debug, tuning,etc. See bolt::cl::control |
first | Beginning of the source copy sequence. |
last | End of the source copy sequence. |
value | Equality Comparable value. |
cl_code | Optional OpenCL(TM) code to be prepended to any OpenCL kernels used by this function. |
value
.InputIterator | is a model of InputIterator |
Example:
bolt::cl::iterator_traits< InputIterator >::difference_type bolt::cl::count_if | ( | control & | ctl, |
InputIterator | first, | ||
InputIterator | last, | ||
Predicate | predicate = bolt::cl::detail::CountIfEqual< int >() , |
||
const std::string & | cl_code = "" |
||
) |
count_if
counts the number of elements in the specified range for which the specified predicate
is true
.
ctl | Optional Control structure to control command-queue, debug, tuning,etc. See bolt::cl::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. |
cl_code | Optional OpenCL(TM) code to be prepended to any OpenCL kernels used by this 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_if.