From eff1be63536eafd4921a771bb09b2e78a492ed8b Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Fri, 28 Jun 2024 09:32:02 -0700 Subject: [PATCH] Fix docs + add missing header --- .../cuco/detail/hash_functions/identity_hash.cuh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/cuco/detail/hash_functions/identity_hash.cuh b/include/cuco/detail/hash_functions/identity_hash.cuh index c80255bf5..995bded1d 100644 --- a/include/cuco/detail/hash_functions/identity_hash.cuh +++ b/include/cuco/detail/hash_functions/identity_hash.cuh @@ -16,6 +16,7 @@ #pragma once +#include #include namespace cuco::detail { @@ -29,18 +30,23 @@ namespace cuco::detail { * * @note Perfect hashes are deterministic, and thus do not need seeds. * - * @tparam Key The type of the values to hash. Must have size <= uint64_t + * @tparam Key The type of the values to hash */ template struct identity_hash : private thrust::identity { - using argument_type = Key; // The type of the values taken as argument - using result_type = - std::conditional_t; // The type of the hash values - // produced + using argument_type = Key; ///< The type of the values taken as argument + /// The type of the hash values produced + using result_type = cuda::std::conditional_t; static_assert(cuda::std::is_convertible_v, "Key type must be convertible to result_type"); + /** + * @brief Returns a hash value for its argument, as a value of type `result_type`. + * + * @param x The input argument to hash + * @return A resulting hash value for `x` + */ __host__ __device__ result_type operator()(Key const& x) const { return static_cast(thrust::identity::operator()(x));