Skip to content

Commit

Permalink
Add declaration for new internal APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ttnghia committed Nov 4, 2021
1 parent e6885d4 commit d4d4644
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cpp/src/groupby/sort/group_reductions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,26 @@ std::unique_ptr<column> group_argmin(column_view const& values,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);

/**
* @brief Internal API to calculate group-wise indices of minimum/maximum values, specialized for
* STRUCT type.
*
* @param K The aggregation kind, must be `aggregation::ARGMIN` or `aggregation::ARGMAX`
* @param values Grouped values to get minimum value's index from
* @param num_groups Number of groups
* @param group_labels ID of group that the corresponding value belongs to
* @param key_sort_order Indices indicating sort order of groupby keys
* @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_argminmax_struct(aggregation::Kind K,
column_view const& values,
size_type num_groups,
cudf::device_span<size_type const> group_labels,
column_view const& key_sort_order,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);

/**
* @brief Internal API to calculate number of non-null values in each group of
* @p values
Expand Down
18 changes: 18 additions & 0 deletions cpp/src/groupby/sort/group_scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,24 @@ std::unique_ptr<column> max_scan(column_view const& values,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);

/**
* @brief Internal API to calculate groupwise cumulative minimum/maximum value, specialized for
* STRUCT type.
*
* @param K The aggregation kind, must be `aggregation::MIN` or `aggregation::MAX`
* @param values Grouped values to get maximum from
* @param num_groups Number of groups
* @param group_labels ID of group that the corresponding value belongs to
* @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> minmax_scan_struct(aggregation::Kind K,
column_view const& values,
size_type num_groups,
device_span<size_type const> group_labels,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr);

/**
* @brief Internal API to calculate cumulative number of values in each group
*
Expand Down

0 comments on commit d4d4644

Please sign in to comment.