reduction.hpp
前往此文件的文档。
1 /*
2  * 版权所有 (c) 2019-2024, NVIDIA CORPORATION.
3  *
4  * 根据 Apache 许可证 2.0 版 ("许可证") 获得许可;
5  * 除非遵守许可证的规定,否则您不得使用此文件。
6  * 您可以在以下位置获取许可证的副本
7  *
8  * https://apache.ac.cn/licenses/LICENSE-2.0
9  *
10  * 除非适用法律要求或书面同意,否则软件
11  * 根据许可证分发,按“原样”提供,
12  * 不附带任何明示或暗示的保证或条件。
13  * 有关管理权限和
14  * 限制的特定语言,请参阅许可证。
15  */
16 
17 #pragma once
18 
19 #include <cudf/aggregation.hpp>
20 #include <cudf/scalar/scalar.hpp>
21 #include <cudf/utilities/export.hpp>
23 
24 #include <optional>
25 
26 namespace CUDF_EXPORT cudf {
36 enum class scan_type : bool { INCLUSIVE, EXCLUSIVE };
37 
81 std::unique_ptr<scalar> reduce(
82  column_view const& col,
83  reduce_aggregation const& agg,
84  data_type output_dtype,
87 
104 std::unique_ptr<scalar> reduce(
105  column_view const& col,
106  reduce_aggregation const& agg,
107  data_type output_dtype,
108  std::optional<std::reference_wrapper<scalar const>> init,
111 
155 std::unique_ptr<column> segmented_reduce(
156  column_view const& segmented_values,
158  segmented_reduce_aggregation const& agg,
159  data_type output_dtype,
160  null_policy null_handling,
163 
181 std::unique_ptr<column> segmented_reduce(
182  column_view const& segmented_values,
184  segmented_reduce_aggregation const& agg,
185  data_type output_dtype,
186  null_policy null_handling,
187  std::optional<std::reference_wrapper<scalar const>> init,
190 
209 std::unique_ptr<column> scan(
210  column_view const& input,
211  scan_aggregation const& agg,
213  null_policy null_handling = null_policy::EXCLUDE,
216 
227 std::pair<std::unique_ptr<scalar>, std::unique_ptr<scalar>> minmax(
228  column_view const& col,
231  // 组结束
233 
234 } // 命名空间 CUDF_EXPORT cudf
用于指定基于聚合的 API 所需聚合的表示,例如...
设备数据的非拥有、不可变视图,表示为一个元素列,其中某些元素可能为空,如...
列中元素的逻辑数据类型指示符。
定义: types.hpp:243
用于归约操作的派生类。
用于扫描操作的派生类。
用于分段归约操作的派生类。
scan_type
描述扫描操作类型的枚举。
std::unique_ptr< column > scan(column_view const &input, scan_aggregation const &agg, scan_type inclusive, null_policy null_handling=null_policy::EXCLUDE, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
计算列的扫描。
std::unique_ptr< scalar > reduce(column_view const &col, reduce_aggregation const &agg, data_type output_dtype, std::optional< std::reference_wrapper< scalar const >> init, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
计算列中所有行的值与初始值的归约结果。
std::unique_ptr< column > segmented_reduce(column_view const &segmented_values, device_span< size_type const > offsets, segmented_reduce_aggregation const &agg, data_type output_dtype, null_policy null_handling, std::optional< std::reference_wrapper< scalar const >> init, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
计算输入列中每个段的归约结果(包含初始值)。仅支持 SUM,...
std::pair< std::unique_ptr< scalar >, std::unique_ptr< scalar > > minmax(column_view const &col, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
确定列的最小值和最大值。
rmm::cuda_stream_view const get_default_stream()
获取当前默认流。
inclusive
用于定义分箱是否包含其边界点的枚举。
rmm::device_async_resource_ref get_current_device_resource_ref()
获取当前设备内存资源引用。
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
null_policy
指定是否包含空值或排除空值的枚举。
定义: types.hpp:126
cuDF 接口
定义: host_udf.hpp:37
cudf::scalar 的类定义。
具有简化功能集的 C++20 std::span 的设备版本。
定义: span.hpp:355