unary.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2025, 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/fixed_point/detail/floating_conversion.hpp>
21 #include <cudf/types.hpp>
23 #include <cudf/utilities/export.hpp>
26 
27 #include <memory>
28 
29 namespace CUDF_EXPORT cudf {
40 enum class unary_operator : int32_t {
41  SIN,
42  COS,
43  TAN,
44  ARCSIN,
45  ARCCOS,
46  ARCTAN,
47  SINH,
48  COSH,
49  TANH,
50  ARCSINH,
51  ARCCOSH,
52  ARCTANH,
53  EXP,
54  LOG,
55  SQRT,
56  CBRT,
57  CEIL,
58  FLOOR,
59  ABS,
60  RINT,
61  BIT_COUNT,
62  BIT_INVERT,
63  NOT,
64  NEGATE,
65 };
66 
79 std::unique_ptr<cudf::column> unary_operation(
80  cudf::column_view const& input,
84 
96 std::unique_ptr<cudf::column> is_null(
97  cudf::column_view const& input,
100 
112 std::unique_ptr<cudf::column> is_valid(
113  cudf::column_view const& input,
116 
130 std::unique_ptr<column> cast(
131  column_view const& input,
132  data_type out_type,
135 
144 bool is_supported_cast(data_type from, data_type to) noexcept;
145 
159 std::unique_ptr<column> is_nan(
160  cudf::column_view const& input,
163 
178 std::unique_ptr<column> is_not_nan(
179  cudf::column_view const& input,
182  // end of group
184 } // namespace CUDF_EXPORT cudf
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Indicator for the logical data type of an element in a column.
Definition: types.hpp:249
Class definition for fixed point data type.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
unary_operator
Types of unary operations that can be performed on data.
Definition: unary.hpp:40
std::unique_ptr< cudf::column > is_valid(cudf::column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Creates a column of type_id::BOOL8 elements where for every element in input true indicates the value...
std::unique_ptr< cudf::column > is_null(cudf::column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Creates a column of type_id::BOOL8 elements where for every element in input true indicates the value...
bool is_supported_cast(data_type from, data_type to) noexcept
Check if a cast between two datatypes is supported.
std::unique_ptr< column > is_not_nan(cudf::column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Creates a column of type_id::BOOL8 elements indicating the absence of NaN values in a column of float...
std::unique_ptr< column > cast(column_view const &input, data_type out_type, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Casts data from dtype specified in input to dtype specified in output.
std::unique_ptr< cudf::column > unary_operation(cudf::column_view const &input, cudf::unary_operator op, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Performs unary op on all values in column.
std::unique_ptr< column > is_nan(cudf::column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Creates a column of type_id::BOOL8 elements indicating the presence of NaN values in a column of floa...
@ BIT_COUNT
Count the number of bits set to 1 of an integer value.
@ NEGATE
Unary negation (-), only for signed numeric and duration types.
cuDF interfaces
Definition: host_udf.hpp:37
Type declarations for libcudf.