Skip to content

Commit

Permalink
Restore with_hash_function for static_set (#610)
Browse files Browse the repository at this point in the history
This is the last piece required by
rapidsai/cudf#16967

To be reverted once libcudf has been updated to use the new `rebind_*`
equivalents.
  • Loading branch information
PointKernel authored Oct 3, 2024
1 parent f768729 commit 71e8f81
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 71e8f81

Please sign in to comment.