diff --git a/cpp/src/groupby/sort/group_reductions.hpp b/cpp/src/groupby/sort/group_reductions.hpp index 75708c7b01c..268c088fe87 100644 --- a/cpp/src/groupby/sort/group_reductions.hpp +++ b/cpp/src/groupby/sort/group_reductions.hpp @@ -173,6 +173,26 @@ std::unique_ptr 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 group_argminmax_struct(aggregation::Kind K, + column_view const& values, + size_type num_groups, + cudf::device_span 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 diff --git a/cpp/src/groupby/sort/group_scan.hpp b/cpp/src/groupby/sort/group_scan.hpp index 82ef0e25380..2be779b6f3b 100644 --- a/cpp/src/groupby/sort/group_scan.hpp +++ b/cpp/src/groupby/sort/group_scan.hpp @@ -72,6 +72,24 @@ std::unique_ptr 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 minmax_scan_struct(aggregation::Kind K, + column_view const& values, + size_type num_groups, + device_span 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 *