Skip to content

Commit

Permalink
Add multimap size
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Nov 5, 2024
1 parent 505697e commit 04b2e02
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions include/cuco/detail/static_multimap/static_multimap.inl
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,21 @@ void static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator,
this->impl_->rehash_async(extent, *this, stream);
}

template <class Key,
class T,
class Extent,
cuda::thread_scope Scope,
class KeyEqual,
class ProbingScheme,
class Allocator,
class Storage>
static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::size_type
static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::size(
cuda::stream_ref stream) const
{
return impl_->size(stream);
}

template <class Key,
class T,
class Extent,
Expand Down
10 changes: 10 additions & 0 deletions include/cuco/static_multimap.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,16 @@ class static_multimap {
*/
void rehash_async(size_type capacity, cuda::stream_ref stream = {});

/**
* @brief Gets the number of elements in the container.
*
* @note This function synchronizes the given stream.
*
* @param stream CUDA stream used to get the number of inserted elements
* @return The number of elements in the container
*/
[[nodiscard]] size_type size(cuda::stream_ref stream = {}) const;

/**
* @brief Gets the maximum number of elements the hash map can hold.
*
Expand Down

0 comments on commit 04b2e02

Please sign in to comment.