count

count#

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

◆ count() [1/2]

template<typename Key , typename T , typename Hash = hash<Key>, typename KeyEqual = equal_to<Key>, typename Allocator = safe_device_allocator<pair<const Key, T>>>
STDGPU_DEVICE_ONLY index_type stdgpu::unordered_map< Key, T, 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