OmniSciDB  ab4938a6a3
RuntimeFunctions.cpp File Reference
#include "RuntimeFunctions.h"
#include "../Shared/funcannotations.h"
#include "BufferCompaction.h"
#include "HyperLogLogRank.h"
#include "MurmurHash.h"
#include "TypePunning.h"
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cmath>
#include <cstring>
#include <thread>
#include <tuple>
#include "DecodersImpl.h"
#include "GroupByRuntime.cpp"
#include "JoinHashTableQueryRuntime.cpp"
#include "TopKRuntime.cpp"
+ Include dependency graph for RuntimeFunctions.cpp:

Go to the source code of this file.

Macros

#define DEF_ARITH_NULLABLE(type, null_type, opname, opsym)
 
#define DEF_ARITH_NULLABLE_LHS(type, null_type, opname, opsym)
 
#define DEF_ARITH_NULLABLE_RHS(type, null_type, opname, opsym)
 
#define DEF_CMP_NULLABLE(type, null_type, opname, opsym)
 
#define DEF_CMP_NULLABLE_LHS(type, null_type, opname, opsym)
 
#define DEF_CMP_NULLABLE_RHS(type, null_type, opname, opsym)
 
#define DEF_SAFE_DIV_NULLABLE(type, null_type, opname)
 
#define DEF_BINARY_NULLABLE_ALL_OPS(type, null_type)
 
#define DEF_UMINUS_NULLABLE(type, null_type)
 
#define DEF_CAST_NULLABLE(from_type, to_type)
 
#define DEF_CAST_NULLABLE_BIDIR(type1, type2)
 
#define GPU_RT_STUB   NEVER_INLINE __attribute__((optnone))
 
#define DEF_AGG_MAX_INT(n)
 
#define DEF_AGG_MIN_INT(n)
 
#define DEF_AGG_ID_INT(n)
 
#define DEF_CHECKED_SINGLE_AGG_ID_INT(n)
 
#define DEF_WRITE_PROJECTION_INT(n)
 
#define DEF_SKIP_AGG_ADD(base_agg_func)
 
#define DEF_SKIP_AGG(base_agg_func)
 
#define DATA_T   int64_t
 
#define DATA_T   int32_t
 
#define DATA_T   int16_t
 
#define DATA_T   int8_t
 
#define DEF_SKIP_AGG_ADD(base_agg_func)
 
#define DEF_SKIP_AGG(base_agg_func)
 
#define DATA_T   double
 
#define ADDR_T   int64_t
 
#define DATA_T   float
 
#define ADDR_T   int32_t
 
#define DEF_SHARED_AGG_RET_STUBS(base_agg_func)
 
#define DEF_SHARED_AGG_STUBS(base_agg_func)
 

Functions

ALWAYS_INLINE int64_t scale_decimal_up (const int64_t operand, const uint64_t scale, const int64_t operand_null_val, const int64_t result_null_val)
 
ALWAYS_INLINE int64_t scale_decimal_down_nullable (const int64_t operand, const int64_t scale, const int64_t null_val)
 
ALWAYS_INLINE int64_t scale_decimal_down_not_nullable (const int64_t operand, const int64_t scale, const int64_t null_val)
 
ALWAYS_INLINE int8_t logical_not (const int8_t operand, const int8_t null_val)
 
ALWAYS_INLINE int8_t logical_and (const int8_t lhs, const int8_t rhs, const int8_t null_val)
 
ALWAYS_INLINE int8_t logical_or (const int8_t lhs, const int8_t rhs, const int8_t null_val)
 
ALWAYS_INLINE uint64_t agg_count (uint64_t *agg, const int64_t)
 
ALWAYS_INLINE void agg_count_distinct_bitmap (int64_t *agg, const int64_t val, const int64_t min_val)
 
GPU_RT_STUB void agg_count_distinct_bitmap_gpu (int64_t *, const int64_t, const int64_t, const int64_t, const int64_t, const uint64_t, const uint64_t)
 
NEVER_INLINE void agg_approximate_count_distinct (int64_t *agg, const int64_t key, const uint32_t b)
 
GPU_RT_STUB void agg_approximate_count_distinct_gpu (int64_t *, const int64_t, const uint32_t, const int64_t, const int64_t)
 
ALWAYS_INLINE int8_t bit_is_set (const int64_t bitset, const int64_t val, const int64_t min_val, const int64_t max_val, const int64_t null_val, const int8_t null_bool_val)
 
ALWAYS_INLINE int64_t agg_sum (int64_t *agg, const int64_t val)
 
ALWAYS_INLINE void agg_max (int64_t *agg, const int64_t val)
 
ALWAYS_INLINE void agg_min (int64_t *agg, const int64_t val)
 
ALWAYS_INLINE void agg_id (int64_t *agg, const int64_t val)
 
ALWAYS_INLINE int32_t checked_single_agg_id (int64_t *agg, const int64_t val, const int64_t null_val)
 
ALWAYS_INLINE void agg_count_distinct_bitmap_skip_val (int64_t *agg, const int64_t val, const int64_t min_val, const int64_t skip_val)
 
GPU_RT_STUB void agg_count_distinct_bitmap_skip_val_gpu (int64_t *, const int64_t, const int64_t, const int64_t, const int64_t, const int64_t, const uint64_t, const uint64_t)
 
ALWAYS_INLINE uint32_t agg_count_int32 (uint32_t *agg, const int32_t)
 
ALWAYS_INLINE int32_t agg_sum_int32 (int32_t *agg, const int32_t val)
 
ALWAYS_INLINE int64_t agg_sum_skip_val (int64_t *agg, const int64_t val, const int64_t skip_val)
 
ALWAYS_INLINE int32_t agg_sum_int32_skip_val (int32_t *agg, const int32_t val, const int32_t skip_val)
 
ALWAYS_INLINE uint64_t agg_count_skip_val (uint64_t *agg, const int64_t val, const int64_t skip_val)
 
ALWAYS_INLINE uint32_t agg_count_int32_skip_val (uint32_t *agg, const int32_t val, const int32_t skip_val)
 
ALWAYS_INLINE uint64_t agg_count_double (uint64_t *agg, const double val)
 
ALWAYS_INLINE void agg_sum_double (int64_t *agg, const double val)
 
ALWAYS_INLINE void agg_max_double (int64_t *agg, const double val)
 
ALWAYS_INLINE void agg_min_double (int64_t *agg, const double val)
 
ALWAYS_INLINE void agg_id_double (int64_t *agg, const double val)
 
ALWAYS_INLINE int32_t checked_single_agg_id_double (int64_t *agg, const double val, const double null_val)
 
ALWAYS_INLINE uint32_t agg_count_float (uint32_t *agg, const float val)
 
ALWAYS_INLINE void agg_sum_float (int32_t *agg, const float val)
 
ALWAYS_INLINE void agg_max_float (int32_t *agg, const float val)
 
ALWAYS_INLINE void agg_min_float (int32_t *agg, const float val)
 
ALWAYS_INLINE void agg_id_float (int32_t *agg, const float val)
 
ALWAYS_INLINE int32_t checked_single_agg_id_float (int32_t *agg, const float val, const float null_val)
 
ALWAYS_INLINE uint64_t agg_count_double_skip_val (uint64_t *agg, const double val, const double skip_val)
 
ALWAYS_INLINE uint32_t agg_count_float_skip_val (uint32_t *agg, const float val, const float skip_val)
 
ALWAYS_INLINE int64_t decimal_floor (const int64_t x, const int64_t scale)
 
ALWAYS_INLINE int64_t decimal_ceil (const int64_t x, const int64_t scale)
 
GPU_RT_STUB int32_t checked_single_agg_id_shared (int64_t *agg, const int64_t val, const int64_t null_val)
 
GPU_RT_STUB int32_t checked_single_agg_id_int32_shared (int32_t *agg, const int32_t val, const int32_t null_val)
 
GPU_RT_STUB int32_t checked_single_agg_id_int16_shared (int16_t *agg, const int16_t val, const int16_t null_val)
 
GPU_RT_STUB int32_t checked_single_agg_id_int8_shared (int8_t *agg, const int8_t val, const int8_t null_val)
 
GPU_RT_STUB int32_t checked_single_agg_id_double_shared (int64_t *agg, const double val, const double null_val)
 
GPU_RT_STUB int32_t checked_single_agg_id_float_shared (int32_t *agg, const float val, const float null_val)
 
GPU_RT_STUB void agg_max_int16_skip_val_shared (int16_t *agg, const int16_t val, const int16_t skip_val)
 
GPU_RT_STUB void agg_max_int8_skip_val_shared (int8_t *agg, const int8_t val, const int8_t skip_val)
 
GPU_RT_STUB void agg_min_int16_skip_val_shared (int16_t *agg, const int16_t val, const int16_t skip_val)
 
GPU_RT_STUB void agg_min_int8_skip_val_shared (int8_t *agg, const int8_t val, const int8_t skip_val)
 
GPU_RT_STUB void agg_id_double_shared_slow (int64_t *agg, const double *val)
 
GPU_RT_STUB int64_t agg_sum_shared (int64_t *agg, const int64_t val)
 
GPU_RT_STUB int64_t agg_sum_skip_val_shared (int64_t *agg, const int64_t val, const int64_t skip_val)
 
GPU_RT_STUB int32_t agg_sum_int32_shared (int32_t *agg, const int32_t val)
 
GPU_RT_STUB int32_t agg_sum_int32_skip_val_shared (int32_t *agg, const int32_t val, const int32_t skip_val)
 
GPU_RT_STUB void agg_sum_double_shared (int64_t *agg, const double val)
 
GPU_RT_STUB void agg_sum_double_skip_val_shared (int64_t *agg, const double val, const double skip_val)
 
GPU_RT_STUB void agg_sum_float_shared (int32_t *agg, const float val)
 
GPU_RT_STUB void agg_sum_float_skip_val_shared (int32_t *agg, const float val, const float skip_val)
 
GPU_RT_STUB void force_sync ()
 
GPU_RT_STUB void sync_warp ()
 
GPU_RT_STUB void sync_warp_protected (int64_t thread_pos, int64_t row_count)
 
GPU_RT_STUB void sync_threadblock ()
 
GPU_RT_STUB void write_back_non_grouped_agg (int64_t *input_buffer, int64_t *output_buffer, const int32_t num_agg_cols)
 
 __attribute__ ((noinline)) int32_t pos_start_impl(int32_t *error_code)
 
GPU_RT_STUB int8_t thread_warp_idx (const int8_t warp_sz)
 
GPU_RT_STUB int64_t get_thread_index ()
 
GPU_RT_STUB int64_t * declare_dynamic_shared_memory ()
 
GPU_RT_STUB int64_t get_block_index ()
 
ALWAYS_INLINE int32_t record_error_code (const int32_t err_code, int32_t *error_codes)
 
int64_t * init_shared_mem (const int64_t *global_groups_buffer, const int32_t groups_buffer_size)
 
template<typename T >
ALWAYS_INLINE int64_t * get_matching_group_value (int64_t *groups_buffer, const uint32_t h, const T *key, const uint32_t key_count, const uint32_t row_size_quad)
 
ALWAYS_INLINE int64_t * get_matching_group_value (int64_t *groups_buffer, const uint32_t h, const int64_t *key, const uint32_t key_count, const uint32_t key_width, const uint32_t row_size_quad, const int64_t *init_vals)
 
template<typename T >
ALWAYS_INLINE int32_t get_matching_group_value_columnar_slot (int64_t *groups_buffer, const uint32_t entry_count, const uint32_t h, const T *key, const uint32_t key_count)
 
ALWAYS_INLINE int32_t get_matching_group_value_columnar_slot (int64_t *groups_buffer, const uint32_t entry_count, const uint32_t h, const int64_t *key, const uint32_t key_count, const uint32_t key_width)
 
ALWAYS_INLINE int64_t * get_matching_group_value_columnar (int64_t *groups_buffer, const uint32_t h, const int64_t *key, const uint32_t key_qw_count, const size_t entry_count)
 
ALWAYS_INLINE int64_t * get_matching_group_value_perfect_hash (int64_t *groups_buffer, const uint32_t hashed_index, const int64_t *key, const uint32_t key_count, const uint32_t row_size_quad)
 
ALWAYS_INLINE int64_t * get_matching_group_value_perfect_hash_keyless (int64_t *groups_buffer, const uint32_t hashed_index, const uint32_t row_size_quad)
 
ALWAYS_INLINE void set_matching_group_value_perfect_hash_columnar (int64_t *groups_buffer, const uint32_t hashed_index, const int64_t *key, const uint32_t key_count, const uint32_t entry_count)
 
ALWAYS_INLINE int64_t * get_group_value_fast_keyless (int64_t *groups_buffer, const int64_t key, const int64_t min_key, const int64_t, const uint32_t row_size_quad)
 
ALWAYS_INLINE int64_t * get_group_value_fast_keyless_semiprivate (int64_t *groups_buffer, const int64_t key, const int64_t min_key, const int64_t, const uint32_t row_size_quad, const uint8_t thread_warp_idx, const uint8_t warp_size)
 
ALWAYS_INLINE int8_t * extract_str_ptr (const uint64_t str_and_len)
 
ALWAYS_INLINE int32_t extract_str_len (const uint64_t str_and_len)
 
ALWAYS_INLINE uint64_t string_pack (const int8_t *ptr, const int32_t len)
 
ALWAYS_INLINE DEVICE int32_t char_length (const char *str, const int32_t str_len)
 
ALWAYS_INLINE DEVICE int32_t char_length_nullable (const char *str, const int32_t str_len, const int32_t int_null)
 
ALWAYS_INLINE DEVICE int32_t key_for_string_encoded (const int32_t str_id)
 
ALWAYS_INLINE int64_t row_number_window_func (const int64_t output_buff, const int64_t pos)
 
ALWAYS_INLINE double percent_window_func (const int64_t output_buff, const int64_t pos)
 
ALWAYS_INLINE double load_double (const int64_t *agg)
 
ALWAYS_INLINE float load_float (const int32_t *agg)
 
ALWAYS_INLINE double load_avg_int (const int64_t *sum, const int64_t *count, const double null_val)
 
ALWAYS_INLINE double load_avg_decimal (const int64_t *sum, const int64_t *count, const double null_val, const uint32_t scale)
 
ALWAYS_INLINE double load_avg_double (const int64_t *agg, const int64_t *count, const double null_val)
 
ALWAYS_INLINE double load_avg_float (const int32_t *agg, const int32_t *count, const double null_val)
 
NEVER_INLINE void linear_probabilistic_count (uint8_t *bitmap, const uint32_t bitmap_bytes, const uint8_t *key_bytes, const uint32_t key_len)
 
void multifrag_query_hoisted_literals (const int8_t ***col_buffers, const uint64_t *num_fragments, const int8_t *literals, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, int32_t *total_matched, const int64_t *init_agg_value, int64_t **out, int32_t *error_code, const uint32_t *num_tables_ptr, const int64_t *join_hash_tables)
 
void multifrag_query (const int8_t ***col_buffers, const uint64_t *num_fragments, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, int32_t *total_matched, const int64_t *init_agg_value, int64_t **out, int32_t *error_code, const uint32_t *num_tables_ptr, const int64_t *join_hash_tables)
 
ALWAYS_INLINE DEVICE bool check_interrupt ()
 
bool check_interrupt_init (unsigned command)
 

Variables

const int32_t groups_buffer_size
 
int64_t * src
 
int64_t const int32_t sz
 
const int64_t * init_vals
 
const int64_t const uint32_t groups_buffer_entry_count
 
const int64_t const uint32_t const uint32_t key_qw_count
 
const int64_t const uint32_t const uint32_t const uint32_t agg_col_count
 
const int64_t const uint32_t const uint32_t const uint32_t const bool keyless
 
const int64_t const uint32_t const uint32_t const uint32_t const bool const int8_t warp_size
 
const int64_t const uint32_t const uint32_t const uint32_t const bool const bool blocks_share_memory
 
const int64_t const uint32_t const uint32_t const uint32_t const bool const bool const int32_t frag_idx
 
const int8_t * literals
 
const int8_t const int64_t * num_rows
 
const int8_t const int64_t const uint64_t * frag_row_offsets
 
const int8_t const int64_t const uint64_t const int32_t * max_matched
 
const int8_t const int64_t const uint64_t const int32_t const int64_t * init_agg_value
 
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t ** out
 
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t * join_hash_tables
 
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
 
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t int32_t * total_matched
 

Macro Definition Documentation

◆ ADDR_T [1/2]

#define ADDR_T   int64_t

Definition at line 691 of file RuntimeFunctions.cpp.

◆ ADDR_T [2/2]

#define ADDR_T   int32_t

Definition at line 691 of file RuntimeFunctions.cpp.

◆ DATA_T [1/6]

#define DATA_T   int64_t

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DATA_T [2/6]

#define DATA_T   int32_t

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DATA_T [3/6]

#define DATA_T   int16_t

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DATA_T [4/6]

#define DATA_T   int8_t

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DATA_T [5/6]

#define DATA_T   double

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DATA_T [6/6]

#define DATA_T   float

Definition at line 690 of file RuntimeFunctions.cpp.

◆ DEF_AGG_ID_INT

#define DEF_AGG_ID_INT (   n)
Value:
extern "C" ALWAYS_INLINE void agg_id_int##n(int##n##_t* agg, const int##n##_t val) { \
*agg = val; \
}
#define ALWAYS_INLINE

Definition at line 424 of file RuntimeFunctions.cpp.

◆ DEF_AGG_MAX_INT

#define DEF_AGG_MAX_INT (   n)
Value:
extern "C" ALWAYS_INLINE void agg_max_int##n(int##n##_t* agg, const int##n##_t val) { \
*agg = std::max(*agg, val); \
}
#define ALWAYS_INLINE

Definition at line 404 of file RuntimeFunctions.cpp.

◆ DEF_AGG_MIN_INT

#define DEF_AGG_MIN_INT (   n)
Value:
extern "C" ALWAYS_INLINE void agg_min_int##n(int##n##_t* agg, const int##n##_t val) { \
*agg = std::min(*agg, val); \
}
#define ALWAYS_INLINE

Definition at line 414 of file RuntimeFunctions.cpp.

◆ DEF_ARITH_NULLABLE

#define DEF_ARITH_NULLABLE (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE type opname##_##type##_nullable( \
const type lhs, const type rhs, const null_type null_val) { \
if (lhs != null_val && rhs != null_val) { \
return lhs opsym rhs; \
} \
return null_val; \
}
#define ALWAYS_INLINE

Definition at line 42 of file RuntimeFunctions.cpp.

◆ DEF_ARITH_NULLABLE_LHS

#define DEF_ARITH_NULLABLE_LHS (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE type opname##_##type##_nullable_lhs( \
const type lhs, const type rhs, const null_type null_val) { \
if (lhs != null_val) { \
return lhs opsym rhs; \
} \
return null_val; \
}
#define ALWAYS_INLINE

Definition at line 51 of file RuntimeFunctions.cpp.

◆ DEF_ARITH_NULLABLE_RHS

#define DEF_ARITH_NULLABLE_RHS (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE type opname##_##type##_nullable_rhs( \
const type lhs, const type rhs, const null_type null_val) { \
if (rhs != null_val) { \
return lhs opsym rhs; \
} \
return null_val; \
}
#define ALWAYS_INLINE

Definition at line 60 of file RuntimeFunctions.cpp.

◆ DEF_BINARY_NULLABLE_ALL_OPS

#define DEF_BINARY_NULLABLE_ALL_OPS (   type,
  null_type 
)

Definition at line 114 of file RuntimeFunctions.cpp.

◆ DEF_CAST_NULLABLE

#define DEF_CAST_NULLABLE (   from_type,
  to_type 
)
Value:
extern "C" ALWAYS_INLINE to_type cast_##from_type##_to_##to_type##_nullable( \
const from_type operand, \
const from_type from_null_val, \
const to_type to_null_val) { \
return operand == from_null_val ? to_null_val : operand; \
}
#define ALWAYS_INLINE

Definition at line 218 of file RuntimeFunctions.cpp.

◆ DEF_CAST_NULLABLE_BIDIR

#define DEF_CAST_NULLABLE_BIDIR (   type1,
  type2 
)
Value:
DEF_CAST_NULLABLE(type1, type2) \
DEF_CAST_NULLABLE(type2, type1)
#define DEF_CAST_NULLABLE(from_type, to_type)

Definition at line 226 of file RuntimeFunctions.cpp.

◆ DEF_CHECKED_SINGLE_AGG_ID_INT

#define DEF_CHECKED_SINGLE_AGG_ID_INT (   n)
Value:
extern "C" ALWAYS_INLINE int32_t checked_single_agg_id_int##n( \
int##n##_t* agg, const int##n##_t val, const int##n##_t null_val) { \
if (val == null_val) { \
return 0; \
} \
if (*agg == val) { \
return 0; \
} else if (*agg == null_val) { \
*agg = val; \
return 0; \
} else { \
/* see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES*/ \
return 15; \
} \
}
#define ALWAYS_INLINE

Definition at line 429 of file RuntimeFunctions.cpp.

◆ DEF_CMP_NULLABLE

#define DEF_CMP_NULLABLE (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE int8_t opname##_##type##_nullable( \
const type lhs, \
const type rhs, \
const null_type null_val, \
const int8_t null_bool_val) { \
if (lhs != null_val && rhs != null_val) { \
return lhs opsym rhs; \
} \
return null_bool_val; \
}
#define ALWAYS_INLINE

Definition at line 69 of file RuntimeFunctions.cpp.

◆ DEF_CMP_NULLABLE_LHS

#define DEF_CMP_NULLABLE_LHS (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE int8_t opname##_##type##_nullable_lhs( \
const type lhs, \
const type rhs, \
const null_type null_val, \
const int8_t null_bool_val) { \
if (lhs != null_val) { \
return lhs opsym rhs; \
} \
return null_bool_val; \
}
#define ALWAYS_INLINE

Definition at line 81 of file RuntimeFunctions.cpp.

◆ DEF_CMP_NULLABLE_RHS

#define DEF_CMP_NULLABLE_RHS (   type,
  null_type,
  opname,
  opsym 
)
Value:
extern "C" ALWAYS_INLINE int8_t opname##_##type##_nullable_rhs( \
const type lhs, \
const type rhs, \
const null_type null_val, \
const int8_t null_bool_val) { \
if (rhs != null_val) { \
return lhs opsym rhs; \
} \
return null_bool_val; \
}
#define ALWAYS_INLINE

Definition at line 93 of file RuntimeFunctions.cpp.

◆ DEF_SAFE_DIV_NULLABLE

#define DEF_SAFE_DIV_NULLABLE (   type,
  null_type,
  opname 
)
Value:
extern "C" ALWAYS_INLINE type safe_div_##type( \
const type lhs, const type rhs, const null_type null_val) { \
if (lhs != null_val && rhs != null_val && rhs != 0) { \
return lhs / rhs; \
} \
return null_val; \
}
#define ALWAYS_INLINE

Definition at line 105 of file RuntimeFunctions.cpp.

◆ DEF_SHARED_AGG_RET_STUBS

#define DEF_SHARED_AGG_RET_STUBS (   base_agg_func)

Definition at line 717 of file RuntimeFunctions.cpp.

◆ DEF_SHARED_AGG_STUBS

#define DEF_SHARED_AGG_STUBS (   base_agg_func)
Value:
extern "C" GPU_RT_STUB void base_agg_func##_shared(int64_t* agg, const int64_t val) {} \
\
extern "C" GPU_RT_STUB void base_agg_func##_skip_val_shared( \
int64_t* agg, const int64_t val, const int64_t skip_val) {} \
extern "C" GPU_RT_STUB void base_agg_func##_int32_shared(int32_t* agg, \
const int32_t val) {} \
extern "C" GPU_RT_STUB void base_agg_func##_int16_shared(int16_t* agg, \
const int16_t val) {} \
extern "C" GPU_RT_STUB void base_agg_func##_int8_shared(int8_t* agg, \
const int8_t val) {} \
\
extern "C" GPU_RT_STUB void base_agg_func##_int32_skip_val_shared( \
int32_t* agg, const int32_t val, const int32_t skip_val) {} \
\
extern "C" GPU_RT_STUB void base_agg_func##_double_shared(int64_t* agg, \
const double val) {} \
\
extern "C" GPU_RT_STUB void base_agg_func##_double_skip_val_shared( \
int64_t* agg, const double val, const double skip_val) {} \
extern "C" GPU_RT_STUB void base_agg_func##_float_shared(int32_t* agg, \
const float val) {} \
\
extern "C" GPU_RT_STUB void base_agg_func##_float_skip_val_shared( \
int32_t* agg, const float val, const float skip_val) {}
#define GPU_RT_STUB

Definition at line 756 of file RuntimeFunctions.cpp.

◆ DEF_SKIP_AGG [1/2]

#define DEF_SKIP_AGG (   base_agg_func)
Value:
extern "C" ALWAYS_INLINE void base_agg_func##_skip_val( \
DATA_T* agg, const DATA_T val, const DATA_T skip_val) { \
if (val != skip_val) { \
const DATA_T old_agg = *agg; \
if (old_agg != skip_val) { \
base_agg_func(agg, val); \
} else { \
*agg = val; \
} \
} \
}
#define DATA_T
#define ALWAYS_INLINE

Definition at line 669 of file RuntimeFunctions.cpp.

Referenced by agg_count_int32_skip_val().

◆ DEF_SKIP_AGG [2/2]

#define DEF_SKIP_AGG (   base_agg_func)
Value:
extern "C" ALWAYS_INLINE void base_agg_func##_skip_val( \
ADDR_T* agg, const DATA_T val, const DATA_T skip_val) { \
if (val != skip_val) { \
const ADDR_T old_agg = *agg; \
if (old_agg != *reinterpret_cast<const ADDR_T*>(may_alias_ptr(&skip_val))) { \
base_agg_func(agg, val); \
} else { \
*agg = *reinterpret_cast<const ADDR_T*>(may_alias_ptr(&val)); \
} \
} \
}
#define ADDR_T
#define DATA_T
#define ALWAYS_INLINE

Definition at line 669 of file RuntimeFunctions.cpp.

◆ DEF_SKIP_AGG_ADD [1/2]

#define DEF_SKIP_AGG_ADD (   base_agg_func)
Value:
extern "C" ALWAYS_INLINE void base_agg_func##_skip_val( \
DATA_T* agg, const DATA_T val, const DATA_T skip_val) { \
if (val != skip_val) { \
base_agg_func(agg, val); \
} \
}
#define DATA_T
#define ALWAYS_INLINE

Definition at line 661 of file RuntimeFunctions.cpp.

◆ DEF_SKIP_AGG_ADD [2/2]

#define DEF_SKIP_AGG_ADD (   base_agg_func)
Value:
extern "C" ALWAYS_INLINE void base_agg_func##_skip_val( \
ADDR_T* agg, const DATA_T val, const DATA_T skip_val) { \
if (val != skip_val) { \
base_agg_func(agg, val); \
} \
}
#define ADDR_T
#define DATA_T
#define ALWAYS_INLINE

Definition at line 661 of file RuntimeFunctions.cpp.

◆ DEF_UMINUS_NULLABLE

#define DEF_UMINUS_NULLABLE (   type,
  null_type 
)
Value:
extern "C" ALWAYS_INLINE type uminus_##type##_nullable(const type operand, \
const null_type null_val) { \
return operand == null_val ? null_val : -operand; \
}
#define ALWAYS_INLINE

Definition at line 203 of file RuntimeFunctions.cpp.

◆ DEF_WRITE_PROJECTION_INT

#define DEF_WRITE_PROJECTION_INT (   n)
Value:
extern "C" ALWAYS_INLINE void write_projection_int##n( \
int8_t* slot_ptr, const int##n##_t val, const int64_t init_val) { \
if (val != init_val) { \
*reinterpret_cast<int##n##_t*>(slot_ptr) = val; \
} \
}
#define ALWAYS_INLINE

Definition at line 457 of file RuntimeFunctions.cpp.

◆ GPU_RT_STUB

Function Documentation

◆ __attribute__()

__attribute__ ( (noinline)  )

Definition at line 883 of file RuntimeFunctions.cpp.

Referenced by extract_str_len(), init_shared_mem(), linear_probabilistic_count(), multifrag_query_hoisted_literals(), and record_error_code().

883  {
884  int32_t row_index_resume{0};
885  if (error_code) {
886  row_index_resume = error_code[0];
887  error_code[0] = 0;
888  }
889  return row_index_resume;
890 }
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
+ Here is the caller graph for this function:

◆ agg_approximate_count_distinct()

NEVER_INLINE void agg_approximate_count_distinct ( int64_t *  agg,
const int64_t  key,
const uint32_t  b 
)

Definition at line 302 of file RuntimeFunctions.cpp.

References get_rank(), and MurmurHash64A().

304  {
305  const uint64_t hash = MurmurHash64A(&key, sizeof(key), 0);
306  const uint32_t index = hash >> (64 - b);
307  const uint8_t rank = get_rank(hash << b, 64 - b);
308  uint8_t* M = reinterpret_cast<uint8_t*>(*agg);
309  M[index] = std::max(M[index], rank);
310 }
FORCE_INLINE uint8_t get_rank(uint64_t x, uint32_t b)
NEVER_INLINE DEVICE uint64_t MurmurHash64A(const void *key, int len, uint64_t seed)
Definition: MurmurHash.cpp:26
+ Here is the call graph for this function:

◆ agg_approximate_count_distinct_gpu()

GPU_RT_STUB void agg_approximate_count_distinct_gpu ( int64_t *  ,
const int64_t  ,
const uint32_t  ,
const int64_t  ,
const int64_t   
)

Definition at line 312 of file RuntimeFunctions.cpp.

316  {}

◆ agg_count()

ALWAYS_INLINE uint64_t agg_count ( uint64_t *  agg,
const int64_t   
)

Definition at line 281 of file RuntimeFunctions.cpp.

Referenced by agg_count_skip_val(), and anonymous_namespace{GroupByAndAggregate.cpp}::get_agg_count().

281  {
282  return (*agg)++;
283 }
+ Here is the caller graph for this function:

◆ agg_count_distinct_bitmap()

ALWAYS_INLINE void agg_count_distinct_bitmap ( int64_t *  agg,
const int64_t  val,
const int64_t  min_val 
)

Definition at line 285 of file RuntimeFunctions.cpp.

Referenced by agg_count_distinct_bitmap_skip_val(), WindowFunctionContext::fillPartitionEnd(), WindowFunctionContext::fillPartitionStart(), anonymous_namespace{WindowContext.cpp}::index_to_partition_end(), and InValuesBitmap::InValuesBitmap().

287  {
288  const uint64_t bitmap_idx = val - min_val;
289  reinterpret_cast<int8_t*>(*agg)[bitmap_idx >> 3] |= (1 << (bitmap_idx & 7));
290 }
+ Here is the caller graph for this function:

◆ agg_count_distinct_bitmap_gpu()

GPU_RT_STUB void agg_count_distinct_bitmap_gpu ( int64_t *  ,
const int64_t  ,
const int64_t  ,
const int64_t  ,
const int64_t  ,
const uint64_t  ,
const uint64_t   
)

Definition at line 294 of file RuntimeFunctions.cpp.

300  {}

◆ agg_count_distinct_bitmap_skip_val()

ALWAYS_INLINE void agg_count_distinct_bitmap_skip_val ( int64_t *  agg,
const int64_t  val,
const int64_t  min_val,
const int64_t  skip_val 
)

Definition at line 376 of file RuntimeFunctions.cpp.

References agg_count_distinct_bitmap().

379  {
380  if (val != skip_val) {
381  agg_count_distinct_bitmap(agg, val, min_val);
382  }
383 }
ALWAYS_INLINE void agg_count_distinct_bitmap(int64_t *agg, const int64_t val, const int64_t min_val)
+ Here is the call graph for this function:

◆ agg_count_distinct_bitmap_skip_val_gpu()

GPU_RT_STUB void agg_count_distinct_bitmap_skip_val_gpu ( int64_t *  ,
const int64_t  ,
const int64_t  ,
const int64_t  ,
const int64_t  ,
const int64_t  ,
const uint64_t  ,
const uint64_t   
)

Definition at line 385 of file RuntimeFunctions.cpp.

392  {}

◆ agg_count_double()

ALWAYS_INLINE uint64_t agg_count_double ( uint64_t *  agg,
const double  val 
)

Definition at line 561 of file RuntimeFunctions.cpp.

Referenced by agg_count_double_skip_val().

561  {
562  return (*agg)++;
563 }
+ Here is the caller graph for this function:

◆ agg_count_double_skip_val()

ALWAYS_INLINE uint64_t agg_count_double_skip_val ( uint64_t *  agg,
const double  val,
const double  skip_val 
)

Definition at line 643 of file RuntimeFunctions.cpp.

References agg_count_double().

645  {
646  if (val != skip_val) {
647  return agg_count_double(agg, val);
648  }
649  return *agg;
650 }
ALWAYS_INLINE uint64_t agg_count_double(uint64_t *agg, const double val)
+ Here is the call graph for this function:

◆ agg_count_float()

ALWAYS_INLINE uint32_t agg_count_float ( uint32_t *  agg,
const float  val 
)

Definition at line 602 of file RuntimeFunctions.cpp.

Referenced by agg_count_float_skip_val().

602  {
603  return (*agg)++;
604 }
+ Here is the caller graph for this function:

◆ agg_count_float_skip_val()

ALWAYS_INLINE uint32_t agg_count_float_skip_val ( uint32_t *  agg,
const float  val,
const float  skip_val 
)

Definition at line 652 of file RuntimeFunctions.cpp.

References agg_count_float().

654  {
655  if (val != skip_val) {
656  return agg_count_float(agg, val);
657  }
658  return *agg;
659 }
ALWAYS_INLINE uint32_t agg_count_float(uint32_t *agg, const float val)
+ Here is the call graph for this function:

◆ agg_count_int32()

ALWAYS_INLINE uint32_t agg_count_int32 ( uint32_t *  agg,
const int32_t   
)

Definition at line 394 of file RuntimeFunctions.cpp.

Referenced by agg_count_int32_skip_val().

394  {
395  return (*agg)++;
396 }
+ Here is the caller graph for this function:

◆ agg_count_int32_skip_val()

ALWAYS_INLINE uint32_t agg_count_int32_skip_val ( uint32_t *  agg,
const int32_t  val,
const int32_t  skip_val 
)

Definition at line 506 of file RuntimeFunctions.cpp.

References agg_count_int32(), agg_max(), agg_max_int16(), agg_max_int32(), agg_max_int8(), agg_min(), agg_min_int16(), agg_min_int32(), agg_min_int8(), and DEF_SKIP_AGG.

508  {
509  if (val != skip_val) {
510  return agg_count_int32(agg, val);
511  }
512  return *agg;
513 }
ALWAYS_INLINE uint32_t agg_count_int32(uint32_t *agg, const int32_t)
+ Here is the call graph for this function:

◆ agg_count_skip_val()

ALWAYS_INLINE uint64_t agg_count_skip_val ( uint64_t *  agg,
const int64_t  val,
const int64_t  skip_val 
)

Definition at line 497 of file RuntimeFunctions.cpp.

References agg_count().

499  {
500  if (val != skip_val) {
501  return agg_count(agg, val);
502  }
503  return *agg;
504 }
ALWAYS_INLINE uint64_t agg_count(uint64_t *agg, const int64_t)
+ Here is the call graph for this function:

◆ agg_id()

ALWAYS_INLINE void agg_id ( int64_t *  agg,
const int64_t  val 
)

Definition at line 354 of file RuntimeFunctions.cpp.

354  {
355  *agg = val;
356 }

◆ agg_id_double()

ALWAYS_INLINE void agg_id_double ( int64_t *  agg,
const double  val 
)

Definition at line 580 of file RuntimeFunctions.cpp.

580  {
581  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)));
582 }

◆ agg_id_double_shared_slow()

GPU_RT_STUB void agg_id_double_shared_slow ( int64_t *  agg,
const double *  val 
)

Definition at line 840 of file RuntimeFunctions.cpp.

840 {}

◆ agg_id_float()

ALWAYS_INLINE void agg_id_float ( int32_t *  agg,
const float  val 
)

Definition at line 621 of file RuntimeFunctions.cpp.

621  {
622  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)));
623 }

◆ agg_max()

ALWAYS_INLINE void agg_max ( int64_t *  agg,
const int64_t  val 
)

Definition at line 346 of file RuntimeFunctions.cpp.

Referenced by agg_count_int32_skip_val().

346  {
347  *agg = std::max(*agg, val);
348 }
+ Here is the caller graph for this function:

◆ agg_max_double()

ALWAYS_INLINE void agg_max_double ( int64_t *  agg,
const double  val 
)

Definition at line 570 of file RuntimeFunctions.cpp.

570  {
571  const auto r = std::max(*reinterpret_cast<const double*>(agg), val);
572  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&r)));
573 }

◆ agg_max_float()

ALWAYS_INLINE void agg_max_float ( int32_t *  agg,
const float  val 
)

Definition at line 611 of file RuntimeFunctions.cpp.

611  {
612  const auto r = std::max(*reinterpret_cast<const float*>(agg), val);
613  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&r)));
614 }

◆ agg_max_int16_skip_val_shared()

GPU_RT_STUB void agg_max_int16_skip_val_shared ( int16_t *  agg,
const int16_t  val,
const int16_t  skip_val 
)

Definition at line 824 of file RuntimeFunctions.cpp.

826  {}

◆ agg_max_int8_skip_val_shared()

GPU_RT_STUB void agg_max_int8_skip_val_shared ( int8_t *  agg,
const int8_t  val,
const int8_t  skip_val 
)

Definition at line 828 of file RuntimeFunctions.cpp.

830  {}

◆ agg_min()

ALWAYS_INLINE void agg_min ( int64_t *  agg,
const int64_t  val 
)

Definition at line 350 of file RuntimeFunctions.cpp.

Referenced by agg_count_int32_skip_val().

350  {
351  *agg = std::min(*agg, val);
352 }
+ Here is the caller graph for this function:

◆ agg_min_double()

ALWAYS_INLINE void agg_min_double ( int64_t *  agg,
const double  val 
)

Definition at line 575 of file RuntimeFunctions.cpp.

575  {
576  const auto r = std::min(*reinterpret_cast<const double*>(agg), val);
577  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&r)));
578 }

◆ agg_min_float()

ALWAYS_INLINE void agg_min_float ( int32_t *  agg,
const float  val 
)

Definition at line 616 of file RuntimeFunctions.cpp.

616  {
617  const auto r = std::min(*reinterpret_cast<const float*>(agg), val);
618  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&r)));
619 }

◆ agg_min_int16_skip_val_shared()

GPU_RT_STUB void agg_min_int16_skip_val_shared ( int16_t *  agg,
const int16_t  val,
const int16_t  skip_val 
)

Definition at line 832 of file RuntimeFunctions.cpp.

834  {}

◆ agg_min_int8_skip_val_shared()

GPU_RT_STUB void agg_min_int8_skip_val_shared ( int8_t *  agg,
const int8_t  val,
const int8_t  skip_val 
)

Definition at line 836 of file RuntimeFunctions.cpp.

838  {}

◆ agg_sum()

ALWAYS_INLINE int64_t agg_sum ( int64_t *  agg,
const int64_t  val 
)

Definition at line 340 of file RuntimeFunctions.cpp.

Referenced by agg_sum_skip_val().

340  {
341  const auto old = *agg;
342  *agg += val;
343  return old;
344 }
+ Here is the caller graph for this function:

◆ agg_sum_double()

ALWAYS_INLINE void agg_sum_double ( int64_t *  agg,
const double  val 
)

Definition at line 565 of file RuntimeFunctions.cpp.

565  {
566  const auto r = *reinterpret_cast<const double*>(agg) + val;
567  *agg = *reinterpret_cast<const int64_t*>(may_alias_ptr(&r));
568 }

◆ agg_sum_double_shared()

GPU_RT_STUB void agg_sum_double_shared ( int64_t *  agg,
const double  val 
)

Definition at line 861 of file RuntimeFunctions.cpp.

861 {}

◆ agg_sum_double_skip_val_shared()

GPU_RT_STUB void agg_sum_double_skip_val_shared ( int64_t *  agg,
const double  val,
const double  skip_val 
)

Definition at line 863 of file RuntimeFunctions.cpp.

865  {}

◆ agg_sum_float()

ALWAYS_INLINE void agg_sum_float ( int32_t *  agg,
const float  val 
)

Definition at line 606 of file RuntimeFunctions.cpp.

606  {
607  const auto r = *reinterpret_cast<const float*>(agg) + val;
608  *agg = *reinterpret_cast<const int32_t*>(may_alias_ptr(&r));
609 }

◆ agg_sum_float_shared()

GPU_RT_STUB void agg_sum_float_shared ( int32_t *  agg,
const float  val 
)

Definition at line 866 of file RuntimeFunctions.cpp.

866 {}

◆ agg_sum_float_skip_val_shared()

GPU_RT_STUB void agg_sum_float_skip_val_shared ( int32_t *  agg,
const float  val,
const float  skip_val 
)

Definition at line 868 of file RuntimeFunctions.cpp.

870  {}

◆ agg_sum_int32()

ALWAYS_INLINE int32_t agg_sum_int32 ( int32_t *  agg,
const int32_t  val 
)

Definition at line 398 of file RuntimeFunctions.cpp.

Referenced by agg_sum_int32_skip_val().

398  {
399  const auto old = *agg;
400  *agg += val;
401  return old;
402 }
+ Here is the caller graph for this function:

◆ agg_sum_int32_shared()

GPU_RT_STUB int32_t agg_sum_int32_shared ( int32_t *  agg,
const int32_t  val 
)

Definition at line 851 of file RuntimeFunctions.cpp.

851  {
852  return 0;
853 }

◆ agg_sum_int32_skip_val()

ALWAYS_INLINE int32_t agg_sum_int32_skip_val ( int32_t *  agg,
const int32_t  val,
const int32_t  skip_val 
)

Definition at line 483 of file RuntimeFunctions.cpp.

References agg_sum_int32().

485  {
486  const auto old = *agg;
487  if (val != skip_val) {
488  if (old != skip_val) {
489  return agg_sum_int32(agg, val);
490  } else {
491  *agg = val;
492  }
493  }
494  return old;
495 }
ALWAYS_INLINE int32_t agg_sum_int32(int32_t *agg, const int32_t val)
+ Here is the call graph for this function:

◆ agg_sum_int32_skip_val_shared()

GPU_RT_STUB int32_t agg_sum_int32_skip_val_shared ( int32_t *  agg,
const int32_t  val,
const int32_t  skip_val 
)

Definition at line 855 of file RuntimeFunctions.cpp.

857  {
858  return 0;
859 }

◆ agg_sum_shared()

GPU_RT_STUB int64_t agg_sum_shared ( int64_t *  agg,
const int64_t  val 
)

Definition at line 842 of file RuntimeFunctions.cpp.

842  {
843  return 0;
844 }

◆ agg_sum_skip_val()

ALWAYS_INLINE int64_t agg_sum_skip_val ( int64_t *  agg,
const int64_t  val,
const int64_t  skip_val 
)

Definition at line 469 of file RuntimeFunctions.cpp.

References agg_sum().

Referenced by Executor::reduceResults().

471  {
472  const auto old = *agg;
473  if (val != skip_val) {
474  if (old != skip_val) {
475  return agg_sum(agg, val);
476  } else {
477  *agg = val;
478  }
479  }
480  return old;
481 }
ALWAYS_INLINE int64_t agg_sum(int64_t *agg, const int64_t val)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ agg_sum_skip_val_shared()

GPU_RT_STUB int64_t agg_sum_skip_val_shared ( int64_t *  agg,
const int64_t  val,
const int64_t  skip_val 
)

Definition at line 846 of file RuntimeFunctions.cpp.

848  {
849  return 0;
850 }

◆ bit_is_set()

ALWAYS_INLINE int8_t bit_is_set ( const int64_t  bitset,
const int64_t  val,
const int64_t  min_val,
const int64_t  max_val,
const int64_t  null_val,
const int8_t  null_bool_val 
)

Definition at line 318 of file RuntimeFunctions.cpp.

323  {
324  if (val == null_val) {
325  return null_bool_val;
326  }
327  if (val < min_val || val > max_val) {
328  return 0;
329  }
330  if (!bitset) {
331  return 0;
332  }
333  const uint64_t bitmap_idx = val - min_val;
334  return (reinterpret_cast<const int8_t*>(bitset))[bitmap_idx >> 3] &
335  (1 << (bitmap_idx & 7))
336  ? 1
337  : 0;
338 }

◆ char_length()

ALWAYS_INLINE DEVICE int32_t char_length ( const char *  str,
const int32_t  str_len 
)

Definition at line 1212 of file RuntimeFunctions.cpp.

Referenced by ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visit().

1213  {
1214  return str_len;
1215 }
+ Here is the caller graph for this function:

◆ char_length_nullable()

ALWAYS_INLINE DEVICE int32_t char_length_nullable ( const char *  str,
const int32_t  str_len,
const int32_t  int_null 
)

Definition at line 1217 of file RuntimeFunctions.cpp.

1219  {
1220  if (!str) {
1221  return int_null;
1222  }
1223  return str_len;
1224 }

◆ check_interrupt()

ALWAYS_INLINE DEVICE bool check_interrupt ( )

Definition at line 1368 of file RuntimeFunctions.cpp.

References check_interrupt_init(), and INT_CHECK.

1368  {
1369  if (check_interrupt_init(static_cast<unsigned>(INT_CHECK))) {
1370  return true;
1371  }
1372  return false;
1373 }
bool check_interrupt_init(unsigned command)
+ Here is the call graph for this function:

◆ check_interrupt_init()

bool check_interrupt_init ( unsigned  command)

Definition at line 1375 of file RuntimeFunctions.cpp.

References INT_ABORT, INT_CHECK, and INT_RESET.

Referenced by check_interrupt(), Executor::interrupt(), and Executor::resetInterrupt().

1375  {
1376  static std::atomic_bool runtime_interrupt_flag{false};
1377 
1378  if (command == static_cast<unsigned>(INT_CHECK)) {
1379  if (runtime_interrupt_flag.load()) {
1380  return true;
1381  }
1382  return false;
1383  }
1384  if (command == static_cast<unsigned>(INT_ABORT)) {
1385  runtime_interrupt_flag.store(true);
1386  return false;
1387  }
1388  if (command == static_cast<unsigned>(INT_RESET)) {
1389  runtime_interrupt_flag.store(false);
1390  return false;
1391  }
1392  return false;
1393 }
+ Here is the caller graph for this function:

◆ checked_single_agg_id()

ALWAYS_INLINE int32_t checked_single_agg_id ( int64_t *  agg,
const int64_t  val,
const int64_t  null_val 
)

Definition at line 358 of file RuntimeFunctions.cpp.

360  {
361  if (val == null_val) {
362  return 0;
363  }
364 
365  if (*agg == val) {
366  return 0;
367  } else if (*agg == null_val) {
368  *agg = val;
369  return 0;
370  } else {
371  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
372  return 15;
373  }
374 }

◆ checked_single_agg_id_double()

ALWAYS_INLINE int32_t checked_single_agg_id_double ( int64_t *  agg,
const double  val,
const double  null_val 
)

Definition at line 584 of file RuntimeFunctions.cpp.

586  {
587  if (val == null_val) {
588  return 0;
589  }
590 
591  if (*agg == *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)))) {
592  return 0;
593  } else if (*agg == *(reinterpret_cast<const int64_t*>(may_alias_ptr(&null_val)))) {
594  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)));
595  return 0;
596  } else {
597  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
598  return 15;
599  }
600 }

◆ checked_single_agg_id_double_shared()

GPU_RT_STUB int32_t checked_single_agg_id_double_shared ( int64_t *  agg,
const double  val,
const double  null_val 
)

Definition at line 812 of file RuntimeFunctions.cpp.

814  {
815  return 0;
816 }

◆ checked_single_agg_id_float()

ALWAYS_INLINE int32_t checked_single_agg_id_float ( int32_t *  agg,
const float  val,
const float  null_val 
)

Definition at line 625 of file RuntimeFunctions.cpp.

627  {
628  if (val == null_val) {
629  return 0;
630  }
631 
632  if (*agg == *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)))) {
633  return 0;
634  } else if (*agg == *(reinterpret_cast<const int32_t*>(may_alias_ptr(&null_val)))) {
635  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)));
636  return 0;
637  } else {
638  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
639  return 15;
640  }
641 }

◆ checked_single_agg_id_float_shared()

GPU_RT_STUB int32_t checked_single_agg_id_float_shared ( int32_t *  agg,
const float  val,
const float  null_val 
)

Definition at line 818 of file RuntimeFunctions.cpp.

820  {
821  return 0;
822 }

◆ checked_single_agg_id_int16_shared()

GPU_RT_STUB int32_t checked_single_agg_id_int16_shared ( int16_t *  agg,
const int16_t  val,
const int16_t  null_val 
)

Definition at line 800 of file RuntimeFunctions.cpp.

802  {
803  return 0;
804 }

◆ checked_single_agg_id_int32_shared()

GPU_RT_STUB int32_t checked_single_agg_id_int32_shared ( int32_t *  agg,
const int32_t  val,
const int32_t  null_val 
)

Definition at line 794 of file RuntimeFunctions.cpp.

References GPU_RT_STUB.

796  {
797  return 0;
798 }

◆ checked_single_agg_id_int8_shared()

GPU_RT_STUB int32_t checked_single_agg_id_int8_shared ( int8_t *  agg,
const int8_t  val,
const int8_t  null_val 
)

Definition at line 805 of file RuntimeFunctions.cpp.

References GPU_RT_STUB.

807  {
808  return 0;
809 }

◆ checked_single_agg_id_shared()

GPU_RT_STUB int32_t checked_single_agg_id_shared ( int64_t *  agg,
const int64_t  val,
const int64_t  null_val 
)

Definition at line 787 of file RuntimeFunctions.cpp.

References GPU_RT_STUB.

789  {
790  return 0;
791 }

◆ decimal_ceil()

ALWAYS_INLINE int64_t decimal_ceil ( const int64_t  x,
const int64_t  scale 
)

Definition at line 711 of file RuntimeFunctions.cpp.

References decimal_floor().

711  {
712  return decimal_floor(x, scale) + (x % scale ? scale : 0);
713 }
ALWAYS_INLINE int64_t decimal_floor(const int64_t x, const int64_t scale)
+ Here is the call graph for this function:

◆ decimal_floor()

ALWAYS_INLINE int64_t decimal_floor ( const int64_t  x,
const int64_t  scale 
)

Definition at line 701 of file RuntimeFunctions.cpp.

Referenced by decimal_ceil().

701  {
702  if (x >= 0) {
703  return x / scale * scale;
704  }
705  if (!(x % scale)) {
706  return x;
707  }
708  return x / scale * scale - scale;
709 }
+ Here is the caller graph for this function:

◆ declare_dynamic_shared_memory()

GPU_RT_STUB int64_t* declare_dynamic_shared_memory ( )

Definition at line 908 of file RuntimeFunctions.cpp.

908  {
909  return nullptr;
910 }

◆ extract_str_len()

ALWAYS_INLINE int32_t extract_str_len ( const uint64_t  str_and_len)

Definition at line 1185 of file RuntimeFunctions.cpp.

References __attribute__(), extract_str_len_noinline(), extract_str_ptr(), and extract_str_ptr_noinline().

1185  {
1186  return static_cast<int64_t>(str_and_len) >> 48;
1187 }
+ Here is the call graph for this function:

◆ extract_str_ptr()

ALWAYS_INLINE int8_t* extract_str_ptr ( const uint64_t  str_and_len)

Definition at line 1181 of file RuntimeFunctions.cpp.

Referenced by extract_str_len().

1181  {
1182  return reinterpret_cast<int8_t*>(str_and_len & 0xffffffffffff);
1183 }
+ Here is the caller graph for this function:

◆ force_sync()

GPU_RT_STUB void force_sync ( )

Definition at line 872 of file RuntimeFunctions.cpp.

872 {}

◆ get_block_index()

GPU_RT_STUB int64_t get_block_index ( )

Definition at line 912 of file RuntimeFunctions.cpp.

912  {
913  return 0;
914 }

◆ get_group_value_fast_keyless()

ALWAYS_INLINE int64_t* get_group_value_fast_keyless ( int64_t *  groups_buffer,
const int64_t  key,
const int64_t  min_key,
const int64_t  ,
const uint32_t  row_size_quad 
)

Definition at line 1161 of file RuntimeFunctions.cpp.

1166  {
1167  return groups_buffer + row_size_quad * (key - min_key);
1168 }

◆ get_group_value_fast_keyless_semiprivate()

ALWAYS_INLINE int64_t* get_group_value_fast_keyless_semiprivate ( int64_t *  groups_buffer,
const int64_t  key,
const int64_t  min_key,
const int64_t  ,
const uint32_t  row_size_quad,
const uint8_t  thread_warp_idx,
const uint8_t  warp_size 
)

Definition at line 1170 of file RuntimeFunctions.cpp.

1177  {
1178  return groups_buffer + row_size_quad * (warp_size * (key - min_key) + thread_warp_idx);
1179 }
const int64_t const uint32_t const uint32_t const uint32_t const bool const int8_t warp_size
GPU_RT_STUB int8_t thread_warp_idx(const int8_t warp_sz)

◆ get_matching_group_value() [1/2]

template<typename T >
ALWAYS_INLINE int64_t* get_matching_group_value ( int64_t *  groups_buffer,
const uint32_t  h,
const T *  key,
const uint32_t  key_count,
const uint32_t  row_size_quad 
)

Definition at line 990 of file RuntimeFunctions.cpp.

References align_to_int64().

Referenced by get_group_value(), get_group_value_with_watchdog(), and get_matching_group_value().

994  {
995  auto off = h * row_size_quad;
996  auto row_ptr = reinterpret_cast<T*>(groups_buffer + off);
997  if (*row_ptr == get_empty_key<T>()) {
998  memcpy(row_ptr, key, key_count * sizeof(T));
999  auto row_ptr_i8 = reinterpret_cast<int8_t*>(row_ptr + key_count);
1000  return reinterpret_cast<int64_t*>(align_to_int64(row_ptr_i8));
1001  }
1002  if (memcmp(row_ptr, key, key_count * sizeof(T)) == 0) {
1003  auto row_ptr_i8 = reinterpret_cast<int8_t*>(row_ptr + key_count);
1004  return reinterpret_cast<int64_t*>(align_to_int64(row_ptr_i8));
1005  }
1006  return nullptr;
1007 }
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_matching_group_value() [2/2]

ALWAYS_INLINE int64_t* get_matching_group_value ( int64_t *  groups_buffer,
const uint32_t  h,
const int64_t *  key,
const uint32_t  key_count,
const uint32_t  key_width,
const uint32_t  row_size_quad,
const int64_t *  init_vals 
)

Definition at line 1009 of file RuntimeFunctions.cpp.

References get_matching_group_value().

1015  {
1016  switch (key_width) {
1017  case 4:
1018  return get_matching_group_value(groups_buffer,
1019  h,
1020  reinterpret_cast<const int32_t*>(key),
1021  key_count,
1022  row_size_quad);
1023  case 8:
1024  return get_matching_group_value(groups_buffer, h, key, key_count, row_size_quad);
1025  default:;
1026  }
1027  return nullptr;
1028 }
ALWAYS_INLINE int64_t * get_matching_group_value(int64_t *groups_buffer, const uint32_t h, const T *key, const uint32_t key_count, const uint32_t row_size_quad)
+ Here is the call graph for this function:

◆ get_matching_group_value_columnar()

ALWAYS_INLINE int64_t* get_matching_group_value_columnar ( int64_t *  groups_buffer,
const uint32_t  h,
const int64_t *  key,
const uint32_t  key_qw_count,
const size_t  entry_count 
)

Definition at line 1078 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64, and key_qw_count.

Referenced by get_group_value_columnar(), and get_group_value_columnar_with_watchdog().

1083  {
1084  auto off = h;
1085  if (groups_buffer[off] == EMPTY_KEY_64) {
1086  for (size_t i = 0; i < key_qw_count; ++i) {
1087  groups_buffer[off] = key[i];
1088  off += entry_count;
1089  }
1090  return &groups_buffer[off];
1091  }
1092  off = h;
1093  for (size_t i = 0; i < key_qw_count; ++i) {
1094  if (groups_buffer[off] != key[i]) {
1095  return nullptr;
1096  }
1097  off += entry_count;
1098  }
1099  return &groups_buffer[off];
1100 }
#define EMPTY_KEY_64
const int64_t const uint32_t const uint32_t key_qw_count
+ Here is the caller graph for this function:

◆ get_matching_group_value_columnar_slot() [1/2]

template<typename T >
ALWAYS_INLINE int32_t get_matching_group_value_columnar_slot ( int64_t *  groups_buffer,
const uint32_t  entry_count,
const uint32_t  h,
const T *  key,
const uint32_t  key_count 
)

Definition at line 1031 of file RuntimeFunctions.cpp.

References ALWAYS_INLINE.

Referenced by get_group_value_columnar_slot(), get_group_value_columnar_slot_with_watchdog(), and get_matching_group_value_columnar_slot().

1035  {
1036  auto off = h;
1037  auto key_buffer = reinterpret_cast<T*>(groups_buffer);
1038  if (key_buffer[off] == get_empty_key<T>()) {
1039  for (size_t i = 0; i < key_count; ++i) {
1040  key_buffer[off] = key[i];
1041  off += entry_count;
1042  }
1043  return h;
1044  }
1045  off = h;
1046  for (size_t i = 0; i < key_count; ++i) {
1047  if (key_buffer[off] != key[i]) {
1048  return -1;
1049  }
1050  off += entry_count;
1051  }
1052  return h;
1053 }
+ Here is the caller graph for this function:

◆ get_matching_group_value_columnar_slot() [2/2]

ALWAYS_INLINE int32_t get_matching_group_value_columnar_slot ( int64_t *  groups_buffer,
const uint32_t  entry_count,
const uint32_t  h,
const int64_t *  key,
const uint32_t  key_count,
const uint32_t  key_width 
)

Definition at line 1056 of file RuntimeFunctions.cpp.

References get_matching_group_value_columnar_slot().

1061  {
1062  switch (key_width) {
1063  case 4:
1064  return get_matching_group_value_columnar_slot(groups_buffer,
1065  entry_count,
1066  h,
1067  reinterpret_cast<const int32_t*>(key),
1068  key_count);
1069  case 8:
1071  groups_buffer, entry_count, h, key, key_count);
1072  default:
1073  return -1;
1074  }
1075  return -1;
1076 }
ALWAYS_INLINE int32_t get_matching_group_value_columnar_slot(int64_t *groups_buffer, const uint32_t entry_count, const uint32_t h, const T *key, const uint32_t key_count)
+ Here is the call graph for this function:

◆ get_matching_group_value_perfect_hash()

ALWAYS_INLINE int64_t* get_matching_group_value_perfect_hash ( int64_t *  groups_buffer,
const uint32_t  hashed_index,
const int64_t *  key,
const uint32_t  key_count,
const uint32_t  row_size_quad 
)

Definition at line 1113 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64.

1118  {
1119  uint32_t off = hashed_index * row_size_quad;
1120  if (groups_buffer[off] == EMPTY_KEY_64) {
1121  for (uint32_t i = 0; i < key_count; ++i) {
1122  groups_buffer[off + i] = key[i];
1123  }
1124  }
1125  return groups_buffer + off + key_count;
1126 }
#define EMPTY_KEY_64

◆ get_matching_group_value_perfect_hash_keyless()

ALWAYS_INLINE int64_t* get_matching_group_value_perfect_hash_keyless ( int64_t *  groups_buffer,
const uint32_t  hashed_index,
const uint32_t  row_size_quad 
)

For a particular hashed index (only used with multi-column perfect hash group by) it returns the row-wise offset of the group in the output buffer. Since it is intended for keyless hash use, it assumes there is no group columns prepending the output buffer.

Definition at line 1134 of file RuntimeFunctions.cpp.

1137  {
1138  return groups_buffer + row_size_quad * hashed_index;
1139 }

◆ get_thread_index()

GPU_RT_STUB int64_t get_thread_index ( )

Definition at line 904 of file RuntimeFunctions.cpp.

904  {
905  return 0;
906 }

◆ init_shared_mem()

int64_t* init_shared_mem ( const int64_t *  global_groups_buffer,
const int32_t  groups_buffer_size 
)

Definition at line 947 of file RuntimeFunctions.cpp.

References __attribute__().

948  {
949  return nullptr;
950 }
+ Here is the call graph for this function:

◆ key_for_string_encoded()

ALWAYS_INLINE DEVICE int32_t key_for_string_encoded ( const int32_t  str_id)

Definition at line 1226 of file RuntimeFunctions.cpp.

1226  {
1227  return str_id;
1228 }

◆ linear_probabilistic_count()

NEVER_INLINE void linear_probabilistic_count ( uint8_t *  bitmap,
const uint32_t  bitmap_bytes,
const uint8_t *  key_bytes,
const uint32_t  key_len 
)

Definition at line 1275 of file RuntimeFunctions.cpp.

References __attribute__(), and MurmurHash1().

1278  {
1279  const uint32_t bit_pos = MurmurHash1(key_bytes, key_len, 0) % (bitmap_bytes * 8);
1280  const uint32_t word_idx = bit_pos / 32;
1281  const uint32_t bit_idx = bit_pos % 32;
1282  reinterpret_cast<uint32_t*>(bitmap)[word_idx] |= 1 << bit_idx;
1283 }
NEVER_INLINE DEVICE uint32_t MurmurHash1(const void *key, int len, const uint32_t seed)
Definition: MurmurHash.cpp:20
+ Here is the call graph for this function:

◆ load_avg_decimal()

ALWAYS_INLINE double load_avg_decimal ( const int64_t *  sum,
const int64_t *  count,
const double  null_val,
const uint32_t  scale 
)

Definition at line 1254 of file RuntimeFunctions.cpp.

1257  {
1258  return *count != 0 ? (static_cast<double>(*sum) / pow(10, scale)) / *count : null_val;
1259 }

◆ load_avg_double()

ALWAYS_INLINE double load_avg_double ( const int64_t *  agg,
const int64_t *  count,
const double  null_val 
)

Definition at line 1261 of file RuntimeFunctions.cpp.

1263  {
1264  return *count != 0 ? *reinterpret_cast<const double*>(may_alias_ptr(agg)) / *count
1265  : null_val;
1266 }

◆ load_avg_float()

ALWAYS_INLINE double load_avg_float ( const int32_t *  agg,
const int32_t *  count,
const double  null_val 
)

Definition at line 1268 of file RuntimeFunctions.cpp.

1270  {
1271  return *count != 0 ? *reinterpret_cast<const float*>(may_alias_ptr(agg)) / *count
1272  : null_val;
1273 }

◆ load_avg_int()

ALWAYS_INLINE double load_avg_int ( const int64_t *  sum,
const int64_t *  count,
const double  null_val 
)

Definition at line 1248 of file RuntimeFunctions.cpp.

1250  {
1251  return *count != 0 ? static_cast<double>(*sum) / *count : null_val;
1252 }

◆ load_double()

ALWAYS_INLINE double load_double ( const int64_t *  agg)

Definition at line 1240 of file RuntimeFunctions.cpp.

1240  {
1241  return *reinterpret_cast<const double*>(may_alias_ptr(agg));
1242 }

◆ load_float()

ALWAYS_INLINE float load_float ( const int32_t *  agg)

Definition at line 1244 of file RuntimeFunctions.cpp.

1244  {
1245  return *reinterpret_cast<const float*>(may_alias_ptr(agg));
1246 }

◆ logical_and()

ALWAYS_INLINE int8_t logical_and ( const int8_t  lhs,
const int8_t  rhs,
const int8_t  null_val 
)

Definition at line 255 of file RuntimeFunctions.cpp.

257  {
258  if (lhs == null_val) {
259  return rhs == 0 ? rhs : null_val;
260  }
261  if (rhs == null_val) {
262  return lhs == 0 ? lhs : null_val;
263  }
264  return (lhs && rhs) ? 1 : 0;
265 }

◆ logical_not()

ALWAYS_INLINE int8_t logical_not ( const int8_t  operand,
const int8_t  null_val 
)

Definition at line 251 of file RuntimeFunctions.cpp.

251  {
252  return operand == null_val ? operand : (operand ? 0 : 1);
253 }

◆ logical_or()

ALWAYS_INLINE int8_t logical_or ( const int8_t  lhs,
const int8_t  rhs,
const int8_t  null_val 
)

Definition at line 267 of file RuntimeFunctions.cpp.

269  {
270  if (lhs == null_val) {
271  return rhs == 0 ? null_val : rhs;
272  }
273  if (rhs == null_val) {
274  return lhs == 0 ? null_val : lhs;
275  }
276  return (lhs || rhs) ? 1 : 0;
277 }

◆ multifrag_query()

void multifrag_query ( const int8_t ***  col_buffers,
const uint64_t *  num_fragments,
const int64_t *  num_rows,
const uint64_t *  frag_row_offsets,
const int32_t *  max_matched,
int32_t *  total_matched,
const int64_t *  init_agg_value,
int64_t **  out,
int32_t *  error_code,
const uint32_t *  num_tables_ptr,
const int64_t *  join_hash_tables 
)

Definition at line 1343 of file RuntimeFunctions.cpp.

1353  {
1354  for (uint32_t i = 0; i < *num_fragments; ++i) {
1355  query_stub(col_buffers ? col_buffers[i] : nullptr,
1356  &num_rows[i * (*num_tables_ptr)],
1357  &frag_row_offsets[i * (*num_tables_ptr)],
1358  max_matched,
1360  out,
1361  i,
1363  total_matched,
1364  error_code);
1365  }
1366 }
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t * join_hash_tables
const int8_t const int64_t * num_rows
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t int32_t * total_matched
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
const int8_t const int64_t const uint64_t const int32_t * max_matched
const int8_t const int64_t const uint64_t const int32_t const int64_t * init_agg_value
const int8_t const int64_t const uint64_t * frag_row_offsets
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t ** out

◆ multifrag_query_hoisted_literals()

void multifrag_query_hoisted_literals ( const int8_t ***  col_buffers,
const uint64_t *  num_fragments,
const int8_t *  literals,
const int64_t *  num_rows,
const uint64_t *  frag_row_offsets,
const int32_t *  max_matched,
int32_t *  total_matched,
const int64_t *  init_agg_value,
int64_t **  out,
int32_t *  error_code,
const uint32_t *  num_tables_ptr,
const int64_t *  join_hash_tables 
)

Definition at line 1302 of file RuntimeFunctions.cpp.

References __attribute__(), error_code, frag_idx, frag_row_offsets, init_agg_value, join_hash_tables, max_matched, num_rows, out, and total_matched.

1313  {
1314  for (uint32_t i = 0; i < *num_fragments; ++i) {
1315  query_stub_hoisted_literals(col_buffers ? col_buffers[i] : nullptr,
1316  literals,
1317  &num_rows[i * (*num_tables_ptr)],
1318  &frag_row_offsets[i * (*num_tables_ptr)],
1319  max_matched,
1321  out,
1322  i,
1324  total_matched,
1325  error_code);
1326  }
1327 }
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t * join_hash_tables
const int8_t const int64_t * num_rows
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t int32_t * total_matched
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
const int8_t const int64_t const uint64_t const int32_t * max_matched
const int8_t const int64_t const uint64_t const int32_t const int64_t * init_agg_value
const int8_t * literals
const int8_t const int64_t const uint64_t * frag_row_offsets
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t ** out
+ Here is the call graph for this function:

◆ percent_window_func()

ALWAYS_INLINE double percent_window_func ( const int64_t  output_buff,
const int64_t  pos 
)

Definition at line 1235 of file RuntimeFunctions.cpp.

1236  {
1237  return reinterpret_cast<const double*>(output_buff)[pos];
1238 }

◆ record_error_code()

ALWAYS_INLINE int32_t record_error_code ( const int32_t  err_code,
int32_t *  error_codes 
)

Definition at line 918 of file RuntimeFunctions.cpp.

References __attribute__().

919  {
920  // NB: never override persistent error codes (with code greater than zero).
921  // On GPU, a projection query with a limit can run out of slots without it
922  // being an actual error if the limit has been hit. If a persistent error
923  // (division by zero, for example) occurs before running out of slots, we
924  // have to avoid overriding it, because there's a risk that the query would
925  // go through if we override with a potentially benign out-of-slots code.
926  if (err_code && error_codes[pos_start_impl(nullptr)] <= 0) {
927  error_codes[pos_start_impl(nullptr)] = err_code;
928  }
929  return err_code;
930 }
+ Here is the call graph for this function:

◆ row_number_window_func()

ALWAYS_INLINE int64_t row_number_window_func ( const int64_t  output_buff,
const int64_t  pos 
)

Definition at line 1230 of file RuntimeFunctions.cpp.

1231  {
1232  return reinterpret_cast<const int64_t*>(output_buff)[pos];
1233 }

◆ scale_decimal_down_not_nullable()

ALWAYS_INLINE int64_t scale_decimal_down_not_nullable ( const int64_t  operand,
const int64_t  scale,
const int64_t  null_val 
)

Definition at line 195 of file RuntimeFunctions.cpp.

197  {
198  int64_t tmp = scale >> 1;
199  tmp = operand >= 0 ? operand + tmp : operand - tmp;
200  return tmp / scale;
201 }

◆ scale_decimal_down_nullable()

ALWAYS_INLINE int64_t scale_decimal_down_nullable ( const int64_t  operand,
const int64_t  scale,
const int64_t  null_val 
)

Definition at line 182 of file RuntimeFunctions.cpp.

184  {
185  // rounded scale down of a decimal
186  if (operand == null_val) {
187  return null_val;
188  }
189 
190  int64_t tmp = scale >> 1;
191  tmp = operand >= 0 ? operand + tmp : operand - tmp;
192  return tmp / scale;
193 }

◆ scale_decimal_up()

ALWAYS_INLINE int64_t scale_decimal_up ( const int64_t  operand,
const uint64_t  scale,
const int64_t  operand_null_val,
const int64_t  result_null_val 
)

Definition at line 175 of file RuntimeFunctions.cpp.

178  {
179  return operand != operand_null_val ? operand * scale : result_null_val;
180 }

◆ set_matching_group_value_perfect_hash_columnar()

ALWAYS_INLINE void set_matching_group_value_perfect_hash_columnar ( int64_t *  groups_buffer,
const uint32_t  hashed_index,
const int64_t *  key,
const uint32_t  key_count,
const uint32_t  entry_count 
)

Definition at line 1145 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64.

1150  {
1151  if (groups_buffer[hashed_index] == EMPTY_KEY_64) {
1152  for (uint32_t i = 0; i < key_count; i++) {
1153  groups_buffer[i * entry_count + hashed_index] = key[i];
1154  }
1155  }
1156 }
#define EMPTY_KEY_64

◆ string_pack()

ALWAYS_INLINE uint64_t string_pack ( const int8_t *  ptr,
const int32_t  len 
)

Definition at line 1199 of file RuntimeFunctions.cpp.

1199  {
1200  return (reinterpret_cast<const uint64_t>(ptr) & 0xffffffffffff) |
1201  (static_cast<const uint64_t>(len) << 48);
1202 }

◆ sync_threadblock()

GPU_RT_STUB void sync_threadblock ( )

Definition at line 876 of file RuntimeFunctions.cpp.

Referenced by GpuSharedMemCodeBuilder::codegenInitialization(), and GpuSharedMemCodeBuilder::codegenReduction().

876 {}
+ Here is the caller graph for this function:

◆ sync_warp()

GPU_RT_STUB void sync_warp ( )

Definition at line 874 of file RuntimeFunctions.cpp.

874 {}

◆ sync_warp_protected()

GPU_RT_STUB void sync_warp_protected ( int64_t  thread_pos,
int64_t  row_count 
)

Definition at line 875 of file RuntimeFunctions.cpp.

875 {}

◆ thread_warp_idx()

GPU_RT_STUB int8_t thread_warp_idx ( const int8_t  warp_sz)

Definition at line 900 of file RuntimeFunctions.cpp.

900  {
901  return 0;
902 }

◆ write_back_non_grouped_agg()

GPU_RT_STUB void write_back_non_grouped_agg ( int64_t *  input_buffer,
int64_t *  output_buffer,
const int32_t  num_agg_cols 
)

Definition at line 878 of file RuntimeFunctions.cpp.

880  {};

Variable Documentation

◆ agg_col_count

◆ blocks_share_memory

const int64_t const uint32_t const uint32_t const uint32_t const bool const bool blocks_share_memory

Definition at line 966 of file RuntimeFunctions.cpp.

◆ error_code

◆ frag_idx

const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t frag_idx
Initial value:
{
assert(groups_buffer)

Definition at line 972 of file RuntimeFunctions.cpp.

Referenced by multifrag_query_hoisted_literals(), query_group_by_template_impl(), query_template_impl(), and Executor::skipFragment().

◆ frag_row_offsets

const int64_t const uint64_t * frag_row_offsets

Definition at line 1287 of file RuntimeFunctions.cpp.

Referenced by multifrag_query_hoisted_literals().

◆ groups_buffer_entry_count

◆ groups_buffer_size

const int32_t groups_buffer_size
Initial value:
{
return groups_buffer

Definition at line 936 of file RuntimeFunctions.cpp.

Referenced by QueryMemoryInitializer::allocateCountDistinctSet(), copy_group_by_buffers_from_gpu(), and create_dev_group_by_buffers().

◆ init_agg_value

const int64_t const uint64_t const int32_t const int64_t * init_agg_value

Definition at line 1287 of file RuntimeFunctions.cpp.

Referenced by multifrag_query_hoisted_literals().

◆ init_vals

const int64_t * init_vals

Definition at line 954 of file RuntimeFunctions.cpp.

Referenced by QueryMemoryInitializer::getNumBuffers().

◆ join_hash_tables

const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t * join_hash_tables

◆ key_qw_count

◆ keyless

const int64_t const uint32_t const uint32_t const uint32_t const bool keyless

Definition at line 954 of file RuntimeFunctions.cpp.

Referenced by GroupByAndAggregate::getKeylessInfo().

◆ literals

const int8_t* literals

◆ max_matched

const int64_t const uint64_t const int32_t * max_matched

◆ num_rows

const int64_t * num_rows

Definition at line 1287 of file RuntimeFunctions.cpp.

Referenced by Catalog_Namespace::Catalog::addForeignTableDetails(), DictionaryValueConverter< TARGET_TYPE >::allocateColumnarBuffer(), StringValueConverter::allocateColumnarData(), ArrayValueConverter< ELEMENT_CONVERTER >::allocateColumnarData(), GeoPointValueConverter::allocateColumnarData(), GeoLinestringValueConverter::allocateColumnarData(), GeoPolygonValueConverter::allocateColumnarData(), GeoMultiPolygonValueConverter::allocateColumnarData(), Importer_NS::DataStreamSink::archivePlumber(), SpeculativeTopNMap::asRows(), Catalog_Namespace::Catalog::buildForeignServerMap(), ColumnarResults::ColumnarResults(), Catalog_Namespace::Catalog::dropForeignServer(), Catalog_Namespace::Catalog::dropFsiSchemasAndTables(), Executor::executePlanWithGroupBy(), Executor::executePlanWithoutGroupBy(), Executor::fetchUnionChunks(), Fragmenter_Namespace::FixedLenArrayChunkConverter::FixedLenArrayChunkConverter(), get_num_allocated_rows_from_gpu(), Catalog_Namespace::Catalog::getForeignServersForUser(), Catalog_Namespace::SysCatalog::getGranteesOfSharedDashboards(), Executor::getRowCountAndOffsetForAllFrags(), QueryExecutionContext::launchCpuCode(), QueryExecutionContext::launchGpuCode(), multifrag_query_hoisted_literals(), Parser::InsertIntoTableAsSelectStmt::populateData(), QueryExecutionContext::QueryExecutionContext(), SqliteMemDatabase::runSelect(), com.mapd.tests.DistributedConcurrencyTest::runTest(), com.mapd.tests.SelectUpdateDeleteDifferentTables::runTest(), com.mapd.tests.UpdateDeleteInsertConcurrencyTest::runTest(), com.mapd.tests.AlterDropTruncateValidateConcurrencyTest::runTest(), com.mapd.tests.CtasItasSelectUpdelConcurrencyTest::runTest(), Catalog_Namespace::Catalog::setForeignServerProperty(), Fragmenter_Namespace::StringChunkConverter::StringChunkConverter(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumns(), anonymous_namespace{ExternalExecutor.cpp}::vt_column(), anonymous_namespace{ExternalExecutor.cpp}::vt_next(), and TargetValueConverter::~TargetValueConverter().

◆ out

◆ src

◆ sz

◆ total_matched

const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t int32_t * total_matched
Initial value:
{
assert(col_buffers || literals || num_rows || frag_row_offsets || max_matched ||
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t * join_hash_tables
const int8_t const int64_t * num_rows
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t int32_t * total_matched
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t uint32_t const int64_t int32_t * error_code
const int8_t const int64_t const uint64_t const int32_t * max_matched
const int64_t const uint32_t const uint32_t const uint32_t const bool const bool const int32_t frag_idx
const int8_t const int64_t const uint64_t const int32_t const int64_t * init_agg_value
const int8_t * literals
const int8_t const int64_t const uint64_t * frag_row_offsets
const int8_t const int64_t const uint64_t const int32_t const int64_t int64_t ** out

Definition at line 1296 of file RuntimeFunctions.cpp.

Referenced by QueryExecutionContext::launchCpuCode(), multifrag_query_hoisted_literals(), query_group_by_template_impl(), and query_template_impl().

◆ warp_size

const int64_t const uint32_t const uint32_t const uint32_t const bool const int8_t warp_size