17 #ifndef QUERYENGINE_RUNTIMEFUNCTIONS_H 18 #define QUERYENGINE_RUNTIMEFUNCTIONS_H 24 #include <type_traits> 26 extern "C" int64_t
agg_sum(int64_t* agg,
const int64_t val);
28 extern "C" void agg_max(int64_t* agg,
const int64_t val);
30 extern "C" void agg_min(int64_t* agg,
const int64_t val);
40 const int32_t skip_val);
44 const int64_t skip_val);
46 extern "C" void agg_max_skip_val(int64_t* agg,
const int64_t val,
const int64_t skip_val);
48 extern "C" void agg_min_skip_val(int64_t* agg,
const int64_t val,
const int64_t skip_val);
52 const float skip_val);
56 const double skip_val);
60 const double skip_val);
64 const double skip_val);
66 extern "C" int32_t
agg_sum_int32(int32_t* agg,
const int32_t val);
68 extern "C" void agg_max_int32(int32_t* agg,
const int32_t val);
69 extern "C" void agg_max_int16(int16_t* agg,
const int16_t val);
70 extern "C" void agg_max_int8(int8_t* agg,
const int8_t val);
72 extern "C" void agg_min_int32(int32_t* agg,
const int32_t val);
73 extern "C" void agg_min_int16(int16_t* agg,
const int16_t val);
74 extern "C" void agg_min_int8(int8_t* agg,
const int8_t val);
84 const int32_t skip_val);
87 const int16_t skip_val);
90 const int8_t skip_val);
94 const int32_t skip_val);
97 const int16_t skip_val);
100 const int8_t skip_val);
104 const float skip_val);
108 const float skip_val);
112 const int64_t min_val);
114 #define EMPTY_KEY_64 std::numeric_limits<int64_t>::max() 115 #define EMPTY_KEY_32 std::numeric_limits<int32_t>::max() 116 #define EMPTY_KEY_16 std::numeric_limits<int16_t>::max() 117 #define EMPTY_KEY_8 std::numeric_limits<int8_t>::max() 119 extern "C" uint32_t
key_hash(
const int64_t* key,
120 const uint32_t key_qw_count,
121 const uint32_t key_byte_width);
124 const uint32_t groups_buffer_entry_count,
126 const uint32_t key_count,
127 const uint32_t key_width,
128 const uint32_t row_size_quad);
137 int64_t* groups_buffer,
138 const uint32_t groups_buffer_entry_count,
140 const uint32_t key_count,
141 const uint32_t key_width,
142 const uint32_t row_size_quad);
145 const uint32_t groups_buffer_entry_count,
147 const uint32_t key_qw_count);
150 int64_t* groups_buffer,
151 const uint32_t groups_buffer_entry_count,
153 const uint32_t key_qw_count);
157 const int64_t min_key,
158 const int64_t bucket,
159 const uint32_t row_size_quad);
163 const int64_t orig_key,
164 const int64_t min_key,
165 const int64_t bucket,
166 const uint32_t row_size_quad);
170 const int64_t min_key,
171 const int64_t bucket);
176 const uint32_t key_qw_count,
177 const uint32_t row_size_quad);
180 int64_t* groups_buffer,
181 const uint32_t hashed_index,
182 const uint32_t row_size_quad);
186 const int64_t min_key,
187 const int64_t bucket_normalization = 1);
191 const int64_t min_key);
195 const int64_t min_key,
196 const uint32_t entry_count_per_shard,
197 const uint32_t num_shards,
198 const uint32_t device_count);
202 const int64_t min_key,
203 const uint32_t entry_count_per_shard,
204 const uint32_t num_shards,
205 const uint32_t device_count,
206 const int64_t bucket_normalization);
210 const int64_t min_key,
211 const uint32_t entry_count_per_shard,
212 const uint32_t shard,
213 const uint32_t num_shards,
214 const uint32_t device_count);
219 const int64_t min_key,
220 const uint32_t entry_count_per_shard,
221 const uint32_t shard,
222 const uint32_t num_shards,
223 const uint32_t device_count,
224 const int64_t bucket_normalization);
227 const uint32_t bitmap_bytes,
228 const uint8_t* key_bytes,
229 const uint32_t key_len);
235 const int32_t byte_width,
239 const int32_t byte_width,
249 const int32_t byte_width,
250 const int32_t null_val,
251 const int64_t ret_null_val,
258 template <
typename T =
int64_t>
260 static_assert(std::is_same<T, int64_t>::value,
261 "Unsupported template parameter other than int64_t for now");
270 #endif // QUERYENGINE_RUNTIMEFUNCTIONS_H int32_t agg_sum_int32(int32_t *agg, const int32_t val)
int64_t fixed_width_int_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
uint32_t get_columnar_group_bin_offset(int64_t *key_base_ptr, const int64_t key, const int64_t min_key, const int64_t bucket)
int64_t * get_group_value_columnar(int64_t *groups_buffer, const uint32_t groups_buffer_entry_count, const int64_t *key, const uint32_t key_qw_count)
int8_t * extract_str_ptr_noinline(const uint64_t str_and_len)
void agg_max_skip_val(int64_t *agg, const int64_t val, const int64_t skip_val)
int64_t * get_group_value_fast(int64_t *groups_buffer, const int64_t key, const int64_t min_key, const int64_t bucket, const uint32_t row_size_quad)
int32_t * get_bucketized_hash_slot_sharded_opt(int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t shard, const uint32_t num_shards, const uint32_t device_count, const int64_t bucket_normalization)
void agg_min_int32_skip_val(int32_t *agg, const int32_t val, const int32_t skip_val)
void agg_max_int8_skip_val(int8_t *agg, const int8_t val, const int8_t skip_val)
void agg_min_int32(int32_t *agg, const int32_t val)
void agg_max_double_skip_val(int64_t *agg, const double val, const double skip_val)
void agg_min(int64_t *agg, const int64_t val)
void agg_min_skip_val(int64_t *agg, const int64_t val, const int64_t skip_val)
int64_t agg_sum_skip_val(int64_t *agg, const int64_t val, const int64_t skip_val)
int32_t * get_bucketized_hash_slot(int32_t *buff, const int64_t key, const int64_t min_key, const int64_t bucket_normalization=1)
void agg_max_double(int64_t *agg, const double val)
void agg_max_int16(int16_t *agg, const int16_t val)
bool check_interrupt_init(unsigned command)
void agg_min_int8(int8_t *agg, const int8_t val)
void agg_min_int16_skip_val(int16_t *agg, const int16_t val, const int16_t skip_val)
void agg_min_double(int64_t *agg, const double val)
float fixed_width_float_decode_noinline(const int8_t *byte_stream, const int64_t pos)
uint32_t key_hash(const int64_t *key, const uint32_t key_qw_count, const uint32_t key_byte_width)
void agg_max_int32_skip_val(int32_t *agg, const int32_t val, const int32_t skip_val)
void agg_sum_double(int64_t *agg, const double val)
void agg_max_int16_skip_val(int16_t *agg, const int16_t val, const int16_t skip_val)
int64_t * get_group_value_fast_with_original_key(int64_t *groups_buffer, const int64_t key, const int64_t orig_key, const int64_t min_key, const int64_t bucket, const uint32_t row_size_quad)
int32_t * get_hash_slot(int32_t *buff, const int64_t key, const int64_t min_key)
int32_t * get_hash_slot_sharded_opt(int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t shard, const uint32_t num_shards, const uint32_t device_count)
int32_t extract_str_len_noinline(const uint64_t str_and_len)
void agg_min_int16(int16_t *agg, const int16_t val)
void agg_min_double_skip_val(int64_t *agg, const double val, const double skip_val)
void linear_probabilistic_count(uint8_t *bitmap, const uint32_t bitmap_bytes, const uint8_t *key_bytes, const uint32_t key_len)
void agg_min_float_skip_val(int32_t *agg, const float val, const float skip_val)
void agg_max_float_skip_val(int32_t *agg, const float val, const float skip_val)
void agg_count_distinct_bitmap(int64_t *agg, const int64_t val, const int64_t min_val)
int64_t * get_group_value_with_watchdog(int64_t *groups_buffer, const uint32_t groups_buffer_entry_count, const int64_t *key, const uint32_t key_count, const uint32_t key_width, const uint32_t row_size_quad)
double fixed_width_double_decode_noinline(const int8_t *byte_stream, const int64_t pos)
int64_t * get_group_value_columnar_with_watchdog(int64_t *groups_buffer, const uint32_t groups_buffer_entry_count, const int64_t *key, const uint32_t key_qw_count)
int64_t * get_matching_group_value_perfect_hash(int64_t *groups_buffer, const uint32_t h, const int64_t *key, const uint32_t key_qw_count, const uint32_t row_size_quad)
void agg_min_int8_skip_val(int8_t *agg, const int8_t val, const int8_t skip_val)
void agg_sum_float(int32_t *agg, const float val)
void agg_max_int32(int32_t *agg, const int32_t val)
void agg_max(int64_t *agg, const int64_t val)
void agg_max_float(int32_t *agg, const float val)
int32_t * get_bucketized_hash_slot_sharded(int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t num_shards, const uint32_t device_count, const int64_t bucket_normalization)
int64_t * get_group_value(int64_t *groups_buffer, const uint32_t groups_buffer_entry_count, const int64_t *key, const uint32_t key_count, const uint32_t key_width, const uint32_t row_size_quad)
void agg_sum_double_skip_val(int64_t *agg, const double val, const double skip_val)
void agg_min_float(int32_t *agg, const float val)
int32_t * get_hash_slot_sharded(int32_t *buff, const int64_t key, const int64_t min_key, const uint32_t entry_count_per_shard, const uint32_t num_shards, const uint32_t device_count)
int64_t * get_matching_group_value_perfect_hash_keyless(int64_t *groups_buffer, const uint32_t hashed_index, const uint32_t row_size_quad)
int32_t agg_sum_int32_skip_val(int32_t *agg, const int32_t val, const int32_t skip_val)
void agg_max_int8(int8_t *agg, const int8_t val)
int64_t fixed_width_unsigned_decode_noinline(const int8_t *byte_stream, const int32_t byte_width, const int64_t pos)
void agg_sum_float_skip_val(int32_t *agg, const float val, const float skip_val)
int64_t 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)
int64_t agg_sum(int64_t *agg, const int64_t val)