OmniSciDB  a667adc9c8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RuntimeFunctions.cpp File Reference
#include "RuntimeFunctions.h"
#include "../Shared/funcannotations.h"
#include "BufferCompaction.h"
#include "HyperLogLogRank.h"
#include "MurmurHash.h"
#include "Shared/quantile.h"
#include "TypePunning.h"
#include <algorithm>
#include <atomic>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <thread>
#include <tuple>
#include "DecodersImpl.h"
#include "GroupByRuntime.cpp"
#include "JoinHashTable/Runtime/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 int64_t floor_div_lhs (const int64_t dividend, const int64_t divisor)
 
ALWAYS_INLINE int64_t floor_div_nullable_lhs (const int64_t dividend, const int64_t divisor, 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)
 
NEVER_INLINE int32_t pos_start_impl (int32_t *error_code)
 
NEVER_INLINE int32_t group_buff_idx_impl ()
 
NEVER_INLINE int32_t pos_step_impl ()
 
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 void record_error_code (const int32_t err_code, int32_t *error_codes)
 
ALWAYS_INLINE int32_t get_error_code (int32_t *error_codes)
 
NEVER_INLINE const int64_t * init_shared_mem_nop (const int64_t *groups_buffer, const int32_t groups_buffer_size)
 
NEVER_INLINE void write_back_nop (int64_t *dest, int64_t *src, const int32_t sz)
 
int64_t * init_shared_mem (const int64_t *global_groups_buffer, const int32_t groups_buffer_size)
 
NEVER_INLINE void init_group_by_buffer_gpu (int64_t *groups_buffer, const int64_t *init_vals, const uint32_t groups_buffer_entry_count, const uint32_t key_qw_count, const uint32_t agg_col_count, const bool keyless, const int8_t warp_size)
 
NEVER_INLINE void init_columnar_group_by_buffer_gpu (int64_t *groups_buffer, const int64_t *init_vals, const uint32_t groups_buffer_entry_count, const uint32_t key_qw_count, const uint32_t agg_col_count, const bool keyless, const bool blocks_share_memory, const int32_t frag_idx)
 
NEVER_INLINE void init_group_by_buffer_impl (int64_t *groups_buffer, const int64_t *init_vals, const uint32_t groups_buffer_entry_count, const uint32_t key_qw_count, const uint32_t agg_col_count, const bool keyless, const int8_t warp_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)
 
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)
 
NEVER_INLINE int8_t * extract_str_ptr_noinline (const uint64_t str_and_len)
 
NEVER_INLINE int32_t extract_str_len_noinline (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 DEVICE bool sample_ratio (const double proportion, const int64_t row_offset)
 
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)
 
NEVER_INLINE void query_stub_hoisted_literals (const int8_t **col_buffers, const int8_t *literals, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, const int64_t *init_agg_value, int64_t **out, uint32_t frag_idx, const int64_t *join_hash_tables, int32_t *error_code, int32_t *total_matched)
 
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)
 
NEVER_INLINE void query_stub (const int8_t **col_buffers, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, const int64_t *init_agg_value, int64_t **out, uint32_t frag_idx, const int64_t *join_hash_tables, int32_t *error_code, int32_t *total_matched)
 
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)
 

Macro Definition Documentation

#define ADDR_T   int64_t

Definition at line 712 of file RuntimeFunctions.cpp.

#define ADDR_T   int32_t

Definition at line 712 of file RuntimeFunctions.cpp.

#define DATA_T   int64_t

Definition at line 711 of file RuntimeFunctions.cpp.

#define DATA_T   int32_t

Definition at line 711 of file RuntimeFunctions.cpp.

#define DATA_T   int16_t

Definition at line 711 of file RuntimeFunctions.cpp.

#define DATA_T   int8_t

Definition at line 711 of file RuntimeFunctions.cpp.

#define DATA_T   double

Definition at line 711 of file RuntimeFunctions.cpp.

#define DATA_T   float

Definition at line 711 of file RuntimeFunctions.cpp.

#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 445 of file RuntimeFunctions.cpp.

#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 425 of file RuntimeFunctions.cpp.

#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 435 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 44 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 53 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 62 of file RuntimeFunctions.cpp.

#define DEF_BINARY_NULLABLE_ALL_OPS (   type,
  null_type 
)

Definition at line 116 of file RuntimeFunctions.cpp.

#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 235 of file RuntimeFunctions.cpp.

#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 243 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 450 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 71 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 83 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 95 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 107 of file RuntimeFunctions.cpp.

#define DEF_SHARED_AGG_RET_STUBS (   base_agg_func)

Definition at line 738 of file RuntimeFunctions.cpp.

#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 777 of file RuntimeFunctions.cpp.

#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 const
#define DATA_T
#define ALWAYS_INLINE
if(yyssp >=yyss+yystacksize-1)

Definition at line 690 of file RuntimeFunctions.cpp.

#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 const
#define DATA_T
#define ADDR_T
#define ALWAYS_INLINE
if(yyssp >=yyss+yystacksize-1)

Definition at line 690 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 682 of file RuntimeFunctions.cpp.

#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 DATA_T
#define ADDR_T
#define ALWAYS_INLINE
if(yyssp >=yyss+yystacksize-1)

Definition at line 682 of file RuntimeFunctions.cpp.

#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 220 of file RuntimeFunctions.cpp.

#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
if(yyssp >=yyss+yystacksize-1)

Definition at line 478 of file RuntimeFunctions.cpp.

#define GPU_RT_STUB   NEVER_INLINE __attribute__((optnone))

Definition at line 312 of file RuntimeFunctions.cpp.

Function Documentation

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

Definition at line 323 of file RuntimeFunctions.cpp.

References get_rank(), and MurmurHash64A().

325  {
326  const uint64_t hash = MurmurHash64A(&key, sizeof(key), 0);
327  const uint32_t index = hash >> (64 - b);
328  const uint8_t rank = get_rank(hash << b, 64 - b);
329  uint8_t* M = reinterpret_cast<uint8_t*>(*agg);
330  M[index] = std::max(M[index], rank);
331 }
FORCE_INLINE uint8_t get_rank(uint64_t x, uint32_t b)
RUNTIME_EXPORT 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:

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 333 of file RuntimeFunctions.cpp.

337  {}
ALWAYS_INLINE uint64_t agg_count ( uint64_t *  agg,
const int64_t   
)

Definition at line 298 of file RuntimeFunctions.cpp.

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

298  {
299  return (*agg)++;
300 }

+ Here is the caller graph for this function:

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

Definition at line 302 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().

304  {
305  const uint64_t bitmap_idx = val - min_val;
306  reinterpret_cast<int8_t*>(*agg)[bitmap_idx >> 3] |= (1 << (bitmap_idx & 7));
307 }

+ Here is the caller graph for this function:

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 315 of file RuntimeFunctions.cpp.

321  {}
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 397 of file RuntimeFunctions.cpp.

References agg_count_distinct_bitmap().

400  {
401  if (val != skip_val) {
402  agg_count_distinct_bitmap(agg, val, min_val);
403  }
404 }
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:

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 406 of file RuntimeFunctions.cpp.

413  {}
ALWAYS_INLINE uint64_t agg_count_double ( uint64_t *  agg,
const double  val 
)

Definition at line 582 of file RuntimeFunctions.cpp.

Referenced by agg_count_double_skip_val().

582  {
583  return (*agg)++;
584 }

+ Here is the caller graph for this function:

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

Definition at line 664 of file RuntimeFunctions.cpp.

References agg_count_double().

666  {
667  if (val != skip_val) {
668  return agg_count_double(agg, val);
669  }
670  return *agg;
671 }
ALWAYS_INLINE uint64_t agg_count_double(uint64_t *agg, const double val)

+ Here is the call graph for this function:

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

Definition at line 623 of file RuntimeFunctions.cpp.

Referenced by agg_count_float_skip_val().

623  {
624  return (*agg)++;
625 }

+ Here is the caller graph for this function:

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

Definition at line 673 of file RuntimeFunctions.cpp.

References agg_count_float().

675  {
676  if (val != skip_val) {
677  return agg_count_float(agg, val);
678  }
679  return *agg;
680 }
ALWAYS_INLINE uint32_t agg_count_float(uint32_t *agg, const float val)

+ Here is the call graph for this function:

ALWAYS_INLINE uint32_t agg_count_int32 ( uint32_t *  agg,
const int32_t   
)

Definition at line 415 of file RuntimeFunctions.cpp.

Referenced by agg_count_int32_skip_val().

415  {
416  return (*agg)++;
417 }

+ Here is the caller graph for this function:

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

Definition at line 527 of file RuntimeFunctions.cpp.

References agg_count_int32().

529  {
530  if (val != skip_val) {
531  return agg_count_int32(agg, val);
532  }
533  return *agg;
534 }
ALWAYS_INLINE uint32_t agg_count_int32(uint32_t *agg, const int32_t)

+ Here is the call graph for this function:

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

Definition at line 518 of file RuntimeFunctions.cpp.

References agg_count().

520  {
521  if (val != skip_val) {
522  return agg_count(agg, val);
523  }
524  return *agg;
525 }
ALWAYS_INLINE uint64_t agg_count(uint64_t *agg, const int64_t)

+ Here is the call graph for this function:

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

Definition at line 375 of file RuntimeFunctions.cpp.

375  {
376  *agg = val;
377 }
ALWAYS_INLINE void agg_id_double ( int64_t *  agg,
const double  val 
)

Definition at line 601 of file RuntimeFunctions.cpp.

601  {
602  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)));
603 }
GPU_RT_STUB void agg_id_double_shared_slow ( int64_t *  agg,
const double *  val 
)

Definition at line 861 of file RuntimeFunctions.cpp.

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

Definition at line 642 of file RuntimeFunctions.cpp.

642  {
643  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)));
644 }
ALWAYS_INLINE void agg_max ( int64_t *  agg,
const int64_t  val 
)

Definition at line 367 of file RuntimeFunctions.cpp.

367  {
368  *agg = std::max(*agg, val);
369 }
ALWAYS_INLINE void agg_max_double ( int64_t *  agg,
const double  val 
)

Definition at line 591 of file RuntimeFunctions.cpp.

References test_fsi::r.

591  {
592  const auto r = std::max(*reinterpret_cast<const double*>(agg), val);
593  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&r)));
594 }
tuple r
Definition: test_fsi.py:16
ALWAYS_INLINE void agg_max_float ( int32_t *  agg,
const float  val 
)

Definition at line 632 of file RuntimeFunctions.cpp.

References test_fsi::r.

632  {
633  const auto r = std::max(*reinterpret_cast<const float*>(agg), val);
634  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&r)));
635 }
tuple r
Definition: test_fsi.py:16
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 845 of file RuntimeFunctions.cpp.

847  {}
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 849 of file RuntimeFunctions.cpp.

851  {}
ALWAYS_INLINE void agg_min ( int64_t *  agg,
const int64_t  val 
)

Definition at line 371 of file RuntimeFunctions.cpp.

371  {
372  *agg = std::min(*agg, val);
373 }
ALWAYS_INLINE void agg_min_double ( int64_t *  agg,
const double  val 
)

Definition at line 596 of file RuntimeFunctions.cpp.

References test_fsi::r.

596  {
597  const auto r = std::min(*reinterpret_cast<const double*>(agg), val);
598  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&r)));
599 }
tuple r
Definition: test_fsi.py:16
ALWAYS_INLINE void agg_min_float ( int32_t *  agg,
const float  val 
)

Definition at line 637 of file RuntimeFunctions.cpp.

References test_fsi::r.

637  {
638  const auto r = std::min(*reinterpret_cast<const float*>(agg), val);
639  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&r)));
640 }
tuple r
Definition: test_fsi.py:16
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 853 of file RuntimeFunctions.cpp.

855  {}
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 857 of file RuntimeFunctions.cpp.

859  {}
ALWAYS_INLINE int64_t agg_sum ( int64_t *  agg,
const int64_t  val 
)

Definition at line 361 of file RuntimeFunctions.cpp.

Referenced by agg_sum_skip_val().

361  {
362  const auto old = *agg;
363  *agg += val;
364  return old;
365 }

+ Here is the caller graph for this function:

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

Definition at line 586 of file RuntimeFunctions.cpp.

References test_fsi::r.

586  {
587  const auto r = *reinterpret_cast<const double*>(agg) + val;
588  *agg = *reinterpret_cast<const int64_t*>(may_alias_ptr(&r));
589 }
tuple r
Definition: test_fsi.py:16
GPU_RT_STUB void agg_sum_double_shared ( int64_t *  agg,
const double  val 
)

Definition at line 882 of file RuntimeFunctions.cpp.

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

Definition at line 884 of file RuntimeFunctions.cpp.

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

Definition at line 627 of file RuntimeFunctions.cpp.

References test_fsi::r.

627  {
628  const auto r = *reinterpret_cast<const float*>(agg) + val;
629  *agg = *reinterpret_cast<const int32_t*>(may_alias_ptr(&r));
630 }
tuple r
Definition: test_fsi.py:16
GPU_RT_STUB void agg_sum_float_shared ( int32_t *  agg,
const float  val 
)

Definition at line 887 of file RuntimeFunctions.cpp.

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

Definition at line 889 of file RuntimeFunctions.cpp.

891  {}
ALWAYS_INLINE int32_t agg_sum_int32 ( int32_t *  agg,
const int32_t  val 
)

Definition at line 419 of file RuntimeFunctions.cpp.

Referenced by agg_sum_int32_skip_val().

419  {
420  const auto old = *agg;
421  *agg += val;
422  return old;
423 }

+ Here is the caller graph for this function:

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

Definition at line 872 of file RuntimeFunctions.cpp.

872  {
873  return 0;
874 }
ALWAYS_INLINE int32_t agg_sum_int32_skip_val ( int32_t *  agg,
const int32_t  val,
const int32_t  skip_val 
)

Definition at line 504 of file RuntimeFunctions.cpp.

References agg_sum_int32().

506  {
507  const auto old = *agg;
508  if (val != skip_val) {
509  if (old != skip_val) {
510  return agg_sum_int32(agg, val);
511  } else {
512  *agg = val;
513  }
514  }
515  return old;
516 }
ALWAYS_INLINE int32_t agg_sum_int32(int32_t *agg, const int32_t val)

+ Here is the call graph for this function:

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 876 of file RuntimeFunctions.cpp.

878  {
879  return 0;
880 }
GPU_RT_STUB int64_t agg_sum_shared ( int64_t *  agg,
const int64_t  val 
)

Definition at line 863 of file RuntimeFunctions.cpp.

863  {
864  return 0;
865 }
ALWAYS_INLINE int64_t agg_sum_skip_val ( int64_t *  agg,
const int64_t  val,
const int64_t  skip_val 
)

Definition at line 490 of file RuntimeFunctions.cpp.

References agg_sum().

Referenced by Executor::reduceResults().

492  {
493  const auto old = *agg;
494  if (val != skip_val) {
495  if (old != skip_val) {
496  return agg_sum(agg, val);
497  } else {
498  *agg = val;
499  }
500  }
501  return old;
502 }
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:

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 867 of file RuntimeFunctions.cpp.

869  {
870  return 0;
871 }
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 339 of file RuntimeFunctions.cpp.

344  {
345  if (val == null_val) {
346  return null_bool_val;
347  }
348  if (val < min_val || val > max_val) {
349  return 0;
350  }
351  if (!bitset) {
352  return 0;
353  }
354  const uint64_t bitmap_idx = val - min_val;
355  return (reinterpret_cast<const int8_t*>(bitset))[bitmap_idx >> 3] &
356  (1 << (bitmap_idx & 7))
357  ? 1
358  : 0;
359 }
ALWAYS_INLINE DEVICE int32_t char_length ( const char *  str,
const int32_t  str_len 
)

Definition at line 1241 of file RuntimeFunctions.cpp.

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

1242  {
1243  return str_len;
1244 }

+ Here is the caller graph for this function:

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

Definition at line 1246 of file RuntimeFunctions.cpp.

1248  {
1249  if (!str) {
1250  return int_null;
1251  }
1252  return str_len;
1253 }
ALWAYS_INLINE DEVICE bool check_interrupt ( )

Definition at line 1406 of file RuntimeFunctions.cpp.

References check_interrupt_init(), INT_CHECK, and runtime_interrupt_flag.

1406  {
1407  if (check_interrupt_init(static_cast<unsigned>(INT_CHECK))) {
1408  return true;
1409  }
1410  return false;
1411 }
bool check_interrupt_init(unsigned command)

+ Here is the call graph for this function:

bool check_interrupt_init ( unsigned  command)

Definition at line 1413 of file RuntimeFunctions.cpp.

References INT_ABORT, INT_CHECK, INT_RESET, and runtime_interrupt_flag.

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

1413  {
1414  static std::atomic_bool runtime_interrupt_flag{false};
1415 
1416  if (command == static_cast<unsigned>(INT_CHECK)) {
1417  if (runtime_interrupt_flag.load()) {
1418  return true;
1419  }
1420  return false;
1421  }
1422  if (command == static_cast<unsigned>(INT_ABORT)) {
1423  runtime_interrupt_flag.store(true);
1424  return false;
1425  }
1426  if (command == static_cast<unsigned>(INT_RESET)) {
1427  runtime_interrupt_flag.store(false);
1428  return false;
1429  }
1430  return false;
1431 }
__device__ int32_t runtime_interrupt_flag
Definition: cuda_mapd_rt.cu:96

+ Here is the caller graph for this function:

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

Definition at line 379 of file RuntimeFunctions.cpp.

381  {
382  if (val == null_val) {
383  return 0;
384  }
385 
386  if (*agg == val) {
387  return 0;
388  } else if (*agg == null_val) {
389  *agg = val;
390  return 0;
391  } else {
392  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
393  return 15;
394  }
395 }
ALWAYS_INLINE int32_t checked_single_agg_id_double ( int64_t *  agg,
const double  val,
const double  null_val 
)

Definition at line 605 of file RuntimeFunctions.cpp.

607  {
608  if (val == null_val) {
609  return 0;
610  }
611 
612  if (*agg == *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)))) {
613  return 0;
614  } else if (*agg == *(reinterpret_cast<const int64_t*>(may_alias_ptr(&null_val)))) {
615  *agg = *(reinterpret_cast<const int64_t*>(may_alias_ptr(&val)));
616  return 0;
617  } else {
618  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
619  return 15;
620  }
621 }
GPU_RT_STUB int32_t checked_single_agg_id_double_shared ( int64_t *  agg,
const double  val,
const double  null_val 
)

Definition at line 833 of file RuntimeFunctions.cpp.

835  {
836  return 0;
837 }
ALWAYS_INLINE int32_t checked_single_agg_id_float ( int32_t *  agg,
const float  val,
const float  null_val 
)

Definition at line 646 of file RuntimeFunctions.cpp.

648  {
649  if (val == null_val) {
650  return 0;
651  }
652 
653  if (*agg == *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)))) {
654  return 0;
655  } else if (*agg == *(reinterpret_cast<const int32_t*>(may_alias_ptr(&null_val)))) {
656  *agg = *(reinterpret_cast<const int32_t*>(may_alias_ptr(&val)));
657  return 0;
658  } else {
659  // see Execute::ERR_SINGLE_VALUE_FOUND_MULTIPLE_VALUES
660  return 15;
661  }
662 }
GPU_RT_STUB int32_t checked_single_agg_id_float_shared ( int32_t *  agg,
const float  val,
const float  null_val 
)

Definition at line 839 of file RuntimeFunctions.cpp.

841  {
842  return 0;
843 }
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 821 of file RuntimeFunctions.cpp.

823  {
824  return 0;
825 }
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 815 of file RuntimeFunctions.cpp.

817  {
818  return 0;
819 }
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 826 of file RuntimeFunctions.cpp.

828  {
829  return 0;
830 }
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 808 of file RuntimeFunctions.cpp.

810  {
811  return 0;
812 }
ALWAYS_INLINE int64_t decimal_ceil ( const int64_t  x,
const int64_t  scale 
)

Definition at line 732 of file RuntimeFunctions.cpp.

References decimal_floor().

732  {
733  return decimal_floor(x, scale) + (x % scale ? scale : 0);
734 }
ALWAYS_INLINE int64_t decimal_floor(const int64_t x, const int64_t scale)

+ Here is the call graph for this function:

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

Definition at line 722 of file RuntimeFunctions.cpp.

Referenced by decimal_ceil().

722  {
723  if (x >= 0) {
724  return x / scale * scale;
725  }
726  if (!(x % scale)) {
727  return x;
728  }
729  return x / scale * scale - scale;
730 }

+ Here is the caller graph for this function:

GPU_RT_STUB int64_t* declare_dynamic_shared_memory ( )

Definition at line 929 of file RuntimeFunctions.cpp.

929  {
930  return nullptr;
931 }
ALWAYS_INLINE int32_t extract_str_len ( const uint64_t  str_and_len)

Definition at line 1216 of file RuntimeFunctions.cpp.

Referenced by extract_str_len_noinline().

1216  {
1217  return static_cast<int64_t>(str_and_len) >> 48;
1218 }

+ Here is the caller graph for this function:

NEVER_INLINE int32_t extract_str_len_noinline ( const uint64_t  str_and_len)

Definition at line 1224 of file RuntimeFunctions.cpp.

References extract_str_len().

Referenced by string_compress().

1224  {
1225  return extract_str_len(str_and_len);
1226 }
ALWAYS_INLINE int32_t extract_str_len(const uint64_t str_and_len)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE int8_t* extract_str_ptr ( const uint64_t  str_and_len)

Definition at line 1212 of file RuntimeFunctions.cpp.

Referenced by extract_str_ptr_noinline().

1212  {
1213  return reinterpret_cast<int8_t*>(str_and_len & 0xffffffffffff);
1214 }

+ Here is the caller graph for this function:

NEVER_INLINE int8_t* extract_str_ptr_noinline ( const uint64_t  str_and_len)

Definition at line 1220 of file RuntimeFunctions.cpp.

References extract_str_ptr().

Referenced by string_compress().

1220  {
1221  return extract_str_ptr(str_and_len);
1222 }
ALWAYS_INLINE int8_t * extract_str_ptr(const uint64_t str_and_len)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ALWAYS_INLINE int64_t floor_div_lhs ( const int64_t  dividend,
const int64_t  divisor 
)

Definition at line 207 of file RuntimeFunctions.cpp.

Referenced by floor_div_nullable_lhs().

208  {
209  return (dividend < 0 ? dividend - (divisor - 1) : dividend) / divisor;
210 }

+ Here is the caller graph for this function:

ALWAYS_INLINE int64_t floor_div_nullable_lhs ( const int64_t  dividend,
const int64_t  divisor,
const int64_t  null_val 
)

Definition at line 214 of file RuntimeFunctions.cpp.

References floor_div_lhs().

216  {
217  return dividend == null_val ? null_val : floor_div_lhs(dividend, divisor);
218 }
ALWAYS_INLINE int64_t floor_div_lhs(const int64_t dividend, const int64_t divisor)

+ Here is the call graph for this function:

GPU_RT_STUB void force_sync ( )

Definition at line 893 of file RuntimeFunctions.cpp.

893 {}
GPU_RT_STUB int64_t get_block_index ( )

Definition at line 933 of file RuntimeFunctions.cpp.

933  {
934  return 0;
935 }
ALWAYS_INLINE int32_t get_error_code ( int32_t *  error_codes)

Definition at line 952 of file RuntimeFunctions.cpp.

References pos_start_impl().

952  {
953  return error_codes[pos_start_impl(nullptr)];
954 }
__device__ int32_t pos_start_impl(const int32_t *row_index_resume)
Definition: cuda_mapd_rt.cu:28

+ Here is the call graph for this function:

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 1192 of file RuntimeFunctions.cpp.

1197  {
1198  return groups_buffer + row_size_quad * (key - min_key);
1199 }
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 1201 of file RuntimeFunctions.cpp.

1208  {
1209  return groups_buffer + row_size_quad * (warp_size * (key - min_key) + thread_warp_idx);
1210 }
__device__ int8_t thread_warp_idx(const int8_t warp_sz)
Definition: cuda_mapd_rt.cu:40
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 1022 of file RuntimeFunctions.cpp.

References align_to_int64(), and omnisci.dtypes::T.

1026  {
1027  auto off = h * row_size_quad;
1028  auto row_ptr = reinterpret_cast<T*>(groups_buffer + off);
1029  if (*row_ptr == get_empty_key<T>()) {
1030  memcpy(row_ptr, key, key_count * sizeof(T));
1031  auto row_ptr_i8 = reinterpret_cast<int8_t*>(row_ptr + key_count);
1032  return reinterpret_cast<int64_t*>(align_to_int64(row_ptr_i8));
1033  }
1034  if (memcmp(row_ptr, key, key_count * sizeof(T)) == 0) {
1035  auto row_ptr_i8 = reinterpret_cast<int8_t*>(row_ptr + key_count);
1036  return reinterpret_cast<int64_t*>(align_to_int64(row_ptr_i8));
1037  }
1038  return nullptr;
1039 }
FORCE_INLINE HOST DEVICE T align_to_int64(T addr)

+ Here is the call graph for this function:

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 
)

Definition at line 1041 of file RuntimeFunctions.cpp.

References get_matching_group_value().

1046  {
1047  switch (key_width) {
1048  case 4:
1049  return get_matching_group_value(groups_buffer,
1050  h,
1051  reinterpret_cast<const int32_t*>(key),
1052  key_count,
1053  row_size_quad);
1054  case 8:
1055  return get_matching_group_value(groups_buffer, h, key, key_count, row_size_quad);
1056  default:;
1057  }
1058  return nullptr;
1059 }
__device__ 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:

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 1109 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64, and i.

1114  {
1115  auto off = h;
1116  if (groups_buffer[off] == EMPTY_KEY_64) {
1117  for (size_t i = 0; i < key_qw_count; ++i) {
1118  groups_buffer[off] = key[i];
1119  off += entry_count;
1120  }
1121  return &groups_buffer[off];
1122  }
1123  off = h;
1124  for (size_t i = 0; i < key_qw_count; ++i) {
1125  if (groups_buffer[off] != key[i]) {
1126  return nullptr;
1127  }
1128  off += entry_count;
1129  }
1130  return &groups_buffer[off];
1131 }
#define EMPTY_KEY_64
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 1062 of file RuntimeFunctions.cpp.

References i, and omnisci.dtypes::T.

1066  {
1067  auto off = h;
1068  auto key_buffer = reinterpret_cast<T*>(groups_buffer);
1069  if (key_buffer[off] == get_empty_key<T>()) {
1070  for (size_t i = 0; i < key_count; ++i) {
1071  key_buffer[off] = key[i];
1072  off += entry_count;
1073  }
1074  return h;
1075  }
1076  off = h;
1077  for (size_t i = 0; i < key_count; ++i) {
1078  if (key_buffer[off] != key[i]) {
1079  return -1;
1080  }
1081  off += entry_count;
1082  }
1083  return h;
1084 }
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 1087 of file RuntimeFunctions.cpp.

References get_matching_group_value_columnar_slot().

1092  {
1093  switch (key_width) {
1094  case 4:
1095  return get_matching_group_value_columnar_slot(groups_buffer,
1096  entry_count,
1097  h,
1098  reinterpret_cast<const int32_t*>(key),
1099  key_count);
1100  case 8:
1102  groups_buffer, entry_count, h, key, key_count);
1103  default:
1104  return -1;
1105  }
1106  return -1;
1107 }
__device__ 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:

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 1144 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64, and i.

1149  {
1150  uint32_t off = hashed_index * row_size_quad;
1151  if (groups_buffer[off] == EMPTY_KEY_64) {
1152  for (uint32_t i = 0; i < key_count; ++i) {
1153  groups_buffer[off + i] = key[i];
1154  }
1155  }
1156  return groups_buffer + off + key_count;
1157 }
#define EMPTY_KEY_64
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 1165 of file RuntimeFunctions.cpp.

1168  {
1169  return groups_buffer + row_size_quad * hashed_index;
1170 }
GPU_RT_STUB int64_t get_thread_index ( )

Definition at line 925 of file RuntimeFunctions.cpp.

925  {
926  return 0;
927 }
NEVER_INLINE int32_t group_buff_idx_impl ( )

Definition at line 913 of file RuntimeFunctions.cpp.

References pos_start_impl().

913  {
914  return pos_start_impl(nullptr);
915 }
__device__ int32_t pos_start_impl(const int32_t *row_index_resume)
Definition: cuda_mapd_rt.cu:28

+ Here is the call graph for this function:

NEVER_INLINE void init_columnar_group_by_buffer_gpu ( int64_t *  groups_buffer,
const int64_t *  init_vals,
const uint32_t  groups_buffer_entry_count,
const uint32_t  key_qw_count,
const uint32_t  agg_col_count,
const bool  keyless,
const bool  blocks_share_memory,
const int32_t  frag_idx 
)

Definition at line 992 of file RuntimeFunctions.cpp.

1000  {
1001 #ifndef _WIN32
1002  // the body is not really needed, just make sure the call is not optimized away
1003  assert(groups_buffer);
1004 #endif
1005 }
NEVER_INLINE void init_group_by_buffer_gpu ( int64_t *  groups_buffer,
const int64_t *  init_vals,
const uint32_t  groups_buffer_entry_count,
const uint32_t  key_qw_count,
const uint32_t  agg_col_count,
const bool  keyless,
const int8_t  warp_size 
)

Definition at line 978 of file RuntimeFunctions.cpp.

985  {
986 #ifndef _WIN32
987  // the body is not really needed, just make sure the call is not optimized away
988  assert(groups_buffer);
989 #endif
990 }
NEVER_INLINE void init_group_by_buffer_impl ( int64_t *  groups_buffer,
const int64_t *  init_vals,
const uint32_t  groups_buffer_entry_count,
const uint32_t  key_qw_count,
const uint32_t  agg_col_count,
const bool  keyless,
const int8_t  warp_size 
)

Definition at line 1007 of file RuntimeFunctions.cpp.

1014  {
1015 #ifndef _WIN32
1016  // the body is not really needed, just make sure the call is not optimized away
1017  assert(groups_buffer);
1018 #endif
1019 }
int64_t* init_shared_mem ( const int64_t *  global_groups_buffer,
const int32_t  groups_buffer_size 
)

Definition at line 973 of file RuntimeFunctions.cpp.

974  {
975  return nullptr;
976 }
NEVER_INLINE const int64_t* init_shared_mem_nop ( const int64_t *  groups_buffer,
const int32_t  groups_buffer_size 
)

Definition at line 958 of file RuntimeFunctions.cpp.

960  {
961  return groups_buffer;
962 }
ALWAYS_INLINE DEVICE int32_t key_for_string_encoded ( const int32_t  str_id)

Definition at line 1255 of file RuntimeFunctions.cpp.

1255  {
1256  return str_id;
1257 }
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 1310 of file RuntimeFunctions.cpp.

References MurmurHash1().

1313  {
1314  const uint32_t bit_pos = MurmurHash1(key_bytes, key_len, 0) % (bitmap_bytes * 8);
1315  const uint32_t word_idx = bit_pos / 32;
1316  const uint32_t bit_idx = bit_pos % 32;
1317  reinterpret_cast<uint32_t*>(bitmap)[word_idx] |= 1 << bit_idx;
1318 }
RUNTIME_EXPORT 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:

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 1289 of file RuntimeFunctions.cpp.

1292  {
1293  return *count != 0 ? (static_cast<double>(*sum) / pow(10, scale)) / *count : null_val;
1294 }
int count
ALWAYS_INLINE double load_avg_double ( const int64_t *  agg,
const int64_t *  count,
const double  null_val 
)

Definition at line 1296 of file RuntimeFunctions.cpp.

1298  {
1299  return *count != 0 ? *reinterpret_cast<const double*>(may_alias_ptr(agg)) / *count
1300  : null_val;
1301 }
int count
ALWAYS_INLINE double load_avg_float ( const int32_t *  agg,
const int32_t *  count,
const double  null_val 
)

Definition at line 1303 of file RuntimeFunctions.cpp.

1305  {
1306  return *count != 0 ? *reinterpret_cast<const float*>(may_alias_ptr(agg)) / *count
1307  : null_val;
1308 }
int count
ALWAYS_INLINE double load_avg_int ( const int64_t *  sum,
const int64_t *  count,
const double  null_val 
)

Definition at line 1283 of file RuntimeFunctions.cpp.

1285  {
1286  return *count != 0 ? static_cast<double>(*sum) / *count : null_val;
1287 }
int count
ALWAYS_INLINE double load_double ( const int64_t *  agg)

Definition at line 1275 of file RuntimeFunctions.cpp.

1275  {
1276  return *reinterpret_cast<const double*>(may_alias_ptr(agg));
1277 }
ALWAYS_INLINE float load_float ( const int32_t *  agg)

Definition at line 1279 of file RuntimeFunctions.cpp.

1279  {
1280  return *reinterpret_cast<const float*>(may_alias_ptr(agg));
1281 }
ALWAYS_INLINE int8_t logical_and ( const int8_t  lhs,
const int8_t  rhs,
const int8_t  null_val 
)

Definition at line 272 of file RuntimeFunctions.cpp.

274  {
275  if (lhs == null_val) {
276  return rhs == 0 ? rhs : null_val;
277  }
278  if (rhs == null_val) {
279  return lhs == 0 ? lhs : null_val;
280  }
281  return (lhs && rhs) ? 1 : 0;
282 }
ALWAYS_INLINE int8_t logical_not ( const int8_t  operand,
const int8_t  null_val 
)

Definition at line 268 of file RuntimeFunctions.cpp.

268  {
269  return operand == null_val ? operand : (operand ? 0 : 1);
270 }
ALWAYS_INLINE int8_t logical_or ( const int8_t  lhs,
const int8_t  rhs,
const int8_t  null_val 
)

Definition at line 284 of file RuntimeFunctions.cpp.

286  {
287  if (lhs == null_val) {
288  return rhs == 0 ? null_val : rhs;
289  }
290  if (rhs == null_val) {
291  return lhs == 0 ? null_val : lhs;
292  }
293  return (lhs || rhs) ? 1 : 0;
294 }
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 1381 of file RuntimeFunctions.cpp.

References i, and query_stub().

1391  {
1392  for (uint32_t i = 0; i < *num_fragments; ++i) {
1393  query_stub(col_buffers ? col_buffers[i] : nullptr,
1394  &num_rows[i * (*num_tables_ptr)],
1395  &frag_row_offsets[i * (*num_tables_ptr)],
1396  max_matched,
1397  init_agg_value,
1398  out,
1399  i,
1400  join_hash_tables,
1401  total_matched,
1402  error_code);
1403  }
1404 }
NEVER_INLINE void query_stub(const int8_t **col_buffers, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, const int64_t *init_agg_value, int64_t **out, uint32_t frag_idx, const int64_t *join_hash_tables, int32_t *error_code, int32_t *total_matched)

+ Here is the call graph for this function:

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 1338 of file RuntimeFunctions.cpp.

References i, and query_stub_hoisted_literals().

1349  {
1350  for (uint32_t i = 0; i < *num_fragments; ++i) {
1351  query_stub_hoisted_literals(col_buffers ? col_buffers[i] : nullptr,
1352  literals,
1353  &num_rows[i * (*num_tables_ptr)],
1354  &frag_row_offsets[i * (*num_tables_ptr)],
1355  max_matched,
1356  init_agg_value,
1357  out,
1358  i,
1359  join_hash_tables,
1360  total_matched,
1361  error_code);
1362  }
1363 }
NEVER_INLINE void query_stub_hoisted_literals(const int8_t **col_buffers, const int8_t *literals, const int64_t *num_rows, const uint64_t *frag_row_offsets, const int32_t *max_matched, const int64_t *init_agg_value, int64_t **out, uint32_t frag_idx, const int64_t *join_hash_tables, int32_t *error_code, int32_t *total_matched)

+ Here is the call graph for this function:

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

Definition at line 1270 of file RuntimeFunctions.cpp.

1271  {
1272  return reinterpret_cast<const double*>(output_buff)[pos];
1273 }
NEVER_INLINE int32_t pos_start_impl ( int32_t *  error_code)

Definition at line 904 of file RuntimeFunctions.cpp.

904  {
905  int32_t row_index_resume{0};
906  if (error_code) {
907  row_index_resume = error_code[0];
908  error_code[0] = 0;
909  }
910  return row_index_resume;
911 }
NEVER_INLINE int32_t pos_step_impl ( )

Definition at line 917 of file RuntimeFunctions.cpp.

917  {
918  return 1;
919 }
NEVER_INLINE void query_stub ( const int8_t **  col_buffers,
const int64_t *  num_rows,
const uint64_t *  frag_row_offsets,
const int32_t *  max_matched,
const int64_t *  init_agg_value,
int64_t **  out,
uint32_t  frag_idx,
const int64_t *  join_hash_tables,
int32_t *  error_code,
int32_t *  total_matched 
)

Definition at line 1365 of file RuntimeFunctions.cpp.

Referenced by multifrag_query().

1374  {
1375 #ifndef _WIN32
1376  assert(col_buffers || num_rows || frag_row_offsets || max_matched || init_agg_value ||
1377  out || frag_idx || error_code || join_hash_tables || total_matched);
1378 #endif
1379 }

+ Here is the caller graph for this function:

NEVER_INLINE void query_stub_hoisted_literals ( const int8_t **  col_buffers,
const int8_t *  literals,
const int64_t *  num_rows,
const uint64_t *  frag_row_offsets,
const int32_t *  max_matched,
const int64_t *  init_agg_value,
int64_t **  out,
uint32_t  frag_idx,
const int64_t *  join_hash_tables,
int32_t *  error_code,
int32_t *  total_matched 
)

Definition at line 1320 of file RuntimeFunctions.cpp.

Referenced by multifrag_query_hoisted_literals().

1330  {
1331 #ifndef _WIN32
1332  assert(col_buffers || literals || num_rows || frag_row_offsets || max_matched ||
1333  init_agg_value || out || frag_idx || error_code || join_hash_tables ||
1334  total_matched);
1335 #endif
1336 }

+ Here is the caller graph for this function:

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

Definition at line 939 of file RuntimeFunctions.cpp.

References pos_start_impl().

940  {
941  // NB: never override persistent error codes (with code greater than zero).
942  // On GPU, a projection query with a limit can run out of slots without it
943  // being an actual error if the limit has been hit. If a persistent error
944  // (division by zero, for example) occurs before running out of slots, we
945  // have to avoid overriding it, because there's a risk that the query would
946  // go through if we override with a potentially benign out-of-slots code.
947  if (err_code && error_codes[pos_start_impl(nullptr)] <= 0) {
948  error_codes[pos_start_impl(nullptr)] = err_code;
949  }
950 }
__device__ int32_t pos_start_impl(const int32_t *row_index_resume)
Definition: cuda_mapd_rt.cu:28

+ Here is the call graph for this function:

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

Definition at line 1265 of file RuntimeFunctions.cpp.

1266  {
1267  return reinterpret_cast<const int64_t*>(output_buff)[pos];
1268 }
ALWAYS_INLINE DEVICE bool sample_ratio ( const double  proportion,
const int64_t  row_offset 
)

Definition at line 1259 of file RuntimeFunctions.cpp.

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

1260  {
1261  const int64_t threshold = 4294967296 * proportion;
1262  return (row_offset * 2654435761) % 4294967296 < threshold;
1263 }

+ Here is the caller graph for this function:

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 197 of file RuntimeFunctions.cpp.

199  {
200  int64_t tmp = scale >> 1;
201  tmp = operand >= 0 ? operand + tmp : operand - tmp;
202  return tmp / scale;
203 }
ALWAYS_INLINE int64_t scale_decimal_down_nullable ( const int64_t  operand,
const int64_t  scale,
const int64_t  null_val 
)

Definition at line 184 of file RuntimeFunctions.cpp.

186  {
187  // rounded scale down of a decimal
188  if (operand == null_val) {
189  return null_val;
190  }
191 
192  int64_t tmp = scale >> 1;
193  tmp = operand >= 0 ? operand + tmp : operand - tmp;
194  return tmp / scale;
195 }
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 177 of file RuntimeFunctions.cpp.

180  {
181  return operand != operand_null_val ? operand * scale : result_null_val;
182 }
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 1176 of file RuntimeFunctions.cpp.

References EMPTY_KEY_64, and i.

1181  {
1182  if (groups_buffer[hashed_index] == EMPTY_KEY_64) {
1183  for (uint32_t i = 0; i < key_count; i++) {
1184  groups_buffer[i * entry_count + hashed_index] = key[i];
1185  }
1186  }
1187 }
#define EMPTY_KEY_64
ALWAYS_INLINE uint64_t string_pack ( const int8_t *  ptr,
const int32_t  len 
)

Definition at line 1228 of file RuntimeFunctions.cpp.

1228  {
1229  return (reinterpret_cast<const uint64_t>(ptr) & 0xffffffffffff) |
1230  (static_cast<const uint64_t>(len) << 48);
1231 }
GPU_RT_STUB void sync_threadblock ( )

Definition at line 897 of file RuntimeFunctions.cpp.

897 {}
GPU_RT_STUB void sync_warp ( )

Definition at line 895 of file RuntimeFunctions.cpp.

895 {}
GPU_RT_STUB void sync_warp_protected ( int64_t  thread_pos,
int64_t  row_count 
)

Definition at line 896 of file RuntimeFunctions.cpp.

896 {}
GPU_RT_STUB int8_t thread_warp_idx ( const int8_t  warp_sz)

Definition at line 921 of file RuntimeFunctions.cpp.

921  {
922  return 0;
923 }
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 899 of file RuntimeFunctions.cpp.

901  {};
NEVER_INLINE void write_back_nop ( int64_t *  dest,
int64_t *  src,
const int32_t  sz 
)

Definition at line 964 of file RuntimeFunctions.cpp.

966  {
967 #ifndef _WIN32
968  // the body is not really needed, just make sure the call is not optimized away
969  assert(dest);
970 #endif
971 }