Skip to content

Commit

Permalink
Update insert_if to return #insertions
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Aug 7, 2024
1 parent 9dd4d50 commit 6408091
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions include/cuco/detail/static_multimap/static_multimap.inl
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ template <class Key,
class Allocator,
class Storage>
template <typename InputIt, typename StencilIt, typename Predicate>
void static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::insert_if(
static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::size_type
static_multimap<Key, T, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::insert_if(
InputIt first, InputIt last, StencilIt stencil, Predicate pred, cuda::stream_ref stream)
{
this->insert_if_async(first, last, stencil, pred, stream);
stream.wait();
return impl_->insert_if(first, last, stencil, pred, ref(op::insert), stream);
}

template <class Key,
Expand Down
6 changes: 3 additions & 3 deletions include/cuco/detail/static_multiset/static_multiset.inl
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ template <class Key,
class Allocator,
class Storage>
template <typename InputIt, typename StencilIt, typename Predicate>
void static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::insert_if(
static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::size_type
static_multiset<Key, Extent, Scope, KeyEqual, ProbingScheme, Allocator, Storage>::insert_if(
InputIt first, InputIt last, StencilIt stencil, Predicate pred, cuda::stream_ref stream)
{
this->insert_if_async(first, last, stencil, pred, stream);
stream.wait();
return impl_->insert_if(first, last, stencil, pred, ref(op::insert), stream);
}

template <class Key,
Expand Down
4 changes: 3 additions & 1 deletion include/cuco/static_multimap.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@ class static_multimap {
* @param pred Predicate to test on every element in the range `[stencil, stencil +
* std::distance(first, last))`
* @param stream CUDA stream used for the operation
*
* @return Number of successful insertions
*/
template <typename InputIt, typename StencilIt, typename Predicate>
void insert_if(
size_type insert_if(
InputIt first, InputIt last, StencilIt stencil, Predicate pred, cuda::stream_ref stream = {});

/**
Expand Down
4 changes: 3 additions & 1 deletion include/cuco/static_multiset.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,11 @@ class static_multiset {
* @param pred Predicate to test on every element in the range `[stencil, stencil +
* std::distance(first, last))`
* @param stream CUDA stream used for the operation
*
* @return Number of successful insertions
*/
template <typename InputIt, typename StencilIt, typename Predicate>
void insert_if(
size_type insert_if(
InputIt first, InputIt last, StencilIt stencil, Predicate pred, cuda::stream_ref stream = {});

/**
Expand Down

0 comments on commit 6408091

Please sign in to comment.