From 95fe1f6072afdfd3937c235c57b06f90f321ea48 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 26 Nov 2024 12:52:16 -0800 Subject: [PATCH] Cleanups --- cpp/include/cudf/hashing/detail/xxhash_64.cuh | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/cpp/include/cudf/hashing/detail/xxhash_64.cuh b/cpp/include/cudf/hashing/detail/xxhash_64.cuh index f110567c109..2a86c028303 100644 --- a/cpp/include/cudf/hashing/detail/xxhash_64.cuh +++ b/cpp/include/cudf/hashing/detail/xxhash_64.cuh @@ -43,7 +43,7 @@ struct XXHash_64 { template __device__ constexpr result_type compute(T const& key) const { - return this->_impl.compute_hash(reinterpret_cast(&key), sizeof(T)); + return this->compute_bytes(reinterpret_cast(&key), sizeof(T)); } cuco::xxhash_64 _impl; @@ -52,54 +52,49 @@ struct XXHash_64 { template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(bool const& key) const { - return this->compute_hash(reinterpret_cast(&key), sizeof(key)); + return this->compute(static_cast(key)); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(float const& key) const { - return cuco::xxhash_64::operator()(normalize_nans(key)); + return this->compute(normalize_nans(key)); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()( double const& key) const { - return cuco::xxhash_64::operator()(normalize_nans(key)); + return this->compute(normalize_nans(key)); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(cudf::string_view const& key) const { - return this->compute_hash(reinterpret_cast(key.data()), key.size_bytes()); + return this->compute_bytes(reinterpret_cast(key.data()), + key.size_bytes()); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(numeric::decimal32 const& key) const { - auto const val = key.value(); - auto const len = sizeof(val); - return this->compute_hash(reinterpret_cast(&val), len); + return this->compute(key.value()); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(numeric::decimal64 const& key) const { - auto const val = key.value(); - auto const len = sizeof(val); - return this->compute_hash(reinterpret_cast(&val), len); + return this->compute(key.value()); } template <> XXHash_64::result_type __device__ inline XXHash_64::operator()(numeric::decimal128 const& key) const { - auto const val = key.value(); - auto const len = sizeof(val); - return this->compute_hash(reinterpret_cast(&val), len); + return this->compute(key.value()); } } // namespace cudf::hashing::detail