libcudf
24.02.00
|
Files | |
file | binaryop.hpp |
Column APIs for binary ops. | |
Enumerations | |
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_MAX , cudf::NULL_MIN , cudf::GENERIC_BINARY , cudf::NULL_LOGICAL_AND , cudf::NULL_LOGICAL_OR , cudf::INVALID_BINARY } |
Types of binary operations that can be performed on data. More... | |
|
strong |
Types of binary operations that can be performed on data.
Definition at line 38 of file 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::mr::device_memory_resource * | mr = rmm::mr::get_current_device_resource() |
||
) |
Performs a binary operation between two columns.
The output contains the result of op(lhs[i], rhs[i])
for all 0 <= i < lhs.size()
Regardless of the operator, the validity of the output value is the logical AND of the validity of the two operands except NullMin and NullMax (logical OR).
lhs | The left operand column |
rhs | The right operand column |
op | The binary operator |
output_type | The desired data type of the output column |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
output_type
type containing the result of the binary operation cudf::logic_error | if lhs and rhs are different sizes |
cudf::logic_error | if output_type dtype isn't boolean for comparison and logical operations. |
cudf::logic_error | if output_type dtype isn't fixed-width |
cudf::data_type_error | if the operation is not supported for the types of lhs and 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::mr::device_memory_resource * | mr = rmm::mr::get_current_device_resource() |
||
) |
Performs a binary operation between two columns using a user-defined PTX function.
The output contains the result of op(lhs[i], rhs[i])
for all 0 <= i < lhs.size()
Regardless of the operator, the validity of the output value is the logical AND of the validity of the two operands
lhs | The left operand column |
rhs | The right operand column |
ptx | String containing the PTX of a binary function |
output_type | The desired data type of the output column. It is assumed that output_type is compatible with the output data type of the function in the PTX code |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
output_type
type containing the result of the binary operation cudf::logic_error | if lhs and rhs are different sizes |
cudf::logic_error | if lhs and rhs dtypes aren't numeric |
cudf::logic_error | if output_type dtype isn't numeric |
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::mr::device_memory_resource * | mr = rmm::mr::get_current_device_resource() |
||
) |
Performs a binary operation between a column and a scalar.
The output contains the result of op(lhs[i], rhs)
for all 0 <= i < lhs.size()
The column elements are the left operand and the scalar is the right operand. This distinction is significant in case of non-commutative binary operations
Regardless of the operator, the validity of the output value is the logical AND of the validity of the two operands except NullMin and NullMax (logical OR).
lhs | The left operand column |
rhs | The right operand scalar |
op | The binary operator |
output_type | The desired data type of the output column |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
output_type
type containing the result of the binary operation cudf::logic_error | if output_type dtype isn't fixed-width |
cudf::logic_error | if output_type dtype isn't boolean for comparison and logical operations. |
cudf::data_type_error | if the operation is not supported for the types of lhs and 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::mr::device_memory_resource * | mr = rmm::mr::get_current_device_resource() |
||
) |
Performs a binary operation between a scalar and a column.
The output contains the result of op(lhs, rhs[i])
for all 0 <= i < rhs.size()
The scalar is the left operand and the column elements are the right operand. This distinction is significant in case of non-commutative binary operations
Regardless of the operator, the validity of the output value is the logical AND of the validity of the two operands except NullMin and NullMax (logical OR).
lhs | The left operand scalar |
rhs | The right operand column |
op | The binary operator |
output_type | The desired data type of the output column |
stream | CUDA stream used for device memory operations and kernel launches |
mr | Device memory resource used to allocate the returned column's device memory |
output_type
type containing the result of the binary operation cudf::logic_error | if output_type dtype isn't fixed-width |
cudf::logic_error | if output_type dtype isn't boolean for comparison and logical operations. |
cudf::data_type_error | if the operation is not supported for the types of lhs and rhs |
cudf::data_type cudf::binary_operation_fixed_point_output_type | ( | binary_operator | op, |
cudf::data_type const & | lhs, | ||
cudf::data_type const & | rhs | ||
) |
Computes the data_type
for a fixed_point
number based on given binary operator op
op | The binary_operator used for two fixed_point numbers |
lhs | cudf::data_type of left fixed_point number |
rhs | cudf::data_type of right fixed_point number |
cudf::data_type
of the computed fixed_point
number int32_t cudf::binary_operation_fixed_point_scale | ( | binary_operator | op, |
int32_t | left_scale, | ||
int32_t | right_scale | ||
) |
Computes the scale
for a fixed_point
number based on given binary operator op
op | The binary_operator used for two fixed_point numbers |
left_scale | Scale of left fixed_point number |
right_scale | Scale of right fixed_point number |
scale
of the computed fixed_point
number