Skip to content

Commit

Permalink
Update probing scheme to take tuple instead of cuco pair
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Sep 16, 2024
1 parent 55c593d commit 399c4d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/cuco/detail/probing_scheme/probing_scheme_impl.inl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ __host__ __device__ constexpr double_hashing<CGSize, Hash1, Hash2>::double_hashi

template <int32_t CGSize, typename Hash1, typename Hash2>
__host__ __device__ constexpr double_hashing<CGSize, Hash1, Hash2>::double_hashing(
cuco::pair<Hash1, Hash2> const& hash)
cuda::std::tuple<Hash1, Hash2> const& hash)
: hash1_{hash.first}, hash2_{hash.second}
{
}
Expand All @@ -156,7 +156,7 @@ __host__ __device__ constexpr auto double_hashing<CGSize, Hash1, Hash2>::rebind_
static_assert(cuco::is_tuple_like<NewHash>::value,
"The given hasher must be a tuple-like object");

auto const [hash1, hash2] = cuco::pair{hash};
auto const [hash1, hash2] = cuda::std::tuple{hash};
using hash1_type = cuda::std::decay_t<decltype(hash1)>;
using hash2_type = cuda::std::decay_t<decltype(hash2)>;
return double_hashing<cg_size, hash1_type, hash2_type>{hash1, hash2};
Expand Down
2 changes: 1 addition & 1 deletion include/cuco/probing_scheme.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class double_hashing : private detail::probing_scheme_base<CGSize> {
*
* @param hash Hasher tuple
*/
__host__ __device__ constexpr double_hashing(cuco::pair<Hash1, Hash2> const& hash);
__host__ __device__ constexpr double_hashing(cuda::std::tuple<Hash1, Hash2> const& hash);

/**
*@brief Makes a copy of the current probing method with the given hasher
Expand Down
2 changes: 1 addition & 1 deletion tests/static_multiset/custom_count_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void test_custom_count(Set& set, size_type num_keys)

auto const hash = []() {
if constexpr (cuco::is_double_hashing<typename Set::probing_scheme_type>::value) {
return cuco::pair{custom_hash{}, custom_hash{}};
return cuda::std::tuple{custom_hash{}, custom_hash{}};
} else {
return custom_hash{};
}
Expand Down

0 comments on commit 399c4d8

Please sign in to comment.