Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Function template count_if

boost::compute::count_if

Synopsis

// In header: <boost/compute/algorithm/count_if.hpp>


template<typename InputIterator, typename Predicate> 
  size_t count_if(InputIterator first, InputIterator last, 
                  Predicate predicate, 
                  command_queue & queue = system::default_queue());

Description

Returns the number of elements in the range [first, last) for which predicate returns true.

Space complexity on CPUs: \Omega(1)
Space complexity on GPUs: \Omega(n)


PrevUpHomeNext