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

Method count

include/boost/compute/container/dynamic_bitset.hpp:108–120  ·  view source on GitHub ↗

Returns the number of set bits (i.e. '1') in the bitset.

Source from the content-addressed store, hash-verified

106
107 /// Returns the number of set bits (i.e. '1') in the bitset.
108 size_type count(command_queue &queue) const
109 {
110 ulong_ count = 0;
111 transform_reduce(
112 m_bits.begin(),
113 m_bits.end(),
114 &count,
115 popcount<block_type>(),
116 plus<ulong_>(),
117 queue
118 );
119 return static_cast<size_type>(count);
120 }
121
122 /// Resizes the bitset to contain \p num_bits. If the new size is greater
123 /// than the current size the new bits are set to zero.

Callers

nothing calls this directly

Calls 3

transform_reduceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected