1919#include < cuco/detail/error.hpp>
2020#include < cuco/detail/hyperloglog/finalizer.cuh>
2121#include < cuco/detail/hyperloglog/kernels.cuh>
22+ #include < cuco/detail/utility/strong_type.cuh>
2223#include < cuco/detail/utils.hpp>
2324#include < cuco/hash_functions.cuh>
24- #include < cuco/types.cuh>
2525#include < cuco/utility/cuda_thread_scope.cuh>
2626#include < cuco/utility/traits.hpp>
2727
4242#include < vector>
4343
4444namespace cuco ::detail {
45+ CUCO_DEFINE_STRONG_TYPE (sketch_size_kb, double );
46+ CUCO_DEFINE_STRONG_TYPE (standard_deviation, double );
47+ CUCO_DEFINE_STRONG_TYPE (precision, int32_t );
4548
4649/* *
4750 * @brief A GPU-accelerated utility for approximating the number of distinct items in a multiset.
@@ -84,9 +87,9 @@ class hyperloglog_impl {
8487 __host__ __device__ constexpr hyperloglog_impl (cuda::std::span<cuda::std::byte> sketch_span,
8588 Hash const & hash)
8689 : hash_{hash},
87- precision_{cuda::std::countr_zero (
88- sketch_bytes ( cuco::sketch_size_kb ( static_cast <double >(sketch_span.size () / 1024.0 ))) /
89- sizeof (register_type))},
90+ precision_{cuda::std::countr_zero (sketch_bytes ( cuco::detail::sketch_size_kb (
91+ static_cast <double >(sketch_span.size () / 1024.0 ))) /
92+ sizeof (register_type))},
9093 sketch_{reinterpret_cast <register_type*>(sketch_span.data ()),
9194 this ->sketch_bytes () / sizeof (register_type)}
9295 {
@@ -520,7 +523,7 @@ class hyperloglog_impl {
520523 * @return The number of bytes required for the sketch
521524 */
522525 [[nodiscard]] __host__ __device__ static constexpr cuda::std::size_t sketch_bytes (
523- cuco::sketch_size_kb sketch_size_kb) noexcept
526+ cuco::detail:: sketch_size_kb sketch_size_kb) noexcept
524527 {
525528 // minimum precision is 4 or 64 bytes
526529 return cuda::std::max (
@@ -536,7 +539,7 @@ class hyperloglog_impl {
536539 * @return The number of bytes required for the sketch
537540 */
538541 [[nodiscard]] __host__ __device__ static constexpr cuda::std::size_t sketch_bytes (
539- cuco::standard_deviation standard_deviation) noexcept
542+ cuco::detail:: standard_deviation standard_deviation) noexcept
540543 {
541544 // implementation taken from
542545 // https://github.com/apache/spark/blob/6a27789ad7d59cd133653a49be0bb49729542abe/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/HyperLogLogPlusPlusHelper.scala#L43
@@ -561,7 +564,7 @@ class hyperloglog_impl {
561564 * @return The number of bytes required for the sketch
562565 */
563566 [[nodiscard]] __host__ __device__ static constexpr cuda::std::size_t sketch_bytes (
564- cuco::precision precision) noexcept
567+ cuco::detail:: precision precision) noexcept
565568 {
566569 // minimum precision is 4 or 64 bytes
567570 auto const clamped_precision =
0 commit comments