MCPcopy Create free account
hub / github.com/boostorg/compute / count

Function count

include/boost/compute/algorithm/count.hpp:28–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26/// \see count_if()
27template<class InputIterator, class T>
28inline size_t count(InputIterator first,
29 InputIterator last,
30 const T &value,
31 command_queue &queue = system::default_queue())
32{
33 typedef typename std::iterator_traits<InputIterator>::value_type value_type;
34
35 using ::boost::compute::_1;
36 using ::boost::compute::lambda::all;
37
38 if(vector_size<value_type>::value == 1){
39 return ::boost::compute::count_if(first,
40 last,
41 _1 == value,
42 queue);
43 }
44 else {
45 return ::boost::compute::count_if(first,
46 last,
47 all(_1 == value),
48 queue);
49 }
50}
51
52} // end compute namespace
53} // end boost namespace

Callers 7

BOOST_AUTO_TEST_CASEFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
countMethod · 0.85
countMethod · 0.85
transform_if_implFunction · 0.85

Calls 1

count_ifFunction · 0.85

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68