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

Go to the source code of this file.

Functions

DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
fixed_width_int_decode (const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
 
DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
fixed_width_unsigned_decode (const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
 
DEVICE NEVER_INLINE int64_t
SUFFIX() 
fixed_width_int_decode_noinline (const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
 
DEVICE NEVER_INLINE int64_t
SUFFIX() 
fixed_width_unsigned_decode_noinline (const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
 
DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
diff_fixed_width_int_decode (const int8_t *byte_stream, const int32_t byte_width, const int64_t baseline, const int64_t pos)
 
DEVICE ALWAYS_INLINE float SUFFIX() fixed_width_float_decode (const int8_t *byte_stream, const int64_t pos)
 
DEVICE NEVER_INLINE float SUFFIX() fixed_width_float_decode_noinline (const int8_t *byte_stream, const int64_t pos)
 
DEVICE ALWAYS_INLINE double
SUFFIX() 
fixed_width_double_decode (const int8_t *byte_stream, const int64_t pos)
 
DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline (const int8_t *byte_stream, const int64_t pos)
 
DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
fixed_width_small_date_decode (const int8_t *byte_stream, const int32_t byte_width, const int32_t null_val, const int64_t ret_null_val, const int64_t pos)
 
DEVICE NEVER_INLINE int64_t
SUFFIX() 
fixed_width_small_date_decode_noinline (const int8_t *byte_stream, const int32_t byte_width, const int32_t null_val, const int64_t ret_null_val, const int64_t pos)
 
DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
fixed_width_date_encode (const int64_t cur_col_val, const int32_t ret_null_val, const int64_t null_val)
 
DEVICE ALWAYS_INLINE int64_t
SUFFIX() 
fixed_width_date_decode (const int64_t cur_col_val, const int32_t ret_null_val, const int64_t null_val)
 
DEVICE NEVER_INLINE int64_t
SUFFIX() 
fixed_width_date_encode_noinline (const int64_t cur_col_val, const int32_t ret_null_val, const int64_t null_val)
 

Function Documentation

DEVICE ALWAYS_INLINE int64_t SUFFIX() diff_fixed_width_int_decode ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int64_t  baseline,
const int64_t  pos 
)

Definition at line 105 of file DecodersImpl.h.

References fixed_width_int_decode(), and SUFFIX.

108  {
109  return SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos) + baseline;
110 }
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_int_decode(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:31
#define SUFFIX(name)

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_date_decode ( const int64_t  cur_col_val,
const int32_t  ret_null_val,
const int64_t  null_val 
)

Definition at line 166 of file DecodersImpl.h.

References kSecsPerDay.

168  {
169  return cur_col_val == null_val ? ret_null_val : cur_col_val * kSecsPerDay;
170 }
static constexpr int64_t kSecsPerDay
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_date_encode ( const int64_t  cur_col_val,
const int32_t  ret_null_val,
const int64_t  null_val 
)

Definition at line 159 of file DecodersImpl.h.

References kSecsPerDay.

Referenced by fixed_width_date_encode_noinline().

161  {
162  return cur_col_val == null_val ? ret_null_val : cur_col_val / kSecsPerDay;
163 }
static constexpr int64_t kSecsPerDay

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_date_encode_noinline ( const int64_t  cur_col_val,
const int32_t  ret_null_val,
const int64_t  null_val 
)

Definition at line 173 of file DecodersImpl.h.

References fixed_width_date_encode(), and SUFFIX.

175  {
176  return SUFFIX(fixed_width_date_encode)(cur_col_val, ret_null_val, null_val);
177 }
#define SUFFIX(name)
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_date_encode(const int64_t cur_col_val, const int32_t ret_null_val, const int64_t null_val)
Definition: DecodersImpl.h:159

+ Here is the call graph for this function:

DEVICE ALWAYS_INLINE double SUFFIX() fixed_width_double_decode ( const int8_t *  byte_stream,
const int64_t  pos 
)

Definition at line 126 of file DecodersImpl.h.

Referenced by fixed_width_double_decode_noinline().

126  {
127 #ifdef WITH_DECODERS_BOUNDS_CHECKING
128  assert(pos >= 0);
129 #endif // WITH_DECODERS_BOUNDS_CHECKING
130  return *(reinterpret_cast<const double*>(&byte_stream[pos * sizeof(double)]));
131 }

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE double SUFFIX() fixed_width_double_decode_noinline ( const int8_t *  byte_stream,
const int64_t  pos 
)

Definition at line 134 of file DecodersImpl.h.

References fixed_width_double_decode(), and SUFFIX.

Referenced by compute_bucket_sizes_impl(), JoinColumnIterator::getElementSwitch(), result_set::lazy_decode(), BoundingBoxIntersectKeyHandler::operator()(), and RangeKeyHandler::operator()().

134  {
135  return SUFFIX(fixed_width_double_decode)(byte_stream, pos);
136 }
#define SUFFIX(name)
DEVICE ALWAYS_INLINE double SUFFIX() fixed_width_double_decode(const int8_t *byte_stream, const int64_t pos)
Definition: DecodersImpl.h:126

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE float SUFFIX() fixed_width_float_decode ( const int8_t *  byte_stream,
const int64_t  pos 
)

Definition at line 113 of file DecodersImpl.h.

Referenced by fixed_width_float_decode_noinline().

113  {
114 #ifdef WITH_DECODERS_BOUNDS_CHECKING
115  assert(pos >= 0);
116 #endif // WITH_DECODERS_BOUNDS_CHECKING
117  return *(reinterpret_cast<const float*>(&byte_stream[pos * sizeof(float)]));
118 }

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE float SUFFIX() fixed_width_float_decode_noinline ( const int8_t *  byte_stream,
const int64_t  pos 
)

Definition at line 121 of file DecodersImpl.h.

References fixed_width_float_decode(), and SUFFIX.

Referenced by result_set::lazy_decode().

121  {
122  return SUFFIX(fixed_width_float_decode)(byte_stream, pos);
123 }
#define SUFFIX(name)
DEVICE ALWAYS_INLINE float SUFFIX() fixed_width_float_decode(const int8_t *byte_stream, const int64_t pos)
Definition: DecodersImpl.h:113

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_int_decode ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int64_t  pos 
)

Definition at line 31 of file DecodersImpl.h.

Referenced by diff_fixed_width_int_decode(), fixed_width_int_decode_noinline(), and fixed_width_small_date_decode().

33  {
34 #ifdef WITH_DECODERS_BOUNDS_CHECKING
35  assert(pos >= 0);
36 #endif // WITH_DECODERS_BOUNDS_CHECKING
37  switch (byte_width) {
38  case 1:
39  return static_cast<int64_t>(byte_stream[pos * byte_width]);
40  case 2:
41  return *(reinterpret_cast<const int16_t*>(&byte_stream[pos * byte_width]));
42  case 4:
43  return *(reinterpret_cast<const int32_t*>(&byte_stream[pos * byte_width]));
44  case 8:
45  return *(reinterpret_cast<const int64_t*>(&byte_stream[pos * byte_width]));
46  default:
47 // TODO(alex)
48 #ifdef __CUDACC__
49  return -1;
50 #else
51 #ifdef _WIN32
52  return LLONG_MIN + 1;
53 #else
54  return std::numeric_limits<int64_t>::min() + 1;
55 #endif
56 #endif
57  }
58 }

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_int_decode_noinline ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int64_t  pos 
)

Definition at line 91 of file DecodersImpl.h.

References fixed_width_int_decode(), and SUFFIX.

Referenced by JoinColumnIterator::getElementSwitch(), result_set::lazy_decode(), and RangeKeyHandler::operator()().

93  {
94  return SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos);
95 }
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_int_decode(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:31
#define SUFFIX(name)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_small_date_decode ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int32_t  null_val,
const int64_t  ret_null_val,
const int64_t  pos 
)

Definition at line 139 of file DecodersImpl.h.

References fixed_width_int_decode(), kSecsPerDay, and SUFFIX.

Referenced by fixed_width_small_date_decode_noinline().

143  {
144  auto val = SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos);
145  return val == null_val ? ret_null_val : val * kSecsPerDay;
146 }
static constexpr int64_t kSecsPerDay
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_int_decode(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:31
#define SUFFIX(name)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_small_date_decode_noinline ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int32_t  null_val,
const int64_t  ret_null_val,
const int64_t  pos 
)

Definition at line 149 of file DecodersImpl.h.

References fixed_width_small_date_decode(), and SUFFIX.

Referenced by JoinColumnIterator::getElementSwitch(), and result_set::lazy_decode().

153  {
155  byte_stream, byte_width, null_val, ret_null_val, pos);
156 }
#define SUFFIX(name)
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_small_date_decode(const int8_t *byte_stream, const int32_t byte_width, const int32_t null_val, const int64_t ret_null_val, const int64_t pos)
Definition: DecodersImpl.h:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_unsigned_decode ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int64_t  pos 
)

Definition at line 61 of file DecodersImpl.h.

Referenced by fixed_width_unsigned_decode_noinline().

63  {
64 #ifdef WITH_DECODERS_BOUNDS_CHECKING
65  assert(pos >= 0);
66 #endif // WITH_DECODERS_BOUNDS_CHECKING
67  switch (byte_width) {
68  case 1:
69  return reinterpret_cast<const uint8_t*>(byte_stream)[pos * byte_width];
70  case 2:
71  return *(reinterpret_cast<const uint16_t*>(&byte_stream[pos * byte_width]));
72  case 4:
73  return *(reinterpret_cast<const uint32_t*>(&byte_stream[pos * byte_width]));
74  case 8:
75  return *(reinterpret_cast<const uint64_t*>(&byte_stream[pos * byte_width]));
76  default:
77 // TODO(alex)
78 #ifdef __CUDACC__
79  return -1;
80 #else
81 #ifdef _WIN32
82  return LLONG_MIN + 1;
83 #else
84  return std::numeric_limits<int64_t>::min() + 1;
85 #endif
86 #endif
87  }
88 }

+ Here is the caller graph for this function:

DEVICE NEVER_INLINE int64_t SUFFIX() fixed_width_unsigned_decode_noinline ( const int8_t *  byte_stream,
const int32_t  byte_width,
const int64_t  pos 
)

Definition at line 98 of file DecodersImpl.h.

References fixed_width_unsigned_decode(), and SUFFIX.

Referenced by JoinColumnIterator::getElementSwitch(), and result_set::lazy_decode().

100  {
101  return SUFFIX(fixed_width_unsigned_decode)(byte_stream, byte_width, pos);
102 }
#define SUFFIX(name)
DEVICE ALWAYS_INLINE int64_t SUFFIX() fixed_width_unsigned_decode(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
Definition: DecodersImpl.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function: