Skip to content

Commit

Permalink
Restore with_hash_function for static_set
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Oct 3, 2024
1 parent f768729 commit 78e21e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/cuco/detail/static_set/static_set_ref.inl
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,20 @@ static_set_ref<Key, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::r
this->storage_ref()};
}

template <typename Key,
cuda::thread_scope Scope,
typename KeyEqual,
typename ProbingScheme,
typename StorageRef,
typename... Operators>
template <typename NewHash>
__host__ __device__ constexpr auto
static_set_ref<Key, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::with_hash_function(
NewHash const& hash) const
{
return this->rebind_hash_function(hash);
}

template <typename Key,
cuda::thread_scope Scope,
typename KeyEqual,
Expand Down
12 changes: 12 additions & 0 deletions include/cuco/static_set_ref.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@ class static_set_ref
template <typename NewHash>
[[nodiscard]] __host__ __device__ constexpr auto rebind_hash_function(NewHash const& hash) const;

/**
* @brief Makes a copy of the current device reference with the given hasher
*
* @tparam NewHash The new hasher type
*
* @param hash New hasher
*
* @return Copy of the current device ref
*/
template <typename NewHash>
[[nodiscard]] __host__ __device__ constexpr auto with_hash_function(NewHash const& hash) const;

/**
* @brief Makes a copy of the current device reference using non-owned memory
*
Expand Down

0 comments on commit 78e21e7

Please sign in to comment.