基于主机(host-based)的用户自定义函数(UDF)用于归约(reduction)上下文的接口。更多...
#include <host_udf.hpp>
公共成员函数 | |
virtual std::unique_ptr< scalar > | operator() (column_view const &input, data_type output_dtype, std::optional< std::reference_wrapper< scalar const >> init, rmm::cuda_stream_view stream, rmm::device_async_resource_ref mr) const =0 |
执行归约操作。更多... | |
![]() | |
virtual | ~host_udf_base ()=default |
默认析构函数。 | |
virtual std::size_t | do_hash () const |
计算实例的哈希值。更多... | |
virtual bool | is_equal (host_udf_base const &other) const =0 |
比较派生类的两个实例是否相等。更多... | |
virtual std::unique_ptr< host_udf_base > | clone () const =0 |
克隆实例。更多... | |
基于主机(host-based)的用户自定义函数(UDF)用于归约(reduction)上下文的接口。
归约操作的基于主机 UDF 实现需要从此类派生。除了实现基类 host_udf_base
中声明的虚函数外,此类派生类还必须定义 operator()
函数来执行归约操作。
示例
定义于文件 host_udf.hpp 的 131 行。
|
纯虚函数 |
执行归约操作。
input | 用于归约的输入列 |
output_dtype | 最终输出标量的数据类型 |
init | 归约的初始值 |
stream | 用于启动任何核函数的 CUDA 流 |
mr | 用于任何分配的设备内存资源 |