| Home | Libraries | People | FAQ | More

## 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)