Skip to content

Commit

Permalink
Improve the probing scheme header (#583)
Browse files Browse the repository at this point in the history
This PR fixes a small bug that the current `probing_scheme.cuh` header
is not self-contained due to a missing inclusion. It also adds a trait
to help #581 and #582.
  • Loading branch information
PointKernel authored Aug 21, 2024
1 parent abc5095 commit f620904
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/cuco/detail/utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#pragma once

#include <cuco/detail/__config>
#include <cuco/detail/bitwise_compare.cuh>

#include <cuda/std/array>
Expand Down
20 changes: 20 additions & 0 deletions include/cuco/probing_scheme.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <cuco/detail/probing_scheme/probing_scheme_base.cuh>
#include <cuco/pair.cuh>

#include <cuda/std/type_traits>

#include <cooperative_groups.h>

namespace cuco {
Expand Down Expand Up @@ -198,6 +200,24 @@ class double_hashing : private detail::probing_scheme_base<CGSize> {
Hash2 hash2_;
};

/**
* @brief Trait indicating whether the given probing scheme is of `double_hashing` type or not
*
* @tparam T Input probing scheme type
*/
template <typename T>
struct is_double_hashing : cuda::std::false_type {};

/**
* @brief Trait indicating whether the given probing scheme is of `double_hashing` type or not
*
* @tparam CGSize Size of CUDA Cooperative Groups
* @tparam Hash1 Unary callable type
* @tparam Hash2 Unary callable type
*/
template <int32_t CGSize, typename Hash1, typename Hash2>
struct is_double_hashing<cuco::double_hashing<CGSize, Hash1, Hash2>> : cuda::std::true_type {};

} // namespace cuco

#include <cuco/detail/probing_scheme/probing_scheme_impl.inl>

0 comments on commit f620904

Please sign in to comment.