type_dispatcher.hpp
转到此文件的文档。
1 /*
2  * Copyright (c) 2019-2025, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * https://apache.ac.cn/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 #include <cudf/types.hpp>
21 #include <cudf/utilities/error.hpp>
25 
26 #include <string>
27 
33 // 将 C++ 类型映射到其对应的 cudf::type_id
55 template <typename T>
57 {
58  return type_id::EMPTY;
59 };
60 
65 // 提供一个可调用对象,用于将具体的 C++ 类型映射到其字符串名称。
71 struct type_to_name_impl {
72  template <typename T>
73  inline std::string operator()()
74  {
75  return "void";
76  }
77 };
78 
79 template <cudf::type_id t>
80 struct id_to_type_impl {
81  using type = void;
91 // 一个 trait,将 cudf::type_id 映射到相应的 C++ 类型。成员 `type` 是与 `cudf::type_id` 模板参数 `Id` 相对应的 C++ 类型。
92 template <cudf::type_id Id>
93 using id_to_type = typename id_to_type_impl<Id>::type;
108 // clang-format off
109 // “返回”使用 cudf::column 时存储在设备上的相应类型。
110 template <typename T>
111 using device_storage_type_t =
112  std::conditional_t<std::is_same_v<numeric::decimal32, T>, int32_t,
113  std::conditional_t<std::is_same_v<numeric::decimal64, T>, int64_t,
114  std::conditional_t<std::is_same_v<numeric::decimal128, T>, __int128_t, T>>>;
115 // clang-format on
131 // 将 C++ 类型映射到其对应的 cudf::type_id
132 template <typename T>
133 constexpr inline type_id type_to_id()
134 {
135  return base_type_to_id<std::remove_cv_t<T>>();
136 }
144 // 用于定义具体 C++ 类型和 cudf::type_id 枚举之间映射的宏。定义了 base_type_to_id 和 type_to_name_impl::operator() 的特化版本,并为给定的 `Id` 定义了 id_to_type_impl 的特化版本。
145 #ifndef CUDF_TYPE_MAPPING
146 #define CUDF_TYPE_MAPPING(Type, Id) \
147  template <> \
148  constexpr inline type_id base_type_to_id<Type>() \
149  { \
150  return Id; \
151  } \
152  template <> \
153  inline std::string type_to_name_impl::operator()<Type>() \
154  { \
155  return CUDF_STRINGIFY(Type); \
156  } \
157  template <> \
158  struct id_to_type_impl<Id> { \
159  using type = Type; \
160  };
161 #endif
162 // 定义了所有 C++ 类型及其对应的 `cudf::type_id` 值之间的映射。
163 CUDF_TYPE_MAPPING(int8_t, type_id::INT8)
164 CUDF_TYPE_MAPPING(int16_t, type_id::INT16)
165 CUDF_TYPE_MAPPING(int32_t, type_id::INT32)
166 CUDF_TYPE_MAPPING(int64_t, type_id::INT64)
167 CUDF_TYPE_MAPPING(uint8_t, type_id::UINT8)
168 CUDF_TYPE_MAPPING(uint16_t, type_id::UINT16)
169 CUDF_TYPE_MAPPING(uint32_t, type_id::UINT32)
170 CUDF_TYPE_MAPPING(uint64_t, type_id::UINT64)
171 CUDF_TYPE_MAPPING(float, type_id::FLOAT32)
172 CUDF_TYPE_MAPPING(double, type_id::FLOAT64)
173 CUDF_TYPE_MAPPING(bool, type_id::BOOL8)
174 CUDF_TYPE_MAPPING(cudf::timestamp_D, type_id::TIMESTAMP_DAYS)
175 CUDF_TYPE_MAPPING(cudf::timestamp_s, type_id::TIMESTAMP_SECONDS)
176 CUDF_TYPE_MAPPING(cudf::timestamp_ms, type_id::TIMESTAMP_MILLISECONDS)
177 CUDF_TYPE_MAPPING(cudf::timestamp_us, type_id::TIMESTAMP_MICROSECONDS)
178 CUDF_TYPE_MAPPING(cudf::timestamp_ns, type_id::TIMESTAMP_NANOSECONDS)
179 CUDF_TYPE_MAPPING(cudf::duration_D, type_id::DURATION_DAYS)
180 CUDF_TYPE_MAPPING(cudf::duration_s, type_id::DURATION_SECONDS)
181 CUDF_TYPE_MAPPING(cudf::duration_ms, type_id::DURATION_MILLISECONDS)
182 CUDF_TYPE_MAPPING(cudf::duration_us, type_id::DURATION_MICROSECONDS)
183 CUDF_TYPE_MAPPING(cudf::duration_ns, type_id::DURATION_NANOSECONDS)
184 CUDF_TYPE_MAPPING(cudf::dictionary32, type_id::DICTIONARY32)
185 CUDF_TYPE_MAPPING(cudf::string_view, type_id::STRING)
186 CUDF_TYPE_MAPPING(cudf::list_view, type_id::LIST)
187 CUDF_TYPE_MAPPING(numeric::decimal32, type_id::DECIMAL32)
188 CUDF_TYPE_MAPPING(numeric::decimal64, type_id::DECIMAL64)
189 CUDF_TYPE_MAPPING(numeric::decimal128, type_id::DECIMAL128)
190 CUDF_TYPE_MAPPING(cudf::struct_view, type_id::STRUCT)
191 
192 
200 // CUDF_TYPE_MAPPING(char,INT8) 会导致 id_to_type_impl 重复定义
201 template <>
202 constexpr inline type_id base_type_to_id<char>()
203 {
204  return type_id::INT8;
205 }
215 // 助手函数,用于测试给定类型是否与给定 type_id 的设备存储类型匹配
216 template <typename T>
218 {
219  return (id == type_id::DECIMAL32 && std::is_same_v<T, int32_t>) ||
220  (id == type_id::DECIMAL64 && std::is_same_v<T, int64_t>) ||
221  (id == type_id::DECIMAL128 && std::is_same_v<T, __int128_t>) || id == type_to_id<T>();
222 }
231 // 一个 trait,将 cudf::type_id 映射到用于设备存储的相应 C++ 类型。成员 `type` 是与 `cudf::type_id` 模板参数 `Id` 相对应的用于设备存储的 C++ 类型。
232 template <cudf::type_id Id>
235 };
236 
237 template <typename T>
238 struct type_to_scalar_type_impl {
239  using ScalarType = cudf::scalar;
240 };
247 // 用于为数值类型定义 cudf::numeric_scalar 模板类的标量类型和标量设备类型的宏。
248 #ifndef MAP_NUMERIC_SCALAR
249 #define MAP_NUMERIC_SCALAR(Type) \
250  template <> \
251  struct type_to_scalar_type_impl<Type> { \
252  using ScalarType = cudf::numeric_scalar<Type>; \
253  using ScalarDeviceType = cudf::numeric_scalar_device_view<Type>; \
254  };
255 #endif
256 
257 MAP_NUMERIC_SCALAR(int8_t)
258 MAP_NUMERIC_SCALAR(int16_t)
259 MAP_NUMERIC_SCALAR(int32_t)
260 MAP_NUMERIC_SCALAR(int64_t)
261 MAP_NUMERIC_SCALAR(__int128_t)
262 MAP_NUMERIC_SCALAR(uint8_t)
263 MAP_NUMERIC_SCALAR(uint16_t)
264 MAP_NUMERIC_SCALAR(uint32_t)
265 MAP_NUMERIC_SCALAR(uint64_t)
266 MAP_NUMERIC_SCALAR(float)
267 MAP_NUMERIC_SCALAR(double)
268 MAP_NUMERIC_SCALAR(bool)
269 
270 template <>
271 struct type_to_scalar_type_impl<std::string> {
272  using ScalarType = cudf::string_scalar;
273  using ScalarDeviceType = cudf::string_scalar_device_view;
274 };
275 
276 template <>
277 struct type_to_scalar_type_impl<cudf::string_view> {
278  using ScalarType = cudf::string_scalar;
279  using ScalarDeviceType = cudf::string_scalar_device_view;
280 };
281 
282 template <>
283 struct type_to_scalar_type_impl<numeric::decimal32> {
286 };
287 
288 template <>
289 struct type_to_scalar_type_impl<numeric::decimal64> {
292 };
293 
294 template <>
295 struct type_to_scalar_type_impl<numeric::decimal128> {
298 };
299 
300 template <> // TODO: 这是针对 make_pair_iterator 的临时解决方案
301 struct type_to_scalar_type_impl<cudf::dictionary32> {
302  using ScalarType = cudf::numeric_scalar<int32_t>;
303  using ScalarDeviceType = cudf::numeric_scalar_device_view<int32_t>;
304 };
305 
306  // TODO: 这是为了让编译工作。列表标量将在以后实现。
307 template <>
308 struct type_to_scalar_type_impl<cudf::list_view> {
309  using ScalarType = cudf::list_scalar;
310  // using ScalarDeviceType = cudf::list_scalar_device_view;
311 };
312 
313 template <> // TODO: 同上,类同。// CALEB: TODO!
314 struct type_to_scalar_type_impl<cudf::struct_view> {
315  using ScalarType = cudf::struct_scalar;
316  // using ScalarDeviceType = cudf::struct_scalar_device_view; // CALEB: TODO!
317 };
324 // 用于为时间戳类型定义 cudf::timestamp_scalar 模板类的标量类型和标量设备类型的宏。
325 #ifndef MAP_TIMESTAMP_SCALAR
326 #define MAP_TIMESTAMP_SCALAR(Type) \
327  template <> \
328  struct type_to_scalar_type_impl<Type> { \
329  using ScalarType = cudf::timestamp_scalar<Type>; \
330  using ScalarDeviceType = cudf::timestamp_scalar_device_view<Type>; \
331  };
332 #endif
333 
339 
345 // 用于为时长类型定义 cudf::duration_scalar 模板类的标量类型和标量设备类型的宏。
346 #ifndef MAP_DURATION_SCALAR
347 #define MAP_DURATION_SCALAR(Type) \
348  template <> \
349  struct type_to_scalar_type_impl<Type> { \
350  using ScalarType = cudf::duration_scalar<Type>; \
351  using ScalarDeviceType = cudf::duration_scalar_device_view<Type>; \
352  };
353 #endif
354 
360 
365 // 将 C++ 类型映射到用于持有其值的标量类型。
366 template <typename T>
368 
373 // 将 C++ 类型映射到用于持有其值的标量设备类型。
374 template <typename T>
375 using scalar_device_type_t = typename type_to_scalar_type_impl<T>::ScalarDeviceType;
468 // 此 pragma 禁用了一个编译器警告,该警告抱怨从这个 __host__ __device__ 函数调用 __host__ functor 是有效用法。
469 
470 #ifdef __CUDACC__
471 #pragma nv_exec_check_disable
472 #endif
473 // 根据指定的 cudf::data_type 的 ID 调用带有类型实例化的 operator() 模板...
474 template <template <cudf::type_id> typename IdTypeMap = id_to_type_impl,
475  typename Functor,
476  typename... Ts>
477 CUDF_HOST_DEVICE __forceinline__ constexpr decltype(auto) type_dispatcher(cudf::data_type dtype,
478  Functor f,
479  Ts&&... args)
480 {
481  switch (dtype.id()) {
482  case type_id::INT8
483  return f.template operator()<typename IdTypeMap<type_id::INT8>::type>(
484  std::forward<Ts>(args)...);
485  case type_id::INT16
486  return f.template operator()<typename IdTypeMap<type_id::INT16>::type>(
487  std::forward<Ts>(args)...);
488  case type_id::INT32
489  return f.template operator()<typename IdTypeMap<type_id::INT32>::type>(
490  std::forward<Ts>(args)...);
491  case type_id::INT64
492  return f.template operator()<typename IdTypeMap<type_id::INT64>::type>(
493  std::forward<Ts>(args)...);
494  case type_id::UINT8
495  return f.template operator()<typename IdTypeMap<type_id::UINT8>::type>(
496  std::forward<Ts>(args)...);
497  case type_id::UINT16
498  return f.template operator()<typename IdTypeMap<type_id::UINT16>::type>(
499  std::forward<Ts>(args)...);
500  case type_id::UINT32
501  return f.template operator()<typename IdTypeMap<type_id::UINT32>::type>(
502  std::forward<Ts>(args)...);
503  case type_id::UINT64
504  return f.template operator()<typename IdTypeMap<type_id::UINT64>::type>(
505  std::forward<Ts>(args)...);
506  case type_id::FLOAT32
507  return f.template operator()<typename IdTypeMap<type_id::FLOAT32>::type>(
508  std::forward<Ts>(args)...);
509  case type_id::FLOAT64
510  return f.template operator()<typename IdTypeMap<type_id::FLOAT64>::type>(
511  std::forward<Ts>(args)...);
512  case type_id::BOOL8
513  return f.template operator()<typename IdTypeMap<type_id::BOOL8>::type>(
514  std::forward<Ts>(args)...);
515  case type_id::TIMESTAMP_DAYS
516  return f.template operator()<typename IdTypeMap<type_id::TIMESTAMP_DAYS>::type>(
517  std::forward<Ts>(args)...);
518  case type_id::TIMESTAMP_SECONDS
519  return f.template operator()<typename IdTypeMap<type_id::TIMESTAMP_SECONDS>::type>(
520  std::forward<Ts>(args)...);
521  case type_id::TIMESTAMP_MILLISECONDS
522  return f.template operator()<typename IdTypeMap<type_id::TIMESTAMP_MILLISECONDS>::type>(
523  std::forward<Ts>(args)...);
524  case type_id::TIMESTAMP_MICROSECONDS
525  return f.template operator()<typename IdTypeMap<type_id::TIMESTAMP_MICROSECONDS>::type>(
526  std::forward<Ts>(args)...);
527  case type_id::TIMESTAMP_NANOSECONDS
528  return f.template operator()<typename IdTypeMap<type_id::TIMESTAMP_NANOSECONDS>::type>(
529  std::forward<Ts>(args)...);
530  case type_id::DURATION_DAYS
531  return f.template operator()<typename IdTypeMap<type_id::DURATION_DAYS>::type>(
532  std::forward<Ts>(args)...);
533  case type_id::DURATION_SECONDS
534  return f.template operator()<typename IdTypeMap<type_id::DURATION_SECONDS>::type>(
535  std::forward<Ts>(args)...);
536  case type_id::DURATION_MILLISECONDS
537  return f.template operator()<typename IdTypeMap<type_id::DURATION_MILLISECONDS>::type>(
538  std::forward<Ts>(args)...);
539  case type_id::DURATION_MICROSECONDS
540  return f.template operator()<typename IdTypeMap<type_id::DURATION_MICROSECONDS>::type>(
541  std::forward<Ts>(args)...);
542  case type_id::DURATION_NANOSECONDS
543  return f.template operator()<typename IdTypeMap<type_id::DURATION_NANOSECONDS>::type>(
544  std::forward<Ts>(args)...);
545  case type_id::DICTIONARY32
546  return f.template operator()<typename IdTypeMap<type_id::DICTIONARY32>::type>(
547  std::forward<Ts>(args)...);
548  case type_id::STRING
549  return f.template operator()<typename IdTypeMap<type_id::STRING>::type>(
550  std::forward<Ts>(args)...);
551  case type_id::LIST
552  return f.template operator()<typename IdTypeMap<type_id::LIST>::type>(
553  std::forward<Ts>(args)...);
554  case type_id::DECIMAL32
555  return f.template operator()<typename IdTypeMap<type_id::DECIMAL32>::type>(
556  std::forward<Ts>(args)...);
557  case type_id::DECIMAL64
558  return f.template operator()<typename IdTypeMap<type_id::DECIMAL64>::type>(
559  std::forward<Ts>(args)...);
560  case type_id::DECIMAL128
561  return f.template operator()<typename IdTypeMap<type_id::DECIMAL128>::type>(
562  std::forward<Ts>(args)...);
563  case type_id::STRUCT
564  return f.template operator()<typename IdTypeMap<type_id::STRUCT>::type>(
565  std::forward<Ts>(args)...);
566  default: {
567 #ifndef __CUDA_ARCH__
568  CUDF_FAIL("无效的 type_id。");
569 #else
570  CUDF_UNREACHABLE("无效的 type_id。");
571 #endif
572  }
573  }
574 }
575 // @cond
576 namespace detail {
577 template <typename T1>
578 struct double_type_dispatcher_second_type {
579 #ifdef __CUDACC__
580 #pragma nv_exec_check_disable
581 #endif
582  template <typename T2, typename F, typename... Ts>
583  CUDF_HOST_DEVICE __forceinline__ decltype(auto) operator()(F&& f, Ts&&... args) const
584  {
585  return f.template operator()<T1, T2>(std::forward<Ts>(args)...);
586  }
587 };
588 
589 template <template <cudf::type_id> typename IdTypeMap>
590 struct double_type_dispatcher_first_type {
591 #ifdef __CUDACC__
592 #pragma nv_exec_check_disable
593 #endif
594  template <typename T1, typename F, typename... Ts>
595  CUDF_HOST_DEVICE __forceinline__ decltype(auto) operator()(cudf::data_type type2,
596  F&& f,
597  Ts&&... args) const
598  {
599  return type_dispatcher<IdTypeMap>(type2,
600  detail::double_type_dispatcher_second_type<T1>{},
601  std::forward<F>(f),
602  std::forward<Ts>(args)...);
603  }
604 };
605 } // namespace detail
606 // @endcond
623 // 将两个类型模板参数分派给一个可调用对象。
624 #ifdef __CUDACC__
625 #pragma nv_exec_check_disable
626 #endif
627 template <template <cudf::type_id> typename IdTypeMap = id_to_type_impl, typename F, typename... Ts>
628 CUDF_HOST_DEVICE __forceinline__ constexpr decltype(auto) double_type_dispatcher(
629  cudf::data_type type1, cudf::data_type type2, F&& f, Ts&&... args)
630 {
631  return type_dispatcher<IdTypeMap>(type1,
632  detail::double_type_dispatcher_first_type<IdTypeMap>{},
633  type2,
634  std::forward<F>(f),
635  std::forward<Ts>(args)...);
636 }
646 // 返回给定类型的名称。
647 std::string type_to_name(data_type type);
649 // end of group
650 } // namespace CUDF_EXPORT cudf
cudf::data_type
指示列中元素的逻辑数据类型。
cudf::fixed_point_scalar_device_view
一种 scalar_device_view 类型,用于存储指向 fixed_point 值的指针。
cudf::fixed_point_scalar
一个拥有类,用于在设备内存中表示 fixed_point 数字。
cudf::list_scalar
一个拥有类,用于在设备内存中表示列表值。
cudf::list_view
一个非拥有、不可变的设备数据视图,表示任意类型(包括...)的元素列表。
cudf::numeric_scalar_device_view
一种 scalar_device_view 类型,用于存储指向数值的指针。
cudf::numeric_scalar
一个拥有类,用于在设备内存中表示数值。
cudf::scalar
一个拥有类,用于表示单个值。
cudf::string_scalar_device_view
一种 scalar_device_view 类型,用于存储指向字符串值的指针。
cudf::string_scalar
一个拥有类,用于在设备内存中表示字符串。
cudf::string_view
一个非拥有、不可变的设备数据视图,是一个表示 UTF-8... 的可变长度 char 数组。
cudf::struct_scalar
一个拥有类,用于在设备内存中表示结构体值。
cudf::struct_view
一个非拥有、不可变的设备数据视图,表示一个带有任意类型字段(...)的结构体。
numeric::fixed_point
一种表示具有固定精度数字的类型。
fixed_point.hpp
cudf::dictionary32
dictionary_wrapper< int32_t > dictionary32
32位整型索引字典包装器
numeric::decimal32
fixed_point< int32_t, Radix::BASE_10 > decimal32
32位十进制定点数
numeric::decimal64
fixed_point< int64_t, Radix::BASE_10 > decimal64
64位十进制定点数
numeric::decimal128
fixed_point< __int128_t, Radix::BASE_10 > decimal128
128位十进制定点数
cudf::timestamp_ms
detail::timestamp< cudf::duration_ms > timestamp_ms
表示自 Unix epoch 以来的 cudf::duration_ms (int64_t) 类型别名。
cudf::timestamp_s
detail::timestamp< cudf::duration_s > timestamp_s
表示自 Unix epoch 以来的 cudf::duration_s (int64_t) 类型别名。
cudf::timestamp_D
detail::timestamp< cudf::duration_D > timestamp_D
表示自 Unix epoch 以来的 cudf::duration_D (int32_t) 类型别名。
cudf::duration_ns
cuda::std::chrono::duration< int64_t, cuda::std::chrono::nanoseconds::period > duration_ns
表示纳秒(int64_t)时长的类型别名。
cudf::duration_D
cuda::std::chrono::duration< int32_t, cuda::std::chrono::days::period > duration_D
表示天(int32_t)时长的类型别名。
cudf::duration_ms
cuda::std::chrono::duration< int64_t, cuda::std::chrono::milliseconds::period > duration_ms
表示毫秒(int64_t)时长的类型别名。
cudf::duration_us
cuda::std::chrono::duration< int64_t, cuda::std::chrono::microseconds::period > duration_us
表示微秒(int64_t)时长的类型别名。
cudf::timestamp_us
detail::timestamp< cudf::duration_us > timestamp_us
表示自 Unix epoch 以来的 cudf::duration_us (int64_t) 类型别名。
cudf::timestamp_ns
detail::timestamp< cudf::duration_ns > timestamp_ns
表示自 Unix epoch 以来的 cudf::duration_ns (int64_t) 类型别名。
cudf::duration_s
cuda::std::chrono::duration< int64_t, cuda::std::chrono::seconds::period > duration_s
表示秒(int64_t)时长的类型别名。
MAP_TIMESTAMP_SCALAR
#define MAP_TIMESTAMP_SCALAR(Type)
用于为时间戳类型定义 cudf::timestamp_scalar 模板类的标量类型和标量设备类型的宏...
cudf::base_type_to_id
constexpr CUDF_HOST_DEVICE type_id base_type_to_id()
将 C++ 类型映射到其对应的 cudf::type_id
cudf::type_to_name
std::string type_to_name(data_type type)
MAP_DURATION_SCALAR
#define MAP_DURATION_SCALAR(Type)
用于为时长类型定义 cudf::duration_scalar 模板类的标量类型和标量设备类型的宏...
cudf::type_dispatcher
CUDF_HOST_DEVICE constexpr decltype(auto) __forceinline__ type_dispatcher(cudf::data_type dtype, Functor f, Ts &&... args)
根据指定的 cudf::data_type 的 ID 调用带有类型实例化的 operator() 模板...
cudf::device_storage_type_t
std::conditional_t< std::is_same_v< numeric::decimal32, T >, int32_t, std::conditional_t< std::is_same_v< numeric::decimal64, T >, int64_t, std::conditional_t< std::is_same_v< numeric::decimal128, T >, __int128_t, T > >> device_storage_type_t
“返回”使用 cudf::column 时存储在设备上的相应类型
cudf::scalar_device_type_t
typename type_to_scalar_type_impl< T >::ScalarDeviceType scalar_device_type_t
将 C++ 类型映射到用于持有其值的标量设备类型。
cudf::base_type_to_id< char >
constexpr type_id base_type_to_id< char >()
将 'char' 类型映射到 type_id::INT8 的特化版本。
CUDF_TYPE_MAPPING
#define CUDF_TYPE_MAPPING(Type, Id)
用于定义具体 C++ 类型和 cudf::type_id 枚举之间映射的宏。
cudf::scalar_type_t
typename type_to_scalar_type_impl< T >::ScalarType scalar_type_t
将 C++ 类型映射到用于持有其值的标量类型。
cudf::type_to_id
constexpr CUDF_HOST_DEVICE type_id base_type_to_id()
constexpr type_id type_to_id()
cudf::double_type_dispatcher
CUDF_HOST_DEVICE constexpr decltype(auto) __forceinline__ double_type_dispatcher(cudf::data_type type1, cudf::data_type type2, F &&f, Ts &&... args)
将两个类型模板参数分派给一个可调用对象。
cudf::id_to_type
将 cudf::type_id 映射到其对应的具体 C++ 类型。
constexpr bool type_id_matches_device_storage_type(type_id id)
检查类似 fixed_point 的类型是否具有与列的存储类型 id 匹配的模板类型 T。
#define MAP_NUMERIC_SCALAR(Type)
用于为 cudf::numeric_scalar 模板类定义标量类型和标量设备类型的宏,用于 n...
#define CUDF_FAIL(...)
表示已执行了错误的执行路径。
type_id
标识列的逻辑元素类型。
cuDF 接口
fixed_point 和支持类型
一个强类型包装器,用于 DICTIONARY 类型列中的索引。
仅需操作底层存储类型时,请在 type_dispatcher 上使用此特化版本...
device_storage_type_t< id_to_type< Id > > type
底层类型。
针对不同分辨率的 int32_t 和 int64_t 时间戳的具体类型定义,作为自...
libcudf 的类型声明。
#define CUDF_HOST_DEVICE
表示函数或方法可在主机和设备上使用。
定义: types.hpp:32