unary.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <cudf/fixed_point/detail/floating_conversion.hpp>
10 #include <cudf/types.hpp>
12 #include <cudf/utilities/export.hpp>
15 
16 #include <memory>
17 
23 namespace CUDF_EXPORT cudf {
32 enum class unary_operator : int32_t {
33  SIN,
34  COS,
35  TAN,
36  ARCSIN,
37  ARCCOS,
38  ARCTAN,
39  SINH,
40  COSH,
41  TANH,
42  ARCSINH,
43  ARCCOSH,
44  ARCTANH,
45  EXP,
46  LOG,
47  SQRT,
48  CBRT,
49  CEIL,
50  FLOOR,
51  ABS,
52  RINT,
53  BIT_COUNT,
54  BIT_INVERT,
55  NOT,
56  NEGATE,
57 };
58 
71 std::unique_ptr<cudf::column> unary_operation(
72  cudf::column_view const& input,
76 
88 std::unique_ptr<cudf::column> is_null(
89  cudf::column_view const& input,
92 
104 std::unique_ptr<cudf::column> is_valid(
105  cudf::column_view const& input,
108 
122 std::unique_ptr<column> cast(
123  column_view const& input,
124  data_type out_type,
127 
136 bool is_supported_cast(data_type from, data_type to) noexcept;
137 
151 std::unique_ptr<column> is_nan(
152  cudf::column_view const& input,
155 
170 std::unique_ptr<column> is_not_nan(
171  cudf::column_view const& input,
174  // end of group
176 } // 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:278
APIs for querying the default CUDA stream and per-thread default stream status.
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::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:32
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.
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:26
Type traits for classifying and querying properties of cudf column and scalar types.
Type declarations for libcudf.