19 #include <cudf/detail/device_scalar.hpp>
30 #include <string_view>
37 namespace CUDF_EXPORT
cudf {
54 virtual ~
scalar() =
default;
90 bool* validity_data();
97 [[nodiscard]]
bool const* validity_data() const;
143 template <
typename T>
145 static_assert(is_fixed_width<T>(),
"意外的非固定宽度类型。");
199 [[nodiscard]] T
const*
data()
const;
238 template <
typename T>
240 static_assert(is_numeric<T>(),
"意外的非数值类型。");
298 template <
typename T>
300 static_assert(is_fixed_point<T>(),
"意外的非 fixed_point 类型。");
537 [[nodiscard]]
char const*
data()
const;
549 template <
typename T>
551 static_assert(is_chrono<T>(),
"意外的非 chrono 类型");
610 template <
typename T>
613 static_assert(is_timestamp<T>(),
"意外的非 timestamp 类型");
646 template <
typename Duration2>
666 template <
typename T>
669 static_assert(is_duration<T>(),
"意外的非 duration 类型");
864 void assert_valid_size();
一个拥有类,用于表示设备内存中的时间戳/duration 值。
chrono_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
构造新的 chrono scalar 对象。
chrono_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从现有设备内存构造新的 chrono scalar 对象。
chrono_scalar(chrono_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个 chrono scalar 对象来构造新的 chrono scalar 对象。
chrono_scalar(chrono_scalar &&other)=default
chrono_scalar 的移动构造函数。
设备数据的一个非拥有、不可变视图,作为元素列,其中一些可能为 null,作为指标...
一个可包含 nullable 设备数据的容器,作为元素列。
rmm::device_scalar< T > _data
包含值的设备内存
fixed_width_scalar(fixed_width_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个 fixed-width scalar 对象来构造新的 fixed-width scalar 对象。
void set_value(T value, rmm::cuda_stream_view stream=cudf::get_default_stream())
设置标量的值。
T value(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
获取标量的值。
fixed_width_scalar(fixed_width_scalar &&other)=default
fixed_width_scalar 的移动构造函数。
fixed_width_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
构造新的固定宽度标量对象。
fixed_width_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从现有设备内存构造新的固定宽度标量对象。
T const * data() const
返回设备内存中值的常量原始指针。
一个拥有类,用于表示设备内存中的 duration 值。
rep_type count(rmm::cuda_stream_view stream)
返回 duration(以 tick 数表示)。
duration_scalar(duration_scalar &&other)=default
duration_scalar 的移动构造函数。
typename T::rep rep_type
duration 的底层表示类型。
duration_scalar(duration_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个 duration scalar 对象来构造新的 duration scalar 对象。
duration_scalar(rep_type value, bool is_valid, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 tick 数构造新的 duration scalar 对象。
一个拥有类,用于表示设备内存中的 fixed_point 数。
rmm::device_scalar< rep_type > _data
包含值的设备内存
fixed_point_scalar(fixed_point_scalar &&other)=default
fixed_point_scalar 的移动构造函数。
fixed_point_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 fixed_point 数构造新的 fixed_point scalar 对象。
fixed_point_scalar(rep_type value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从值和默认 0 比例构造新的 fixed_point scalar 对象。
fixed_point_scalar(rmm::device_scalar< rep_type > &&data, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从现有设备内存构造新的 fixed_point scalar 对象。
rep_type value(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
获取标量的值。
T value_type
fixed_point 数值的值类型。
fixed_point_scalar(rep_type value, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从已偏移的值和比例构造新的 fixed_point scalar 对象。
rep_type const * data() const
返回设备内存中值的常量原始指针。
T fixed_point_value(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
获取 decimal32、decimal64 或 decimal128。
rep_type * data()
返回设备内存中值的原始指针。
typename T::rep rep_type
fixed_point 数值的表示类型。
fixed_point_scalar(fixed_point_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 fixed_point scalar 对象。
column_view view() const
返回底层设备数据的非拥有、不可变视图。
list_scalar(list_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 list scalar 对象。
list_scalar(cudf::column_view const &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 column_view 构造新的 list scalar 对象。
list_scalar(list_scalar &&other)=default
list_scalar 的移动构造函数。
list_scalar(cudf::column &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从现有 column 构造新的 list scalar 对象。
numeric_scalar(rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从现有设备内存构造新的 numeric scalar 对象。
numeric_scalar(T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
构造新的 numeric scalar 对象。
numeric_scalar(numeric_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 numeric scalar 对象。
numeric_scalar(numeric_scalar &&other)=default
numeric_scalar 的移动构造函数。
scalar(scalar &&other)=default
scalar 的移动构造函数。
data_type type() const noexcept
返回 scalar 的逻辑值类型。
scalar(scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 scalar 对象。
scalar(data_type type, bool is_valid=false, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
构造新的 scalar 对象。
cudf::detail::device_scalar< bool > _is_valid
表示有效性的设备布尔值。
std::string to_string(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
以 host std::string 的形式获取 scalar 的值。
string_scalar(value_type const &source, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 string_view 构造新的 string scalar 对象。
string_scalar(rmm::device_scalar< value_type > &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从设备内存中的 string_view 构造新的 string scalar 对象。
size_type size() const
返回字符串的字节大小。
string_scalar(string_scalar &&other)=default
string_scalar 的移动构造函数。
string_scalar(string_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个 string_scalar 对象来构造新的 string scalar 对象。
string_scalar(rmm::device_buffer &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过移动现有字符串数据缓冲区构造新的 string scalar 对象。
string_scalar(std::string_view string, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
构造新的 string scalar 对象。
value_type value(rmm::cuda_stream_view stream=cudf::get_default_stream()) const
以 string_view 的形式获取 scalar 的值。
char const * data() const
返回设备内存中字符串的原始指针。
一个非拥有、不可变的设备数据视图,表示一个可变长度的 char 数组,该数组表示一个 UTF-8...
struct_scalar(host_span< column_view const > data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 column_views 的 host_span 构造新的 struct scalar 对象。
table_view view() const
返回底层设备数据的非拥有、不可变视图。
struct_scalar(table &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从设备内存中的现有 table 构造新的 struct scalar 对象。
struct_scalar(table_view const &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从 table_view 构造新的 struct scalar 对象。
struct_scalar(struct_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 struct scalar 对象。
struct_scalar(struct_scalar &&other)=default
struct_scalar 的移动构造函数。
一组大小相同的 cudf::column_view。
timestamp_scalar(timestamp_scalar &&other)=default
timestamp_scalar 的移动构造函数。
typename T::rep rep_type
时间戳的底层表示类型。
rep_type ticks_since_epoch(rmm::cuda_stream_view stream)
返回自 UNIX 纪元以来的时长(以 ticks 数表示)。
timestamp_scalar(Duration2 const &value, bool is_valid, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
从可转换为 T::duration 的时长构造新的 timestamp scalar 对象。
timestamp_scalar(timestamp_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
通过深度复制另一个对象来构造新的 timestamp scalar 对象。
rmm::cuda_stream_view const get_default_stream()
获取当前默认流。
scale_type
fixed_point 的比例类型。
rmm::device_async_resource_ref get_current_device_resource_ref()
获取当前设备内存资源引用。
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
int32_t size_type
用于 columns 和 tables 的行索引类型。
具有简化功能集的 C++20 std::span。