OmniSciDB  95562058bd
 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)
 

Function Documentation

ALWAYS_INLINE DEVICE int64_t extract_dateepoch ( const int64_t  timeval)

Definition at line 145 of file ExtractFromTime.cpp.

References kSecsPerDay, and unsigned_mod().

Referenced by ExtractFromTime().

145  {
146  return timeval - unsigned_mod(timeval, kSecsPerDay);
147 }
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 155 of file ExtractFromTime.cpp.

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

Referenced by ExtractFromTime().

155  {
156  int64_t const day = floor_div(timeval, kSecsPerDay);
157  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
158  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
159  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
160  unsigned const moy = (5 * doy + 2) / 153;
161  return doy - (153 * moy + 2) / 5 + 1;
162 }
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 164 of file ExtractFromTime.cpp.

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

Referenced by ExtractFromTime().

164  {
165  int64_t const day = floor_div(timeval, kSecsPerDay);
166  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
167  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
168  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
169  return doy + (doy < MARJAN ? 1 + JANMAR + (yoe % 4 == 0 && (yoe % 100 != 0 || yoe == 0))
170  : 1 - MARJAN);
171 }
static constexpr int64_t kSecsPerDay
constexpr unsigned JANMAR
DEVICE int64_t floor_div(int64_t const dividend, int64_t const divisor)
static constexpr int32_t kEpochAdjustedDays
static constexpr int64_t kDaysPer400Years
constexpr unsigned MARJAN
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 141 of file ExtractFromTime.cpp.

Referenced by ExtractFromTime().

141  {
142  return timeval;
143 }

+ 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 150 of file ExtractFromTime.cpp.

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

Referenced by ExtractFromTime().

150  {
151  int64_t const days_past_epoch = floor_div(timeval, kSecsPerDay);
152  return unsigned_mod(days_past_epoch + 3, kDaysPerWeek) + 1;
153 }
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 188 of file ExtractFromTime.cpp.

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

Referenced by ExtractFromTime().

188  {
189  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
190  return extract_month_fast(timeval);
191  }
192  int64_t const day = floor_div(timeval, kSecsPerDay);
193  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
194  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
195  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
196  unsigned const moy = (5 * doy + 2) / 153;
197  return moy + (moy < 10 ? 3 : -9);
198 }
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 200 of file ExtractFromTime.cpp.

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

Referenced by ExtractFromTime().

200  {
201  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
202  return extract_quarter_fast(timeval);
203  }
204  constexpr int64_t quarter[12]{1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 1, 1};
205  int64_t const day = floor_div(timeval, kSecsPerDay);
206  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
207  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
208  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
209  unsigned const moy = (5 * doy + 2) / 153;
210  return quarter[moy];
211 }
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 173 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().

173  {
174  int64_t const day = floor_div(timeval, kSecsPerDay);
175  unsigned const doe = unsigned_mod(day - kEpochAdjustedDays, kDaysPer400Years);
176  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
177  unsigned iso_week_start = iso_week_start_from_yoe(yoe);
178  if (doe < iso_week_start) {
179  if (yoe == 0) {
180  return (doe + 2) / 7 + 9; // 2000-03-01 is +2 days from Mon, week +9.
181  } else {
182  iso_week_start = iso_week_start_from_yoe(yoe - 1);
183  }
184  }
185  return (doe - iso_week_start) / 7 + 1;
186 }
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 213 of file ExtractFromTime.cpp.

References extract_year_fast(), floor_div(), kDaysPer400Years, kEpochAdjustedDays, kEpochOffsetYear1900, kSecsPerDay, and MARJAN.

Referenced by ExtractFromTime().

213  {
214  if (timeval >= 0L && timeval <= UINT32_MAX - kEpochOffsetYear1900) {
215  return extract_year_fast(timeval);
216  }
217  int64_t const day = floor_div(timeval, kSecsPerDay);
218  int64_t const era = floor_div(day - kEpochAdjustedDays, kDaysPer400Years);
219  unsigned const doe = day - kEpochAdjustedDays - era * kDaysPer400Years;
220  unsigned const yoe = (doe - doe / 1460 + doe / 36524 - (doe == 146096)) / 365;
221  unsigned const doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
222  return 2000 + era * 400 + yoe + (MARJAN <= doy);
223 }
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
constexpr unsigned MARJAN
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 228 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().

228  {
229  switch (field) {
230  case kEPOCH:
231  return extract_epoch(timeval);
232  case kDATEEPOCH:
233  return extract_dateepoch(timeval);
234  case kQUARTERDAY:
235  return extract_quarterday(timeval);
236  case kHOUR:
237  return extract_hour(timeval);
238  case kMINUTE:
239  return extract_minute(timeval);
240  case kSECOND:
241  return extract_second(timeval);
242  case kMILLISECOND:
243  return extract_millisecond(timeval);
244  case kMICROSECOND:
245  return extract_microsecond(timeval);
246  case kNANOSECOND:
247  return extract_nanosecond(timeval);
248  case kDOW:
249  return extract_dow(timeval);
250  case kISODOW:
251  return extract_isodow(timeval);
252  case kDAY:
253  return extract_day(timeval);
254  case kWEEK:
255  return extract_week(timeval);
256  case kDOY:
257  return extract_day_of_year(timeval);
258  case kMONTH:
259  return extract_month(timeval);
260  case kQUARTER:
261  return extract_quarter(timeval);
262  case kYEAR:
263  return extract_year(timeval);
264  }
265 
266 #ifdef __CUDACC__
267  return -1;
268 #else
269  abort();
270 #endif
271 }
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: