libcudf  24.02.00
timestamps.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2022, 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 
20 
26 namespace cudf {
27 namespace detail {
28 // TODO: Use chrono::utc_clock when available in libcu++?
29 template <class Duration>
30 using time_point = cuda::std::chrono::sys_time<Duration>;
31 
37 template <class Duration>
39 } // namespace detail
40 
75 
76 static_assert(sizeof(timestamp_D) == sizeof(typename timestamp_D::rep), "");
77 static_assert(sizeof(timestamp_h) == sizeof(typename timestamp_h::rep), "");
78 static_assert(sizeof(timestamp_m) == sizeof(typename timestamp_m::rep), "");
79 static_assert(sizeof(timestamp_s) == sizeof(typename timestamp_s::rep), "");
80 static_assert(sizeof(timestamp_ms) == sizeof(typename timestamp_ms::rep), "");
81 static_assert(sizeof(timestamp_us) == sizeof(typename timestamp_us::rep), "");
82 static_assert(sizeof(timestamp_ns) == sizeof(typename timestamp_ns::rep), "");
83  // end of group
85 } // namespace 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:66
detail::timestamp< cudf::duration_s > timestamp_s
Type alias representing a cudf::duration_s (int64_t) since the unix epoch.
Definition: timestamps.hpp:62
detail::timestamp< cudf::duration_D > timestamp_D
Type alias representing a cudf::duration_D (int32_t) since the unix epoch.
Definition: timestamps.hpp:50
detail::timestamp< cudf::duration_m > timestamp_m
Type alias representing a cudf::duration_m (int32_t) since the unix epoch.
Definition: timestamps.hpp:58
detail::timestamp< cudf::duration_h > timestamp_h
Type alias representing a cudf::duration_h (int32_t) since the unix epoch.
Definition: timestamps.hpp:54
detail::timestamp< cudf::duration_us > timestamp_us
Type alias representing a cudf::duration_us (int64_t) since the unix epoch.
Definition: timestamps.hpp:70
detail::timestamp< cudf::duration_ns > timestamp_ns
Type alias representing a cudf::duration_ns (int64_t) since the unix epoch.
Definition: timestamps.hpp:74
cuDF interfaces
Definition: aggregation.hpp:34
cuda::std::chrono::sys_time< Duration > time_point
Time point type.
Definition: timestamps.hpp:30
time_point< Duration > timestamp
A wrapper around a column of time_point in varying resolutions.
Definition: timestamps.hpp:38