OmniSciDB  b24e664e58
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DecodersImpl.h File Reference
#include <cstdint>
#include "../Shared/funcannotations.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)
 

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 97 of file DecodersImpl.h.

References fixed_width_int_decode(), and SUFFIX.

100  {
101  return SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos) + baseline;
102 }
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 double SUFFIX() fixed_width_double_decode ( const int8_t *  byte_stream,
const int64_t  pos 
)

Definition at line 118 of file DecodersImpl.h.

References assert().

Referenced by fixed_width_double_decode_noinline().

118  {
119 #ifdef WITH_DECODERS_BOUNDS_CHECKING
120  assert(pos >= 0);
121 #endif // WITH_DECODERS_BOUNDS_CHECKING
122  return *(reinterpret_cast<const double*>(&byte_stream[pos * sizeof(double)]));
123 }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ 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 126 of file DecodersImpl.h.

References fixed_width_double_decode(), and SUFFIX.

Referenced by compute_bucket_sizes_impl(), lazy_decode(), and OverlapsKeyHandler::operator()().

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

+ 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 105 of file DecodersImpl.h.

References assert().

Referenced by fixed_width_float_decode_noinline().

105  {
106 #ifdef WITH_DECODERS_BOUNDS_CHECKING
107  assert(pos >= 0);
108 #endif // WITH_DECODERS_BOUNDS_CHECKING
109  return *(reinterpret_cast<const float*>(&byte_stream[pos * sizeof(float)]));
110 }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ 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 113 of file DecodersImpl.h.

References fixed_width_float_decode(), and SUFFIX.

Referenced by lazy_decode().

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

+ 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.

References assert().

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  return std::numeric_limits<int64_t>::min() + 1;
52 #endif
53  }
54 }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ 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 83 of file DecodersImpl.h.

References fixed_width_int_decode(), and SUFFIX.

Referenced by get_join_column_element_value(), and lazy_decode().

85  {
86  return SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos);
87 }
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 131 of file DecodersImpl.h.

References fixed_width_int_decode(), and SUFFIX.

Referenced by fixed_width_small_date_decode_noinline().

135  {
136  auto val = SUFFIX(fixed_width_int_decode)(byte_stream, byte_width, pos);
137  return val == null_val ? ret_null_val : val * 86400;
138 }
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 141 of file DecodersImpl.h.

References fixed_width_small_date_decode(), and SUFFIX.

Referenced by get_join_column_element_value(), and lazy_decode().

145  {
147  byte_stream, byte_width, null_val, ret_null_val, pos);
148 }
#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:131

+ 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 57 of file DecodersImpl.h.

References assert().

Referenced by fixed_width_unsigned_decode_noinline().

59  {
60 #ifdef WITH_DECODERS_BOUNDS_CHECKING
61  assert(pos >= 0);
62 #endif // WITH_DECODERS_BOUNDS_CHECKING
63  switch (byte_width) {
64  case 1:
65  return reinterpret_cast<const uint8_t*>(byte_stream)[pos * byte_width];
66  case 2:
67  return *(reinterpret_cast<const uint16_t*>(&byte_stream[pos * byte_width]));
68  case 4:
69  return *(reinterpret_cast<const uint32_t*>(&byte_stream[pos * byte_width]));
70  case 8:
71  return *(reinterpret_cast<const uint64_t*>(&byte_stream[pos * byte_width]));
72  default:
73 // TODO(alex)
74 #ifdef __CUDACC__
75  return -1;
76 #else
77  return std::numeric_limits<int64_t>::min() + 1;
78 #endif
79  }
80 }
int64_t const int32_t sz assert(dest)

+ Here is the call graph for this function:

+ 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 90 of file DecodersImpl.h.

References fixed_width_unsigned_decode(), and SUFFIX.

Referenced by get_join_column_element_value(), and lazy_decode().

92  {
93  return SUFFIX(fixed_width_unsigned_decode)(byte_stream, byte_width, pos);
94 }
#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:57

+ Here is the call graph for this function:

+ Here is the caller graph for this function: