timestamps.hpp
前往此文件的文档。
1 /*
2  * 版权所有 (c) 2019-2024, NVIDIA CORPORATION。
3  *
4  * 根据 Apache 许可证 2.0 版(“许可证”)获得许可;
5  * 除非遵守许可证,否则您不得使用此文件。
6  * 您可以获取许可证的副本,地址如下:
7  *
8  * https://apache.ac.cn/licenses/LICENSE-2.0
9  *
10  * 除非适用法律要求或经书面同意,否则根据许可证分发的软件
11  * 按“原样”分发,不附带任何明示或暗示的
12  * 保证或条件。
13  * 有关许可证下的特定语言管理权限和
14  * 限制,请参阅许可证。
15  */
16 
17 #pragma once
18 
19 #include <cudf/utilities/export.hpp>
21 
27 /// @brief 不同分辨率的时间点类型。namespace CUDF_EXPORT cudf {
28 namespace detail {
29 // TODO: 在 libcu++ 中可用时使用 chrono::utc_clock?
30 template <class Duration>
31 using time_point = cuda::std::chrono::sys_time<Duration>;
32 
38 /// @brief 不同分辨率时间点的包装器。template <class Duration>
40 } // namespace detail
41 
51 /// @brief 表示自 Unix 纪元以来 cudf::duration_D (int32_t) 的类型别名。using timestamp_D = detail::timestamp<cudf::duration_D>;
55 /// @brief 表示自 Unix 纪元以来 cudf::duration_h (int32_t) 的类型别名。using timestamp_h = detail::timestamp<cudf::duration_h>;
59 /// @brief 表示自 Unix 纪元以来 cudf::duration_m (int32_t) 的类型别名。using timestamp_m = detail::timestamp<cudf::duration_m>;
63 /// @brief 表示自 Unix 纪元以来 cudf::duration_s (int64_t) 的类型别名。using timestamp_s = detail::timestamp<cudf::duration_s>;
67 /// @brief 表示自 Unix 纪元以来 cudf::duration_ms (int64_t) 的类型别名。using timestamp_ms = detail::timestamp<cudf::duration_ms>;
71 /// @brief 表示自 Unix 纪元以来 cudf::duration_us (int64_t) 的类型别名。using timestamp_us = detail::timestamp<cudf::duration_us>;
75 /// @brief 表示自 Unix 纪元以来 cudf::duration_ns (int64_t) 的类型别名。using timestamp_ns = detail::timestamp<cudf::duration_ns>;
76 
77 static_assert(sizeof(timestamp_D) == sizeof(typename timestamp_D::rep));
78 static_assert(sizeof(timestamp_h) == sizeof(typename timestamp_h::rep));
79 static_assert(sizeof(timestamp_m) == sizeof(typename timestamp_m::rep));
80 static_assert(sizeof(timestamp_s) == sizeof(typename timestamp_s::rep));
81 static_assert(sizeof(timestamp_ms) == sizeof(typename timestamp_ms::rep));
82 static_assert(sizeof(timestamp_us) == sizeof(typename timestamp_us::rep));
83 static_assert(sizeof(timestamp_ns) == sizeof(typename timestamp_ns::rep));
84  // 组结束
86 } // namespace CUDF_EXPORT cudf
int32_t 和 int64_t 不同分辨率持续时间的具体类型定义。
detail::timestamp< cudf::duration_ms > timestamp_ms
表示自 Unix 纪元以来 cudf::duration_ms (int64_t) 的类型别名。
detail::timestamp< cudf::duration_s > timestamp_s
表示自 Unix 纪元以来 cudf::duration_s (int64_t) 的类型别名。
detail::timestamp< cudf::duration_D > timestamp_D
表示自 Unix 纪元以来 cudf::duration_D (int32_t) 的类型别名。
detail::timestamp< cudf::duration_m > timestamp_m
表示自 Unix 纪元以来 cudf::duration_m (int32_t) 的类型别名。
detail::timestamp< cudf::duration_h > timestamp_h
表示自 Unix 纪元以来 cudf::duration_h (int32_t) 的类型别名。
detail::timestamp< cudf::duration_us > timestamp_us
表示自 Unix 纪元以来 cudf::duration_us (int64_t) 的类型别名。
detail::timestamp< cudf::duration_ns > timestamp_ns
表示自 Unix 纪元以来 cudf::duration_ns (int64_t) 的类型别名。
cuDF 接口
定义: host_udf.hpp:37
cuda::std::chrono::sys_time< Duration > time_point
时间点类型。
time_point< Duration > timestamp
不同分辨率时间点列的包装器。