Skip to content

Commit

Permalink
Fix return types for MurmurHash3_x86_32 template specializations (#17622
Browse files Browse the repository at this point in the history
)

Changes the return types for the `MurmurHash3_x86_32` specialization functions to match the declarations in the struct.
Hoping to fix some intellisense squiggles.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Tianyu Liu (https://github.com/kingcrimsontianyu)
  - Yunsong Wang (https://github.com/PointKernel)
  - Nghia Truong (https://github.com/ttnghia)

URL: #17622
  • Loading branch information
davidwendt authored Dec 19, 2024
1 parent dfb7c11 commit 0e01dbd
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -57,62 +57,71 @@ struct MurmurHash3_x86_32 {
};

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<bool>::operator()(bool const& key) const
MurmurHash3_x86_32<bool>::result_type __device__ inline MurmurHash3_x86_32<bool>::operator()(
bool const& key) const
{
return this->compute(static_cast<uint8_t>(key));
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<float>::operator()(float const& key) const
MurmurHash3_x86_32<float>::result_type __device__ inline MurmurHash3_x86_32<float>::operator()(
float const& key) const
{
return this->compute(normalize_nans_and_zeros(key));
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<double>::operator()(double const& key) const
MurmurHash3_x86_32<double>::result_type __device__ inline MurmurHash3_x86_32<double>::operator()(
double const& key) const
{
return this->compute(normalize_nans_and_zeros(key));
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<cudf::string_view>::operator()(
cudf::string_view const& key) const
MurmurHash3_x86_32<cudf::string_view>::result_type
__device__ inline MurmurHash3_x86_32<cudf::string_view>::operator()(
cudf::string_view const& key) const
{
return this->compute_bytes(reinterpret_cast<cuda::std::byte const*>(key.data()),
key.size_bytes());
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<numeric::decimal32>::operator()(
numeric::decimal32 const& key) const
MurmurHash3_x86_32<numeric::decimal32>::result_type
__device__ inline MurmurHash3_x86_32<numeric::decimal32>::operator()(
numeric::decimal32 const& key) const
{
return this->compute(key.value());
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<numeric::decimal64>::operator()(
numeric::decimal64 const& key) const
MurmurHash3_x86_32<numeric::decimal64>::result_type
__device__ inline MurmurHash3_x86_32<numeric::decimal64>::operator()(
numeric::decimal64 const& key) const
{
return this->compute(key.value());
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<numeric::decimal128>::operator()(
numeric::decimal128 const& key) const
MurmurHash3_x86_32<numeric::decimal128>::result_type
__device__ inline MurmurHash3_x86_32<numeric::decimal128>::operator()(
numeric::decimal128 const& key) const
{
return this->compute(key.value());
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<cudf::list_view>::operator()(
cudf::list_view const& key) const
MurmurHash3_x86_32<cudf::list_view>::result_type
__device__ inline MurmurHash3_x86_32<cudf::list_view>::operator()(
cudf::list_view const& key) const
{
CUDF_UNREACHABLE("List column hashing is not supported");
}

template <>
hash_value_type __device__ inline MurmurHash3_x86_32<cudf::struct_view>::operator()(
cudf::struct_view const& key) const
MurmurHash3_x86_32<cudf::struct_view>::result_type
__device__ inline MurmurHash3_x86_32<cudf::struct_view>::operator()(
cudf::struct_view const& key) const
{
CUDF_UNREACHABLE("Direct hashing of struct_view is not supported");
}
Expand Down

0 comments on commit 0e01dbd

Please sign in to comment.