23 #ifndef QUERYENGINE_DECODERSIMPL_H
24 #define QUERYENGINE_DECODERSIMPL_H
27 #include "../Shared/funcannotations.h"
32 const int32_t byte_width,
34 #ifdef WITH_DECODERS_BOUNDS_CHECKING
36 #endif // WITH_DECODERS_BOUNDS_CHECKING
39 return static_cast<int64_t
>(byte_stream[pos * byte_width]);
41 return *(
reinterpret_cast<const int16_t*
>(&byte_stream[pos * byte_width]));
43 return *(
reinterpret_cast<const int32_t*
>(&byte_stream[pos * byte_width]));
45 return *(
reinterpret_cast<const int64_t*
>(&byte_stream[pos * byte_width]));
54 return std::numeric_limits<int64_t>::min() + 1;
62 const int32_t byte_width,
64 #ifdef WITH_DECODERS_BOUNDS_CHECKING
66 #endif // WITH_DECODERS_BOUNDS_CHECKING
69 return reinterpret_cast<const uint8_t*
>(byte_stream)[pos * byte_width];
71 return *(
reinterpret_cast<const uint16_t*
>(&byte_stream[pos * byte_width]));
73 return *(
reinterpret_cast<const uint32_t*
>(&byte_stream[pos * byte_width]));
75 return *(
reinterpret_cast<const uint64_t*
>(&byte_stream[pos * byte_width]));
84 return std::numeric_limits<int64_t>::min() + 1;
92 const int32_t byte_width,
99 const int32_t byte_width,
106 const int32_t byte_width,
107 const int64_t baseline,
114 #ifdef WITH_DECODERS_BOUNDS_CHECKING
116 #endif // WITH_DECODERS_BOUNDS_CHECKING
117 return *(
reinterpret_cast<const float*
>(&byte_stream[pos *
sizeof(float)]));
127 #ifdef WITH_DECODERS_BOUNDS_CHECKING
129 #endif // WITH_DECODERS_BOUNDS_CHECKING
130 return *(
reinterpret_cast<const double*
>(&byte_stream[pos *
sizeof(double)]));
140 const int32_t byte_width,
141 const int32_t null_val,
142 const int64_t ret_null_val,
145 return val == null_val ? ret_null_val : val *
kSecsPerDay;
150 const int32_t byte_width,
151 const int32_t null_val,
152 const int64_t ret_null_val,
155 byte_stream, byte_width, null_val, ret_null_val, pos);
160 const int32_t ret_null_val,
161 const int64_t null_val) {
162 return cur_col_val == null_val ? ret_null_val : cur_col_val /
kSecsPerDay;
167 const int32_t ret_null_val,
168 const int64_t null_val) {
169 return cur_col_val == null_val ? ret_null_val : cur_col_val *
kSecsPerDay;
174 const int32_t ret_null_val,
175 const int64_t null_val) {
181 #endif // QUERYENGINE_DECODERSIMPL_H
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 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 ALWAYS_INLINE double SUFFIX() fixed_width_double_decode(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 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_unsigned_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
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_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 NEVER_INLINE float SUFFIX() fixed_width_float_decode_noinline(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 float SUFFIX() fixed_width_float_decode(const int8_t *byte_stream, const int64_t pos)
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)
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)