11 #include <cudf/utilities/export.hpp>
16 #include <cuda/std/span>
27 namespace CUDF_EXPORT
cudf {
35 namespace hashing::detail {
36 template <
typename Key>
41 template <
template <
typename>
class Hasher>
130 std::int32_t precision = 12,
132 nan_policy nan_handling = nan_policy::NAN_IS_NULL,
134 cuda::mr::any_resource<cuda::mr::device_accessible> mr =
161 nan_policy nan_handling = nan_policy::NAN_IS_NULL,
163 cuda::mr::any_resource<cuda::mr::device_accessible> mr =
182 std::int32_t precision,
184 nan_policy nan_handling = nan_policy::NAN_IS_NULL);
234 void merge(cuda::std::span<cuda::std::byte const> sketch_span,
255 [[nodiscard]] cuda::std::span<cuda::std::byte>
sketch() noexcept;
266 [[nodiscard]] cuda::std::span<cuda::std::
byte const> sketch() const noexcept;
287 [[nodiscard]] std::int32_t precision() const noexcept;
297 [[nodiscard]]
double standard_error() const noexcept;
305 [[nodiscard]] static std::
size_t sketch_bytes(std::int32_t precision);
312 [[nodiscard]] static std::
size_t sketch_alignment();
Object-oriented HyperLogLog sketch for approximate distinct counting.
approx_distinct_count(table_view const &input, desired_standard_error error, null_policy null_handling=null_policy::EXCLUDE, nan_policy nan_handling=nan_policy::NAN_IS_NULL, rmm::cuda_stream_view stream=cudf::get_default_stream(), cuda::mr::any_resource< cuda::mr::device_accessible > mr=cudf::get_current_device_resource_ref())
Constructs an approximate distinct count sketch from a table with specified standard error.
std::size_t estimate(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
Estimates the approximate number of distinct rows in the sketch.
void merge(approx_distinct_count const &other, rmm::cuda_stream_view stream=cudf::get_default_stream())
Merges another sketch into this sketch.
approx_distinct_count(approx_distinct_count &&)=default
Default move constructor.
approx_distinct_count & operator=(approx_distinct_count &&)=default
Move assignment operator.
approx_distinct_count(cuda::std::span< cuda::std::byte > sketch_span, std::int32_t precision, null_policy null_handling=null_policy::EXCLUDE, nan_policy nan_handling=nan_policy::NAN_IS_NULL)
Constructs a non-owning sketch that operates on user-allocated storage.
void merge(cuda::std::span< cuda::std::byte const > sketch_span, rmm::cuda_stream_view stream=cudf::get_default_stream())
Merges a sketch from raw bytes into this sketch.
approx_distinct_count(table_view const &input, std::int32_t precision=12, null_policy null_handling=null_policy::EXCLUDE, nan_policy nan_handling=nan_policy::NAN_IS_NULL, rmm::cuda_stream_view stream=cudf::get_default_stream(), cuda::mr::any_resource< cuda::mr::device_accessible > mr=cudf::get_current_device_resource_ref())
Constructs an approximate distinct count sketch from a table with specified precision.
cuda::std::span< cuda::std::byte > sketch() noexcept
Gets the raw sketch bytes for serialization or external merging.
void add(table_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream())
Adds rows from a table to the sketch.
A set of cudf::column_view's of the same size.
APIs for querying the default CUDA stream and per-thread default stream status.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
null_policy
Enum to specify whether to include nulls or exclude nulls.
nan_policy
Enum to treat NaN floating point value as null or non-null element.
APIs for getting and setting the current device memory resource.
Strong type wrapper for the desired standard error constructor parameter.
double value
The requested standard error value (must be positive)
constexpr desired_standard_error(double v)
Constructs a desired_standard_error with the given value.
Class definitions for (mutable)_table_view
Type declarations for libcudf.