Skip to content

Commit

Permalink
Minor doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Mar 15, 2024
1 parent 3e9d868 commit 579012c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
14 changes: 8 additions & 6 deletions cpp/include/cudf/aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class aggregation {
MERGE_TDIGEST, ///< create a tdigest by merging multiple tdigests together
HISTOGRAM, ///< compute frequency of each element
MERGE_HISTOGRAM, ///< merge partial values of HISTOGRAM aggregation,
TOP_K, ///< get the top-k values per group as a list column
TOP_K ///< get the top-k values per group as a list column
};

aggregation() = delete;
Expand Down Expand Up @@ -531,13 +531,15 @@ std::unique_ptr<Base> make_collect_set_aggregation(
/**
* @brief Factory to create a TOP_K aggregation
*
* `TOP_K` returns a list column of the top-k elements in the
* group/series. If a group has fewer than k elements, the whole group
* is returned.
* `TOP_K` returns a list column of the first k elements in the
* group/series, each group sorted in @p order, with null elements
* comparing smaller than non-null. If a group has fewer than k
* elements, the whole groupis returned.
*
* @param k Number of values to return.
* @param order What order should the groups be sorted in.
* @return A TOP_K aggregation
* @param order Controls the sorting order of the group, i.e., whether
* to return the k smallest or largest elements.
* @return A TOP_K aggregation object.
*/
template <typename Base = aggregation>
std::unique_ptr<Base> make_top_k_aggregation(size_type k, order order = order::DESCENDING);
Expand Down
1 change: 1 addition & 0 deletions cpp/src/groupby/sort/aggregate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ void aggregate_result_functor::operator()<aggregation::TOP_K>(aggregation const&
stream,
mr));
}

template <>
void aggregate_result_functor::operator()<aggregation::NTH_ELEMENT>(aggregation const& agg)
{
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/groupby/sort/group_reductions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,15 +539,15 @@ std::unique_ptr<column> group_correlation(column_view const& covariance,
rmm::mr::device_memory_resource* mr);

/**
* @brief Internal API to calculate topk in each group of @p values
* @brief Internal API to calculate topk in each group of @p values.
*
* @param values Grouped values to get top-k values from
* @param group_sizes Number of elements per group
* @param group_offsets Offsets of groups' starting points within @p values
* @param num_groups Number of groups ( unique values in @p group_labels )
* @param num_groups Number of groups (unique values in @p group_labels)
* @param k How many elements to take from the front of each group of @p values
* @param order Sort order within each group (use ASCENDING for bottom-k, DESCENDING for top-k)
* @param stream CUDA stream used for device memory operations and kernel launches.
* @param stream CUDA stream used for device memory operations and kernel launches
* @param mr Device memory resource used to allocate the returned column's device memory
*/
std::unique_ptr<column> group_topk(column_view const& values,
Expand Down

0 comments on commit 579012c

Please sign in to comment.