binaryop.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/column/column.hpp>
20 #include <cudf/scalar/scalar.hpp>
21 
22 #include <memory>
23 
24 namespace cudf {
25 
36 enum class binary_operator : int32_t {
37  ADD,
38  SUB,
39  MUL,
40  DIV,
41  TRUE_DIV,
42  FLOOR_DIV,
43  MOD,
45  PMOD,
46  PYMOD,
49  POW,
50  LOG_BASE,
51  ATAN2,
52  SHIFT_LEFT,
53  SHIFT_RIGHT,
54  SHIFT_RIGHT_UNSIGNED,
55  BITWISE_AND,
57  BITWISE_OR,
58  BITWISE_XOR,
59  LOGICAL_AND,
60  LOGICAL_OR,
61  EQUAL,
62  NOT_EQUAL,
63  LESS,
64  GREATER,
65  LESS_EQUAL,
66  GREATER_EQUAL,
67  NULL_EQUALS,
68  NULL_MAX,
70  NULL_MIN,
72  GENERIC_BINARY,
74  NULL_LOGICAL_AND,
76  NULL_LOGICAL_OR,
80 };
102 std::unique_ptr<column> binary_operation(
103  scalar const& lhs,
104  column_view const& rhs,
105  binary_operator op,
106  data_type output_type,
107  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
108 
130 std::unique_ptr<column> binary_operation(
131  column_view const& lhs,
132  scalar const& rhs,
133  binary_operator op,
134  data_type output_type,
135  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
136 
157 std::unique_ptr<column> binary_operation(
158  column_view const& lhs,
159  column_view const& rhs,
160  binary_operator op,
161  data_type output_type,
162  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
163 
186 std::unique_ptr<column> binary_operation(
187  column_view const& lhs,
188  column_view const& rhs,
189  std::string const& ptx,
190  data_type output_type,
191  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
192 
202  int32_t left_scale,
203  int32_t right_scale);
204 
214  cudf::data_type const& lhs,
215  cudf::data_type const& rhs);
216  // end of group
218 } // namespace cudf
cudf::binary_operation
std::unique_ptr< column > binary_operation(scalar const &lhs, column_view const &rhs, binary_operator op, data_type output_type, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Performs a binary operation between a scalar and a column.
cudf::binary_operator::ADD
@ ADD
operator +
scalar.hpp
Class definitions for cudf::scalar.
column.hpp
Class definition for cudf::column.
cudf::binary_operation_fixed_point_output_type
cudf::data_type 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
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:300
cudf::binary_operation_fixed_point_scale
int32_t 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
cudf::scalar
An owning class to represent a singular value.
Definition: scalar.hpp:46
cudf::data_type
Indicator for the logical data type of an element in a column.
Definition: types.hpp:240
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::weak_ordering::LESS
@ LESS
Indicates a is less than (ordered before) b
cudf::binary_operator
binary_operator
Types of binary operations that can be performed on data.
Definition: binaryop.hpp:36
rmm::mr::device_memory_resource