int_cast.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <cudf/column/column.hpp>
9 #include <cudf/types.hpp>
11 
12 #include <optional>
13 
14 namespace CUDF_EXPORT cudf {
15 namespace strings {
25 enum class endian : bool { BIG, LITTLE };
26 
66 std::unique_ptr<column> cast_to_integer(
67  strings_column_view const& input,
68  data_type output_type,
69  endian swap = endian::LITTLE,
72 
102 std::unique_ptr<column> cast_from_integer(
103  column_view const& integers,
104  endian swap = endian::LITTLE,
107 
118 std::optional<cudf::data_type> integer_cast_type(
120  // end of doxygen group
122 } // namespace strings
123 } // 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:238
Given a column-view of strings type, an instance of this class provides a wrapper on this compound co...
Class definition for cudf::column.
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.
detail::cccl_async_resource_ref< cuda::mr::resource_ref< cuda::mr::device_accessible > > device_async_resource_ref
std::unique_ptr< column > cast_to_integer(strings_column_view const &input, data_type output_type, endian swap=endian::LITTLE, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a new integer numeric column encoded to represent the strings in the input column.
std::unique_ptr< column > cast_from_integer(column_view const &integers, endian swap=endian::LITTLE, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a new strings column converting the encoded integer values from the provided column into stri...
endian
Configures whether casting also byte swaps.
Definition: int_cast.hpp:25
std::optional< cudf::data_type > integer_cast_type(strings_column_view const &input, rmm::cuda_stream_view stream=cudf::get_default_stream())
Returns the minimum integer type required to encode the input column.
cuDF interfaces
Definition: host_udf.hpp:26
Class definition for cudf::strings_column_view.
Type declarations for libcudf.