int_cast.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
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 
19 namespace CUDF_EXPORT cudf {
20 namespace strings {
29 enum class endian : bool { BIG, LITTLE };
30 
70 std::unique_ptr<column> cast_to_integer(
71  strings_column_view const& input,
72  data_type output_type,
73  endian swap = endian::LITTLE,
76 
106 std::unique_ptr<column> cast_from_integer(
107  column_view const& integers,
108  endian swap = endian::LITTLE,
111 
122 std::optional<cudf::data_type> integer_cast_type(
124  // end of doxygen group
126 } // namespace strings
127 } // 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:286
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.
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:29
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.
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:26
Class definition for cudf::strings_column_view.
Type declarations for libcudf.