timestamps.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, 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  * http://www.apache.org/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 
19 #include <cudf/utilities/export.hpp>
21 
27 namespace CUDF_EXPORT cudf {
28 namespace detail {
29 // TODO: Use chrono::utc_clock when available in libcu++?
30 template <class Duration>
31 using time_point = cuda::std::chrono::sys_time<Duration>;
32 
38 template <class Duration>
40 } // namespace detail
41 
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  // end of group
86 } // namespace CUDF_EXPORT cudf
Concrete type definitions for int32_t and int64_t durations in varying resolutions.
detail::timestamp< cudf::duration_ms > timestamp_ms
Type alias representing a cudf::duration_ms (int64_t) since the unix epoch.
Definition: timestamps.hpp:67
detail::timestamp< cudf::duration_s > timestamp_s
Type alias representing a cudf::duration_s (int64_t) since the unix epoch.
Definition: timestamps.hpp:63
detail::timestamp< cudf::duration_D > timestamp_D
Type alias representing a cudf::duration_D (int32_t) since the unix epoch.
Definition: timestamps.hpp:51
detail::timestamp< cudf::duration_m > timestamp_m
Type alias representing a cudf::duration_m (int32_t) since the unix epoch.
Definition: timestamps.hpp:59
detail::timestamp< cudf::duration_h > timestamp_h
Type alias representing a cudf::duration_h (int32_t) since the unix epoch.
Definition: timestamps.hpp:55
detail::timestamp< cudf::duration_us > timestamp_us
Type alias representing a cudf::duration_us (int64_t) since the unix epoch.
Definition: timestamps.hpp:71
detail::timestamp< cudf::duration_ns > timestamp_ns
Type alias representing a cudf::duration_ns (int64_t) since the unix epoch.
Definition: timestamps.hpp:75
cuDF interfaces
Definition: host_udf.hpp:39
cuda::std::chrono::sys_time< Duration > time_point
Time point type.
Definition: timestamps.hpp:31
time_point< Duration > timestamp
A wrapper around a column of time_point in varying resolutions.
Definition: timestamps.hpp:39