Skip to content

Commit 71e8f81

Browse files
authored
Restore with_hash_function for static_set (#610)
This is the last piece required by rapidsai/cudf#16967 To be reverted once libcudf has been updated to use the new `rebind_*` equivalents.
1 parent f768729 commit 71e8f81

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

include/cuco/detail/static_set/static_set_ref.inl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,20 @@ static_set_ref<Key, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::r
336336
this->storage_ref()};
337337
}
338338

339+
template <typename Key,
340+
cuda::thread_scope Scope,
341+
typename KeyEqual,
342+
typename ProbingScheme,
343+
typename StorageRef,
344+
typename... Operators>
345+
template <typename NewHash>
346+
__host__ __device__ constexpr auto
347+
static_set_ref<Key, Scope, KeyEqual, ProbingScheme, StorageRef, Operators...>::with_hash_function(
348+
NewHash const& hash) const
349+
{
350+
return this->rebind_hash_function(hash);
351+
}
352+
339353
template <typename Key,
340354
cuda::thread_scope Scope,
341355
typename KeyEqual,

include/cuco/static_set_ref.cuh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ class static_set_ref
270270
template <typename NewHash>
271271
[[nodiscard]] __host__ __device__ constexpr auto rebind_hash_function(NewHash const& hash) const;
272272

273+
/**
274+
* @brief Makes a copy of the current device reference with the given hasher
275+
*
276+
* @tparam NewHash The new hasher type
277+
*
278+
* @param hash New hasher
279+
*
280+
* @return Copy of the current device ref
281+
*/
282+
template <typename NewHash>
283+
[[nodiscard]] __host__ __device__ constexpr auto with_hash_function(NewHash const& hash) const;
284+
273285
/**
274286
* @brief Makes a copy of the current device reference using non-owned memory
275287
*

0 commit comments

Comments
 (0)