OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtractFromTime.cpp File Reference
#include "ExtractFromTime.h"
#include "../Shared/funcannotations.h"
#include <cstdlib>
+ Include dependency graph for ExtractFromTime.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 anonymous_namespace{ExtractFromTime.cpp}
 

Functions

DEVICE unsigned anonymous_namespace{ExtractFromTime.cpp}::iso_week_start_from_yoe (unsigned const yoe)
 
ALWAYS_INLINE DEVICE int64_t extract_hour (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_minute (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_second (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_millisecond (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_microsecond (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_nanosecond (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_dow (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_quarterday (const int64_t lcltime)
 
DEVICE int32_t extract_month_fast (const int64_t lcltime)
 
DEVICE int32_t extract_quarter_fast (const int64_t lcltime)
 
DEVICE int32_t extract_year_fast (const int64_t lcltime)
 
ALWAYS_INLINE DEVICE int64_t extract_epoch (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_dateepoch (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_isodow (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_day (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_day_of_year (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_week (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_month (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_quarter (const int64_t timeval)
 
ALWAYS_INLINE DEVICE int64_t extract_year (const int64_t timeval)
 
DEVICE int64_t ExtractFromTime (ExtractField field, const int64_t timeval)
 

Variables

constexpr unsigned anonymous_namespace{ExtractFromTime.cpp}::MARJAN = 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31
 
constexpr unsigned anonymous_namespace{ExtractFromTime.cpp}::JANMAR = 31 + 28
 

Function Documentation

ALWAYS_INLINE DEVICE int64_t extract_dateepoch ( const int64_t  timeval)

Definition at line 150 of file ExtractFromTime.cpp.

References kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

150  {
151  return timeval - unsigned_mod(timeval, kSecsPerDay);
152 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_day ( const int64_t  timeval)

Definition at line 160 of file ExtractFromTime.cpp.

References floor_div(), kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

160  {
161  int64_t const day = floor_div(timeval, kSecsPerDay);
162  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
163  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
164  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
165  unsigned const moy = (5 * doy + 2) / 153;
166  return doy - (153 * moy + 2) / 5 + 1;
167 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_day_of_year ( const int64_t  timeval)

Definition at line 169 of file ExtractFromTime.cpp.

References floor_div(), anonymous_namespace{ExtractFromTime.cpp}::JANMAR, kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, anonymous_namespace{ExtractFromTime.cpp}::MARJAN, and unsigned_mod().

Referenced by ExtractFromTime().

169  {
170  int64_t const day = floor_div(timeval, kSecsPerDay);
171  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
172  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
173  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
174  return doy + (doy < MARJAN ? 1 + JANMAR + (yoe % 4 == 0 && (yoe % 100 != 0 || yoe == 0))
175  : 1 - MARJAN);
176 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_dow ( const int64_t  lcltime)

Definition at line 67 of file ExtractFromTime.cpp.

References floor_div(), kDaysPerWeek, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

67  {
68  int64_t const days_past_epoch = floor_div(lcltime, kSecsPerDay);
69  return unsigned_mod(days_past_epoch + 4, kDaysPerWeek);
70 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kDaysPerWeek
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_epoch ( const int64_t  timeval)

Definition at line 146 of file ExtractFromTime.cpp.

Referenced by ExtractFromTime().

146  {
147  return timeval;
148 }

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_hour ( const int64_t  lcltime)

Definition at line 42 of file ExtractFromTime.cpp.

References kSecsPerDay, kSecsPerHour, and unsigned_mod().

Referenced by ExtractFromTime().

42  {
43  return unsigned_mod(lcltime, kSecsPerDay) / kSecsPerHour;
44 }
static constexpr int64_t kSecsPerDay
static constexpr int64_t kSecsPerHour
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_isodow ( const int64_t  timeval)

Definition at line 155 of file ExtractFromTime.cpp.

References floor_div(), kDaysPerWeek, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

155  {
156  int64_t const days_past_epoch = floor_div(timeval, kSecsPerDay);
157  return unsigned_mod(days_past_epoch + 3, kDaysPerWeek) + 1;
158 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kDaysPerWeek
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_microsecond ( const int64_t  lcltime)

Definition at line 58 of file ExtractFromTime.cpp.

References kMicroSecsPerSec, kSecsPerMin, and unsigned_mod().

Referenced by ExtractFromTime().

58  {
59  return unsigned_mod(lcltime, kSecsPerMin * kMicroSecsPerSec);
60 }
static constexpr int64_t kSecsPerMin
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)
static constexpr int64_t kMicroSecsPerSec

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_millisecond ( const int64_t  lcltime)

Definition at line 54 of file ExtractFromTime.cpp.

References kMilliSecsPerSec, kSecsPerMin, and unsigned_mod().

Referenced by ExtractFromTime().

54  {
55  return unsigned_mod(lcltime, kSecsPerMin * kMilliSecsPerSec);
56 }
static constexpr int64_t kSecsPerMin
static constexpr int64_t kMilliSecsPerSec
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_minute ( const int64_t  lcltime)

Definition at line 46 of file ExtractFromTime.cpp.

References kSecsPerHour, kSecsPerMin, and unsigned_mod().

Referenced by ExtractFromTime().

46  {
47  return unsigned_mod(lcltime, kSecsPerHour) / kSecsPerMin;
48 }
static constexpr int64_t kSecsPerHour
static constexpr int64_t kSecsPerMin
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_month ( const int64_t  timeval)

Definition at line 193 of file ExtractFromTime.cpp.

References extract_month_fast(), floor_div(), kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

193  {
194  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
195  return extract_month_fast(timeval);
196  }
197  int64_t const day = floor_div(timeval, kSecsPerDay);
198  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
199  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
200  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
201  unsigned const moy = (5 * doy + 2) / 153;
202  return moy + (moy < 10 ? 3 : -9);
203 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr uint32_t kEpochOffsetYear1900
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)
DEVICE int32_t extract_month_fast(const int64_t lcltime)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE int32_t extract_month_fast ( const int64_t  lcltime)

Definition at line 76 of file ExtractFromTime.cpp.

References kEpochOffsetYear1900, kMonsPerYear, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, kUSecsPerDay, and STATIC_QUAL.

Referenced by extract_month().

76  {
77  STATIC_QUAL const uint32_t cumulative_month_epoch_starts[kMonsPerYear] = {0,
78  2678400,
79  5270400,
80  7948800,
81  10540800,
82  13219200,
83  15897600,
84  18489600,
85  21168000,
86  23760000,
87  26438400,
88  29116800};
89  uint32_t seconds_march_1900 = lcltime + kEpochOffsetYear1900 - kSecsJanToMar1900;
90  uint32_t seconds_past_4year_period = seconds_march_1900 % kSecondsPer4YearCycle;
91  uint32_t year_seconds_past_4year_period =
92  (seconds_past_4year_period / kSecondsPerNonLeapYear) * kSecondsPerNonLeapYear;
93  if (seconds_past_4year_period >=
94  kSecondsPer4YearCycle - kUSecsPerDay) { // if we are in Feb 29th
95  year_seconds_past_4year_period -= kSecondsPerNonLeapYear;
96  }
97  uint32_t seconds_past_march =
98  seconds_past_4year_period - year_seconds_past_4year_period;
99  uint32_t month =
100  seconds_past_march / (30 * kUSecsPerDay); // Will make the correct month either be
101  // the guessed month or month before
102  month = month <= 11 ? month : 11;
103  if (cumulative_month_epoch_starts[month] > seconds_past_march) {
104  month--;
105  }
106  return (month + 2) % 12 + 1;
107 }
static constexpr uint32_t kSecsJanToMar1900
static constexpr uint32_t kUSecsPerDay
#define STATIC_QUAL
static constexpr uint32_t kEpochOffsetYear1900
static constexpr uint32_t kSecondsPer4YearCycle
static constexpr uint32_t kSecondsPerNonLeapYear
static constexpr int32_t kMonsPerYear

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_nanosecond ( const int64_t  lcltime)

Definition at line 62 of file ExtractFromTime.cpp.

References kNanoSecsPerSec, kSecsPerMin, and unsigned_mod().

Referenced by ExtractFromTime().

62  {
63  return unsigned_mod(lcltime, kSecsPerMin * kNanoSecsPerSec);
64 }
static constexpr int64_t kSecsPerMin
static constexpr int64_t kNanoSecsPerSec
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_quarter ( const int64_t  timeval)

Definition at line 205 of file ExtractFromTime.cpp.

References extract_quarter_fast(), floor_div(), kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

205  {
206  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
207  return extract_quarter_fast(timeval);
208  }
209  constexpr int64_t quarter[12]{1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1};
210  int64_t const day = floor_div(timeval, kSecsPerDay);
211  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
212  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
213  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
214  unsigned const moy = (5 * doy + 2) / 153;
215  return quarter[moy];
216 }
static constexpr int64_t kSecsPerDay
DEVICE int32_t extract_quarter_fast(const int64_t lcltime)
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr uint32_t kEpochOffsetYear1900
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE int32_t extract_quarter_fast ( const int64_t  lcltime)

Definition at line 109 of file ExtractFromTime.cpp.

References kEpochOffsetYear1900, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, kSecsPerDay, kUSecsPerDay, and STATIC_QUAL.

Referenced by extract_quarter().

109  {
110  STATIC_QUAL const uint32_t cumulative_quarter_epoch_starts[4] = {
111  0, 7776000, 15638400, 23587200};
112  STATIC_QUAL const uint32_t cumulative_quarter_epoch_starts_leap_year[4] = {
113  0, 7862400, 15724800, 23673600};
114  uint32_t seconds_1900 = lcltime + kEpochOffsetYear1900;
115  uint32_t leap_years = (seconds_1900 - kSecsJanToMar1900) / kSecondsPer4YearCycle;
116  uint32_t year = (seconds_1900 - leap_years * kSecsPerDay) / kSecondsPerNonLeapYear;
117  uint32_t base_year_leap_years = (year - 1) / 4;
118  uint32_t base_year_seconds =
119  year * kSecondsPerNonLeapYear + base_year_leap_years * kUSecsPerDay;
120  bool is_leap_year = year % 4 == 0 && year != 0;
121  const uint32_t* quarter_offsets = is_leap_year
122  ? cumulative_quarter_epoch_starts_leap_year
123  : cumulative_quarter_epoch_starts;
124  uint32_t partial_year_seconds = seconds_1900 % base_year_seconds;
125  uint32_t quarter = partial_year_seconds / (90 * kUSecsPerDay);
126  quarter = quarter <= 3 ? quarter : 3;
127  if (quarter_offsets[quarter] > partial_year_seconds) {
128  quarter--;
129  }
130  return quarter + 1;
131 }
static constexpr int64_t kSecsPerDay
static constexpr uint32_t kSecsJanToMar1900
static constexpr uint32_t kUSecsPerDay
#define STATIC_QUAL
static constexpr uint32_t kEpochOffsetYear1900
static constexpr uint32_t kSecondsPer4YearCycle
static constexpr uint32_t kSecondsPerNonLeapYear

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_quarterday ( const int64_t  lcltime)

Definition at line 72 of file ExtractFromTime.cpp.

References kSecsPerDay, kSecsPerQuarterDay, and unsigned_mod().

Referenced by ExtractFromTime().

72  {
73  return unsigned_mod(lcltime, kSecsPerDay) / kSecsPerQuarterDay + 1;
74 }
static constexpr int64_t kSecsPerDay
static constexpr int64_t kSecsPerQuarterDay
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_second ( const int64_t  lcltime)

Definition at line 50 of file ExtractFromTime.cpp.

References kSecsPerMin, and unsigned_mod().

Referenced by ExtractFromTime().

50  {
51  return unsigned_mod(lcltime, kSecsPerMin);
52 }
static constexpr int64_t kSecsPerMin
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_week ( const int64_t  timeval)

Definition at line 178 of file ExtractFromTime.cpp.

References floor_div(), anonymous_namespace{ExtractFromTime.cpp}::iso_week_start_from_yoe(), kDaysPer400Years, kEpochAdjustedDays, kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

178  {
179  int64_t const day = floor_div(timeval, kSecsPerDay);
180  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
181  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
182  unsigned iso_week_start = iso_week_start_from_yoe(yoe);
183  if (doe < iso_week_start) {
184  if (yoe == 0) {
185  return (doe + 2) / 7 + 9; // 2000-03-01 is +2 days from Mon, week +9.
186  } else {
187  iso_week_start = iso_week_start_from_yoe(yoe - 1);
188  }
189  }
190  return (doe - iso_week_start) / 7 + 1;
191 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int64_t unsigned_mod(int64_t const dividend, int64_t const divisor)
DEVICE unsigned iso_week_start_from_yoe(unsigned const yoe)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE DEVICE int64_t extract_year ( const int64_t  timeval)

Definition at line 218 of file ExtractFromTime.cpp.

References extract_year_fast(), floor_div(), kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecsPerDay, and anonymous_namespace{ExtractFromTime.cpp}::MARJAN.

Referenced by ExtractFromTime().

218  {
219  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
220  return extract_year_fast(timeval);
221  }
222  int64_t const day = floor_div(timeval, kSecsPerDay);
223  int64_t const era = floor_div(day - kEpochAdjustedDays, kDaysPer400Years);
224  unsigned const doe = day - kEpochAdjustedDays - era * kDaysPer400Years;
225  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
226  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
227  return 2000 + era * 400 + yoe + (MARJAN <= doy);
228 }
static constexpr int64_t kSecsPerDay
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr uint32_t kEpochOffsetYear1900
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
DEVICE int32_t extract_year_fast(const int64_t lcltime)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE int32_t extract_year_fast ( const int64_t  lcltime)

Definition at line 133 of file ExtractFromTime.cpp.

References kEpochOffsetYear1900, kSecondsPer4YearCycle, kSecondsPerNonLeapYear, kSecsJanToMar1900, and kUSecsPerDay.

Referenced by extract_year().

133  {
134  const uint32_t seconds_1900 = lcltime + kEpochOffsetYear1900;
135  const uint32_t leap_years = (seconds_1900 - kSecsJanToMar1900) / kSecondsPer4YearCycle;
136  const uint32_t year =
137  (seconds_1900 - leap_years * kUSecsPerDay) / kSecondsPerNonLeapYear + 1900;
138  return year;
139 }
static constexpr uint32_t kSecsJanToMar1900
static constexpr uint32_t kUSecsPerDay
static constexpr uint32_t kEpochOffsetYear1900
static constexpr uint32_t kSecondsPer4YearCycle
static constexpr uint32_t kSecondsPerNonLeapYear

+ Here is the caller graph for this function:

DEVICE int64_t ExtractFromTime ( ExtractField  field,
const int64_t  timeval 
)

Definition at line 233 of file ExtractFromTime.cpp.

References extract_dateepoch(), extract_day(), extract_day_of_year(), extract_dow(), extract_epoch(), extract_hour(), extract_isodow(), extract_microsecond(), extract_millisecond(), extract_minute(), extract_month(), extract_nanosecond(), extract_quarter(), extract_quarterday(), extract_second(), extract_week(), extract_year(), kDATEEPOCH, kDAY, kDOW, kDOY, kEPOCH, kHOUR, kISODOW, kMICROSECOND, kMILLISECOND, kMINUTE, kMONTH, kNANOSECOND, kQUARTER, kQUARTERDAY, kSECOND, kWEEK, and kYEAR.

Referenced by getExpressionRange(), and DateTimeTranslator::getExtractFromTimeConstantValue().

233  {
234  switch (field) {
235  case kEPOCH:
236  return extract_epoch(timeval);
237  case kDATEEPOCH:
238  return extract_dateepoch(timeval);
239  case kQUARTERDAY:
240  return extract_quarterday(timeval);
241  case kHOUR:
242  return extract_hour(timeval);
243  case kMINUTE:
244  return extract_minute(timeval);
245  case kSECOND:
246  return extract_second(timeval);
247  case kMILLISECOND:
248  return extract_millisecond(timeval);
249  case kMICROSECOND:
250  return extract_microsecond(timeval);
251  case kNANOSECOND:
252  return extract_nanosecond(timeval);
253  case kDOW:
254  return extract_dow(timeval);
255  case kISODOW:
256  return extract_isodow(timeval);
257  case kDAY:
258  return extract_day(timeval);
259  case kWEEK:
260  return extract_week(timeval);
261  case kDOY:
262  return extract_day_of_year(timeval);
263  case kMONTH:
264  return extract_month(timeval);
265  case kQUARTER:
266  return extract_quarter(timeval);
267  case kYEAR:
268  return extract_year(timeval);
269  }
270 
271 #ifdef __CUDACC__
272  return -1;
273 #else
274  abort();
275 #endif
276 }
ALWAYS_INLINE DEVICE int64_t extract_second(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_nanosecond(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_month(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_isodow(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_day_of_year(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_minute(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_quarterday(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_quarter(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_dow(const int64_t lcltime)
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:31
ALWAYS_INLINE DEVICE int64_t extract_dateepoch(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_year(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_microsecond(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_hour(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_epoch(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_millisecond(const int64_t lcltime)
ALWAYS_INLINE DEVICE int64_t extract_day(const int64_t timeval)
ALWAYS_INLINE DEVICE int64_t extract_week(const int64_t timeval)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: