文件 | |
文件 | binaryop.hpp |
列的二元运算 API。 | |
类 | |
struct | cudf::binary_op_common_type< L, R, typename > |
二元运算通用类型默认实现。 更多... | |
struct | cudf::binary_op_common_type< L, R, std::enable_if_t< has_common_type_v< L, R > > > |
二元运算通用类型特化实现。 更多... | |
类型别名 | |
template<typename L , typename R > | |
using | cudf::binary_op_common_type_t = typename binary_op_common_type< L, R >::type |
二元运算通用类型助手。 | |
枚举 | |
enum class | cudf::binary_operator : int32_t { cudf::ADD , cudf::SUB , cudf::MUL , cudf::DIV , cudf::TRUE_DIV , cudf::FLOOR_DIV , cudf::MOD , cudf::PMOD , cudf::PYMOD , cudf::POW , cudf::INT_POW , cudf::LOG_BASE , cudf::ATAN2 , cudf::SHIFT_LEFT , cudf::SHIFT_RIGHT , cudf::SHIFT_RIGHT_UNSIGNED , cudf::BITWISE_AND , cudf::BITWISE_OR , cudf::BITWISE_XOR , cudf::LOGICAL_AND , cudf::LOGICAL_OR , cudf::EQUAL , cudf::NOT_EQUAL , cudf::LESS , cudf::GREATER , cudf::LESS_EQUAL , cudf::GREATER_EQUAL , cudf::NULL_EQUALS , cudf::NULL_NOT_EQUALS , cudf::NULL_MAX , cudf::NULL_MIN , cudf::GENERIC_BINARY , cudf::NULL_LOGICAL_AND , cudf::NULL_LOGICAL_OR , cudf::INVALID_BINARY } |
可在数据上执行的二元运算类型。 更多... | |
变量 | |
template<typename L , typename R > | |
constexpr bool | cudf::binary_op_has_common_type_v |
检查二元运算类型是否具有通用类型。 更多... | |
|
strong |
可在数据上执行的二元运算类型。
定义位于行 38 文件 binaryop.hpp。
std::unique_ptr<column> cudf::binary_operation | ( | column_view const & | lhs, |
column_view const & | rhs, | ||
binary_operator | op, | ||
data_type | output_type, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
在两列之间执行二元运算。
输出包含所有 0 <= i < lhs.size()
的 op(lhs[i], rhs[i])
结果。
无论运算符是什么,输出值的有效性是两个操作数有效性的逻辑 AND,除了 NullMin 和 NullMax (逻辑 OR)。
lhs | 左操作数列 |
rhs | 右操作数列 |
op | 二元运算符 |
output_type | 期望的输出列数据类型 |
stream | 用于设备内存操作和内核启动的 CUDA stream |
mr | 用于分配返回列设备内存的设备内存资源 |
output_type
的输出列,包含二元运算的结果cudf::logic_error | 如果 lhs 和 rhs 大小不同 |
cudf::logic_error | 如果 output_type dtype 对于比较和逻辑运算不是布尔类型。 |
cudf::logic_error | 如果 output_type dtype 不是固定宽度类型 |
cudf::data_type_error | 如果操作不支持 lhs 和 rhs 的类型 |
std::unique_ptr<column> cudf::binary_operation | ( | column_view const & | lhs, |
column_view const & | rhs, | ||
std::string const & | ptx, | ||
data_type | output_type, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
使用用户定义的 PTX 函数在两列之间执行二元运算。
输出包含所有 0 <= i < lhs.size()
的 op(lhs[i], rhs[i])
结果。
无论运算符是什么,输出值的有效性是两个操作数有效性的逻辑 AND。
lhs | 左操作数列 |
rhs | 右操作数列 |
ptx | 包含二元函数 PTX 代码的字符串 |
output_type | 期望的输出列数据类型。假设 output_type 与 PTX 代码中函数的输出数据类型兼容 |
stream | 用于设备内存操作和内核启动的 CUDA stream |
mr | 用于分配返回列设备内存的设备内存资源 |
output_type
的输出列,包含二元运算的结果cudf::logic_error | 如果 lhs 和 rhs 大小不同 |
cudf::logic_error | 如果 lhs 和 rhs dtypes 不是数值类型 |
cudf::logic_error | 如果 output_type dtype 不是数值类型 |
std::unique_ptr<column> cudf::binary_operation | ( | column_view const & | lhs, |
scalar const & | rhs, | ||
binary_operator | op, | ||
data_type | output_type, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
在列和标量之间执行二元运算。
输出包含所有 0 <= i < lhs.size()
的 op(lhs[i], rhs)
结果。列元素是左操作数,标量是右操作数。这种区别在非可交换二元运算中很重要
无论运算符是什么,输出值的有效性是两个操作数有效性的逻辑 AND,除了 NullMin 和 NullMax (逻辑 OR)。
lhs | 左操作数列 |
rhs | 右操作数标量 |
op | 二元运算符 |
output_type | 期望的输出列数据类型 |
stream | 用于设备内存操作和内核启动的 CUDA stream |
mr | 用于分配返回列设备内存的设备内存资源 |
output_type
的输出列,包含二元运算的结果cudf::logic_error | 如果 output_type dtype 不是固定宽度类型 |
cudf::logic_error | 如果 output_type dtype 对于比较和逻辑运算不是布尔类型。 |
cudf::data_type_error | 如果操作不支持 lhs 和 rhs 的类型 |
std::unique_ptr<column> cudf::binary_operation | ( | scalar const & | lhs, |
column_view const & | rhs, | ||
binary_operator | op, | ||
data_type | output_type, | ||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
在标量和列之间执行二元运算。
输出包含所有 0 <= i < rhs.size()
的 op(lhs, rhs[i])
结果。标量是左操作数,列元素是右操作数。这种区别在非可交换二元运算中很重要
无论运算符是什么,输出值的有效性是两个操作数有效性的逻辑 AND,除了 NullMin 和 NullMax (逻辑 OR)。
lhs | 左操作数标量 |
rhs | 右操作数列 |
op | 二元运算符 |
output_type | 期望的输出列数据类型 |
stream | 用于设备内存操作和内核启动的 CUDA stream |
mr | 用于分配返回列设备内存的设备内存资源 |
output_type
的输出列,包含二元运算的结果cudf::logic_error | 如果 output_type dtype 不是固定宽度类型 |
cudf::logic_error | 如果 output_type dtype 对于比较和逻辑运算不是布尔类型。 |
cudf::data_type_error | 如果操作不支持 lhs 和 rhs 的类型 |
cudf::data_type cudf::binary_operation_fixed_point_output_type | ( | binary_operator | op, |
cudf::data_type const & | lhs, | ||
cudf::data_type const & | rhs | ||
) |
根据给定的二元运算符 op
计算 fixed_point
数值的 data_type
。
op | 用于两个 fixed_point 数值的 binary_operator |
lhs | 左侧 fixed_point 数值的 cudf::data_type |
rhs | 右侧 fixed_point 数值的 cudf::data_type |
fixed_point
数值的 cudf::data_type
int32_t cudf::binary_operation_fixed_point_scale | ( | binary_operator | op, |
int32_t | left_scale, | ||
int32_t | right_scale | ||
) |
根据给定的二元运算符 op
计算 fixed_point
数值的 scale
。
op | 用于两个 fixed_point 数值的 binary_operator |
left_scale | 左侧 fixed_point 数值的 Scale |
right_scale | 右侧 fixed_point 数值的 Scale |
fixed_point
数值的 scale
|
inlineconstexpr |
检查二元运算类型是否具有通用类型。
定义位于行 140 文件 binaryop.hpp。