count

count#

stdgpu: stdgpu::unordered_set::count
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ count() [1/2]

template<typename Key , typename Hash = hash<Key>, typename KeyEqual = equal_to<Key>, typename Allocator = safe_device_allocator<Key>>
STDGPU_DEVICE_ONLY index_type stdgpu::unordered_set< Key, Hash, KeyEqual, Allocator >::count ( const key_type key) const

Returns the number of elements with the given key in the container.

Parameters
[in]keyThe key
Returns
The number of elements with the given key, i.e. 1 or 0