From dc71ba08aa81c942c0537795c228bb937c16b9ce Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:38:58 +0000 Subject: [PATCH] Remove empty key sentinel --- .../cuco/detail/open_addressing/open_addressing_ref_impl.cuh | 5 +---- include/cuco/detail/static_map/static_map_ref.inl | 3 +-- include/cuco/detail/static_set/static_set_ref.inl | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh b/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh index a93d8d708..504c00f03 100644 --- a/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -120,20 +119,18 @@ class open_addressing_ref_impl { /** * @brief Constructs open_addressing_ref_impl. * - * @param empty_key_sentinel The reserved key value for empty slots * @param empty_slot_sentinel Sentinel indicating an empty slot * @param predicate Key equality binary callable * @param probing_scheme Probing scheme * @param storage_ref Non-owning ref of slot storage */ __host__ __device__ explicit constexpr open_addressing_ref_impl( - cuco::empty_key empty_key_sentinel, value_type empty_slot_sentinel, key_equal const& predicate, probing_scheme_type const& probing_scheme, storage_ref_type storage_ref) noexcept : empty_slot_sentinel_{empty_slot_sentinel}, - predicate_{empty_key_sentinel, predicate}, + predicate_{this->extract_key(empty_slot_sentinel), predicate}, probing_scheme_{probing_scheme}, storage_ref_{storage_ref} { diff --git a/include/cuco/detail/static_map/static_map_ref.inl b/include/cuco/detail/static_map/static_map_ref.inl index c2914c828..f842fec06 100644 --- a/include/cuco/detail/static_map/static_map_ref.inl +++ b/include/cuco/detail/static_map/static_map_ref.inl @@ -44,8 +44,7 @@ __host__ __device__ constexpr static_map_ref< KeyEqual const& predicate, ProbingScheme const& probing_scheme, StorageRef storage_ref) noexcept - : impl_{empty_key_sentinel, - cuco::pair{empty_key_sentinel, empty_value_sentinel}, + : impl_{cuco::pair{empty_key_sentinel, empty_value_sentinel}, predicate, probing_scheme, storage_ref}, diff --git a/include/cuco/detail/static_set/static_set_ref.inl b/include/cuco/detail/static_set/static_set_ref.inl index c5558ff9c..08fc4b6db 100644 --- a/include/cuco/detail/static_set/static_set_ref.inl +++ b/include/cuco/detail/static_set/static_set_ref.inl @@ -41,7 +41,7 @@ __host__ __device__ constexpr static_set_ref< KeyEqual const& predicate, ProbingScheme const& probing_scheme, StorageRef storage_ref) noexcept - : impl_{empty_key_sentinel, empty_key_sentinel, predicate, probing_scheme, storage_ref} + : impl_{empty_key_sentinel, predicate, probing_scheme, storage_ref} { }