文件 | |
文件 | types.hpp |
libcudf 的类型声明。 | |
文件 | traits.cuh |
文件 | traits.hpp |
类 | |
结构体 | cudf::order_info |
指示一组值的排序方式。 更多... | |
类 | cudf::data_type |
列中元素的逻辑数据类型指示符。 更多... | |
结构体 | cudf::is_convertible< From, To > |
结构体 | cudf::is_convertible< cudf::detail::timestamp< Duration1 >, cudf::detail::timestamp< Duration2 > > |
宏 | |
#define | CUDF_ENABLE_IF(...) cuda::std::enable_if_t<(__VA_ARGS__)>* = nullptr |
一个方便的宏,用于将 SFINAE 用作未命名的模板参数。 更多... | |
类型别名 | |
using | cudf::size_type = int32_t |
列和表的行索引类型。 | |
using | cudf::bitmask_type = uint32_t |
位掩码类型,存储为 32 位无符号整数。 | |
using | cudf::valid_type = uint8_t |
主机内存中的有效类型。 | |
using | cudf::thread_index_type = int64_t |
内核中的线程索引类型。 | |
using | cudf::char_utf8 = uint32_t |
UTF-8 字符是 1-4 字节。 | |
template<typename... > | |
using | cudf::void_t = void |
实用元函数,将任何类型序列映射到 void 类型。 | |
template<typename L , typename R > | |
using | cudf::less_comparable = decltype(cuda::std::declval< L >()< cuda::std::declval< R >()) |
检查两个类型是否可以使用小于运算符(即 <)进行比较。 | |
template<typename L , typename R > | |
using | cudf::greater_comparable = decltype(cuda::std::declval< L >() > cuda::std::declval< R >()) |
检查两个类型是否可以使用大于运算符(即 >)进行比较。 | |
template<typename L , typename R > | |
using | cudf::equality_comparable = decltype(cuda::std::declval< L >()==cuda::std::declval< R >()) |
检查两个类型是否可以使用等于运算符(即 ==)进行比较。 | |
template<typename... Ts> | |
using | cudf::has_common_type = typename detail::has_common_type_impl< void, Ts... >::type |
检查类型是否具有共同类型。 | |
template<typename T > | |
using | cudf::is_timestamp_t = cuda::std::disjunction< cuda::std::is_same< cudf::timestamp_D, T >, cuda::std::is_same< cudf::timestamp_h, T >, cuda::std::is_same< cudf::timestamp_m, T >, cuda::std::is_same< cudf::timestamp_s, T >, cuda::std::is_same< cudf::timestamp_ms, T >, cuda::std::is_same< cudf::timestamp_us, T >, cuda::std::is_same< cudf::timestamp_ns, T > > |
检查类型是否是时间戳类型。 | |
template<typename T > | |
using | cudf::is_duration_t = cuda::std::disjunction< cuda::std::is_same< cudf::duration_D, T >, cuda::std::is_same< cudf::duration_h, T >, cuda::std::is_same< cudf::duration_m, T >, cuda::std::is_same< cudf::duration_s, T >, cuda::std::is_same< cudf::duration_ms, T >, cuda::std::is_same< cudf::duration_us, T >, cuda::std::is_same< cudf::duration_ns, T > > |
检查类型是否是持续时间类型。 | |
函数 | |
template<typename T > | |
size_type | cudf::distance (T f, T l) |
类似于 std::distance ,但返回 cudf::size_type 并执行 static_cast 更多... | |
constexpr bool | cudf::operator== (data_type const &lhs, data_type const &rhs) |
比较两个 data_type 对象是否相等。 更多... | |
bool | cudf::operator!= (data_type const &lhs, data_type const &rhs) |
比较两个 data_type 对象是否不相等。 更多... | |
std::size_t | cudf::size_of (data_type t) |
返回指定 data_type 元素的字节大小。 更多... | |
template<typename T > | |
constexpr bool | cudf::has_atomic_support () |
指示类型 T 是否支持原子操作。 更多... | |
constexpr bool | cudf::has_atomic_support (data_type type) |
指示 type 是否支持原子操作。 更多... | |
template<typename L , typename R > | |
constexpr bool | cudf::is_relationally_comparable () |
指示类型 L 和 R 的对象是否可以进行关系比较。 更多... | |
bool | cudf::is_relationally_comparable (data_type type) |
检查 data_type type 是否支持关系比较。 更多... | |
template<typename L , typename R > | |
constexpr bool | cudf::is_equality_comparable () |
指示类型 L 和 R 的对象是否可以比较相等性。 更多... | |
bool | cudf::is_equality_comparable (data_type type) |
检查 data_type type 是否支持相等性比较。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_numeric () |
指示类型 T 是否为数值类型。 更多... | |
bool | cudf::is_numeric (data_type type) |
指示 type 是否为数值 data_type 。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_index_type () |
指示类型 T 是否为索引类型。 更多... | |
bool | cudf::is_index_type (data_type type) |
指示类型 type 是否为索引类型。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_signed () |
指示类型 T 是否为有符号数值类型。 更多... | |
bool | cudf::is_signed (data_type type) |
指示 type 是否为有符号数值 data_type 。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_unsigned () |
指示类型 T 是否为无符号数值类型。 更多... | |
bool | cudf::is_unsigned (data_type type) |
指示 type 是否为无符号数值 data_type 。 更多... | |
template<typename Iterator > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_signed_iterator () |
指示 Iterator 值类型是否为无符号类型。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_integral () |
指示类型 T 是否为整型。 更多... | |
bool | cudf::is_integral (data_type type) |
指示 type 是否为整型 data_type 。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_integral_not_bool () |
指示类型 T 是否为整型但非布尔型。 更多... | |
bool | cudf::is_integral_not_bool (data_type type) |
指示 type 是否为整型 data_type 且非 BOOL8。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_numeric_not_bool () |
指示类型 T 是否为数值类型但非布尔型。 更多... | |
bool | cudf::is_numeric_not_bool (data_type type) |
指示 type 是否为数值 data_type 且非 BOOL8。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_floating_point () |
指示类型 T 是否为浮点型。 更多... | |
bool | cudf::is_floating_point (data_type type) |
指示 type 是否为浮点型 data_type 。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_byte () |
指示 T 是否为 std::byte 类型。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_boolean () |
指示 T 是否为布尔类型。 更多... | |
bool | cudf::is_boolean (data_type type) |
指示 type 是否为布尔型 data_type 。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_timestamp () |
指示类型 T 是否为时间戳类型。 更多... | |
bool | cudf::is_timestamp (data_type type) |
指示 type 是否为时间戳 data_type 。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_fixed_point () |
指示类型 T 是否为定点类型。 更多... | |
bool | cudf::is_fixed_point (data_type type) |
指示 type 是否为定点 data_type 。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_duration () |
指示类型 T 是否为持续时间类型。 更多... | |
bool | cudf::is_duration (data_type type) |
指示 type 是否为持续时间 data_type 。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_chrono () |
指示类型 T 是否为 Chrono 类型。 更多... | |
bool | cudf::is_chrono (data_type type) |
指示 type 是否为 Chrono data_type 。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_rep_layout_compatible () |
指示 T 是否与其“表示”类型布局兼容。 更多... | |
template<typename T > | |
constexpr bool | cudf::is_dictionary () |
指示类型 T 是否为字典类型。 更多... | |
bool | cudf::is_dictionary (data_type type) |
指示 type 是否为字典 data_type 。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_fixed_width () |
指示类型 T 的元素是否为固定宽度。 更多... | |
bool | cudf::is_fixed_width (data_type type) |
指示 type 的元素是否为固定宽度。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_compound () |
指示类型 T 是否为复合类型。 更多... | |
bool | cudf::is_compound (data_type type) |
指示 type 的元素是否为复合类型。 更多... | |
template<typename T > | |
constexpr CUDF_HOST_DEVICE bool | cudf::is_nested () |
指示 T 是否为嵌套类型。 更多... | |
bool | cudf::is_nested (data_type type) |
指示 type 是否为嵌套类型。 更多... | |
bool | cudf::is_bit_castable (data_type from, data_type to) |
指示 from 是否可以位转换为 to 。 更多... | |
变量 | |
template<typename... Ts> | |
constexpr bool | cudf::has_common_type_v = detail::has_common_type_impl<void, Ts...>::value |
has_common_type<>::value 的辅助变量模板。 | |
#define CUDF_ENABLE_IF | ( | ... | ) | cuda::std::enable_if_t<(__VA_ARGS__)>* = nullptr |
一个方便的宏,用于将 SFINAE 用作未命名的模板参数。
示例
定义于文件 traits.hpp 的 50 行。
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
识别列的逻辑元素类型。
size_type cudf::distance | ( | T | f, |
T | l | ||
) |
类似于 std::distance
,但返回 cudf::size_type
并执行 static_cast
T | 迭代器类型 |
f | “first”迭代器 |
l | “last”迭代器 |
|
inlineconstexpr |
|
inlineconstexpr |
指示 type
是否支持原子操作。
type | 要验证的 data_type |
type
支持原子操作type
不支持原子操作定义于文件 traits.cuh 的 60 行。
指示 from
是否可以位转换为 to
。
此转换基于 std::bit_cast。大小相同且可平凡复制的数据类型符合此转换条件。
参见 cudf::bit_cast()
,它在位转换类型之间转换时返回零拷贝 column_view
。
true
|
inlineconstexpr |
bool cudf::is_boolean | ( | data_type | type | ) |
|
inlineconstexpr |
指示 T
是否为 std::byte 类型。
T | 要验证的类型 |
type
为 std::bytetype
非 std::byte定义于文件 traits.hpp 的 391 行。
|
inlineconstexpr |
指示类型 T
是否为 Chrono 类型。
T | 要验证的类型 |
T
为持续时间或时间戳类型T
既非持续时间也非时间戳类型定义于文件 traits.hpp 的 501 行。
bool cudf::is_chrono | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 T
是否为复合类型。
元素为“复合”类型的 column
逻辑上是单个元素列,但具体实现时可能由两个或多个 column
组成。例如,STRING
列可能包含一个偏移量 column
和一个字符子 column
。
T | 要验证的类型 |
T
对应“复合”类型T
对应“简单”类型定义于文件 traits.hpp 的 602 行。
bool cudf::is_compound | ( | data_type | type | ) |
指示 type
的元素是否为复合类型。
元素为“复合”类型的 column
逻辑上是单个元素列,但具体实现时可能由两个或多个 column
组成。例如,STRING
列可能包含一个偏移量 column
和一个字符子 column
。
type | 要验证的 data_type |
type
为复合类型type
为简单类型
|
inlineconstexpr |
bool cudf::is_dictionary | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_duration | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 L
和 R
的对象是否可以比较相等性。 更多...
给定两个对象 L l
和 R r
,如果 l == r
是一个格式良好的表达式,则返回 true。
L | 第一个对象的类型 |
R | 第二个对象的类型 |
L
和 R
的对象可以比较相等性L
和 R
的对象不可比较定义于文件 traits.hpp 的 158 行。
bool cudf::is_equality_comparable | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_fixed_point | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 T
的元素是否为固定宽度。 更多...
固定宽度类型的元素都具有相同的字节大小。
T | 要验证的 C++ 类型 |
T
对应固定宽度元素类型T
对应可变宽度元素类型定义于文件 traits.hpp 的 569 行。
bool cudf::is_fixed_width | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_floating_point | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 T
是否为索引类型。 更多...
如果可以使用 T
类型的元素索引到列中,则类型 T
被视为索引类型。即,索引类型是整型,例如 'INT*'(除了 'bool')。
T | 要验证的类型 |
T
为索引类型T
非索引类型定义于文件 traits.hpp 的 210 行。
bool cudf::is_index_type | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_integral | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 T
是否为整型但非布尔型。 更多...
T | 要验证的类型 |
T
为整型但非 boolT
非整型或为 bool定义于文件 traits.hpp 的 319 行。
bool cudf::is_integral_not_bool | ( | data_type | type | ) |
|
inlineconstexpr |
指示 T
是否为嵌套类型。 更多...
“嵌套”类型与复合类型不同,它们可以拥有任意深度的同类型后代列表。字符串不是嵌套类型,但列表是。
T | 要验证的类型 |
定义于文件 traits.hpp 的 635 行。
bool cudf::is_nested | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_numeric | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 T
是否为数值类型但非布尔型。 更多...
T | 要验证的类型 |
T
为数值型但非 boolT
非数值型或为 bool定义于文件 traits.hpp 的 343 行。
bool cudf::is_numeric_not_bool | ( | data_type | type | ) |
|
inlineconstexpr |
指示类型 L
和 R
的对象是否可以进行关系比较。 更多...
给定两个对象 L l
和 R r
,如果 l < r
和 l > r
是格式良好的表达式,则返回 true。
L | 第一个对象的类型 |
R | 第二个对象的类型 |
L
和 R
的对象可以进行关系比较L
和 R
的对象不可比较定义于文件 traits.hpp 的 131 行。
bool cudf::is_relationally_comparable | ( | data_type | type | ) |
|
constexpr |
指示 T
是否与其“表示”类型布局兼容。 更多...
例如,在列中,decimal32
具体表示为单个 int32_t
,但 decimal32
类型本身包含整数表示和比例。因此,decimal32
与 int32_t
不 布局兼容。
再例如,duration_ns
与其具体 int64_t
表示类型不同,但它们布局兼容。
T
与其“表示”类型布局兼容,则为 true定义于文件 traits.hpp 的 531 行。
|
inlineconstexpr |
bool cudf::is_signed | ( | data_type | type | ) |
|
inlineconstexpr |
|
inlineconstexpr |
bool cudf::is_timestamp | ( | data_type | type | ) |
|
inlineconstexpr |
bool cudf::is_unsigned | ( | data_type | type | ) |
std::size_t cudf::size_of | ( | data_type | t | ) |
返回指定 data_type
元素的大小(字节)。
cudf::logic_error | 如果 is_fixed_width(element_type) == false |
t | 要获取大小的 data_type |
data_type
元素的字节大小。