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 57385e3a3..a93d8d708 100644 --- a/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh @@ -149,16 +149,47 @@ class open_addressing_ref_impl { return this->predicate_.empty_sentinel_; } + /** + * @brief Gets the sentinel used to represent an empty slot. + * + * @return The sentinel value used to represent an empty slot + */ + [[nodiscard]] __device__ constexpr value_type empty_slot_sentinel() const noexcept + { + return empty_slot_sentinel_; + } + /** * @brief Returns the function that compares keys for equality. * * @return The key equality predicate */ - [[nodiscard]] __host__ __device__ constexpr auto key_eq() const noexcept + [[nodiscard]] __host__ __device__ constexpr detail::equal_wrapper key_eq() + const noexcept { return this->predicate_; } + /** + * @brief Gets the probing scheme. + * + * @return The probing scheme used for the container + */ + [[nodiscard]] __device__ constexpr probing_scheme_type const& probing_scheme() const noexcept + { + return probing_scheme_; + } + + /** + * @brief Gets the non-owning storage ref. + * + * @return The non-owning storage ref of the container + */ + [[nodiscard]] __device__ constexpr storage_ref_type storage_ref() const noexcept + { + return storage_ref_; + } + /** * @brief Gets the maximum number of elements the container can hold. * @@ -186,21 +217,6 @@ class open_addressing_ref_impl { */ [[nodiscard]] __host__ __device__ constexpr iterator end() noexcept { return storage_ref_.end(); } - /** - * @brief Extracts the key from a given value type. - * - * @return The key - */ - template - [[nodiscard]] __host__ __device__ constexpr auto extract_key(Value const& value) const noexcept - { - if constexpr (this->has_payload) { - return value.first; - } else { - return value; - } - } - /** * @brief Inserts an element. * @@ -675,37 +691,22 @@ class open_addressing_ref_impl { } } + private: /** - * @brief Gets the sentinel used to represent an empty slot. - * - * @return The sentinel value used to represent an empty slot - */ - [[nodiscard]] __device__ constexpr value_type empty_slot_sentinel() const noexcept - { - return empty_slot_sentinel_; - } - - /** - * @brief Gets the probing scheme. - * - * @return The probing scheme used for the container - */ - [[nodiscard]] __device__ constexpr probing_scheme_type const& probing_scheme() const noexcept - { - return probing_scheme_; - } - - /** - * @brief Gets the non-owning storage ref. + * @brief Extracts the key from a given value type. * - * @return The non-owning storage ref of the container + * @return The key */ - [[nodiscard]] __device__ constexpr storage_ref_type storage_ref() const noexcept + template + [[nodiscard]] __host__ __device__ constexpr auto extract_key(Value const& value) const noexcept { - return storage_ref_; + if constexpr (this->has_payload) { + return value.first; + } else { + return value; + } } - private: /** * @brief Inserts the specified element with one single CAS operation. * diff --git a/include/cuco/static_set_ref.cuh b/include/cuco/static_set_ref.cuh index 007691b33..517f6b488 100644 --- a/include/cuco/static_set_ref.cuh +++ b/include/cuco/static_set_ref.cuh @@ -68,7 +68,6 @@ class static_set_ref detail::open_addressing_ref_impl; public: - // TODO use impl_type::* aliases using key_type = Key; ///< Key Type using probing_scheme_type = ProbingScheme; ///< Type of probing scheme using storage_ref_type = StorageRef; ///< Type of storage ref