OmniSciDB
a5dc49c757
|
#include <ResultSetReductionJIT.h>
Public Member Functions | |
ResultSetReductionJIT (const QueryMemoryDescriptor &query_mem_desc, const std::vector< TargetInfo > &targets, const std::vector< int64_t > &target_init_vals, const size_t executor_id) | |
virtual | ~ResultSetReductionJIT ()=default |
virtual ReductionCode | codegen () const |
Protected Member Functions | |
void | isEmpty (const ReductionCode &reduction_code) const |
void | reduceOneEntryNoCollisions (const ReductionCode &reduction_code) const |
void | reduceOneEntryNoCollisionsIdx (const ReductionCode &reduction_code) const |
void | reduceLoop (const ReductionCode &reduction_code) const |
Protected Attributes | |
size_t | executor_id_ |
Private Member Functions | |
void | reduceOneEntryTargetsNoCollisions (Function *ir_reduce_one_entry, Value *this_targets_start_ptr, Value *that_targets_start_ptr) const |
void | reduceOneEntryBaseline (const ReductionCode &reduction_code) const |
void | reduceOneEntryBaselineIdx (const ReductionCode &reduction_code) const |
void | reduceOneSlot (Value *this_ptr1, Value *this_ptr2, Value *that_ptr1, Value *that_ptr2, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const size_t init_agg_val_idx, const size_t first_slot_idx_for_target, Function *ir_reduce_one_entry) const |
void | reduceOneAggregateSlot (Value *this_ptr1, Value *this_ptr2, Value *that_ptr1, Value *that_ptr2, const TargetInfo &target_info, const size_t target_logical_idx, const size_t target_slot_idx, const int64_t init_val, const int8_t chosen_bytes, Function *ir_reduce_one_entry) const |
void | reduceOneCountDistinctSlot (Value *this_ptr1, Value *that_ptr1, const size_t target_logical_idx, Function *ir_reduce_one_entry) const |
void | reduceOneApproxQuantileSlot (Value *this_ptr1, Value *that_ptr1, const size_t target_logical_idx, Function *ir_reduce_one_entry) const |
void | reduceOneModeSlot (Value *this_ptr1, Value *that_ptr1, const size_t target_logical_idx, Function *ir_reduce_one_entry) const |
void | finalizeReductionCode (ReductionCode &reduction_code, const llvm::Function *ir_is_empty, const llvm::Function *ir_reduce_one_entry, const llvm::Function *ir_reduce_one_entry_idx, const CodeCacheKey &key) const |
std::string | cacheKey () const |
Private Attributes | |
const QueryMemoryDescriptor | query_mem_desc_ |
const std::vector< TargetInfo > | targets_ |
const std::vector< int64_t > | target_init_vals_ |
Definition at line 52 of file ResultSetReductionJIT.h.
ResultSetReductionJIT::ResultSetReductionJIT | ( | const QueryMemoryDescriptor & | query_mem_desc, |
const std::vector< TargetInfo > & | targets, | ||
const std::vector< int64_t > & | target_init_vals, | ||
const size_t | executor_id | ||
) |
Definition at line 527 of file ResultSetReductionJIT.cpp.
|
virtualdefault |
|
private |
Definition at line 1308 of file ResultSetReductionJIT.cpp.
References join(), query_mem_desc_, QueryMemoryDescriptor::reductionKey(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), target_init_vals_, targets_, to_string(), and shared::transform().
Referenced by codegen().
|
virtual |
Reimplemented in GpuReductionHelperJIT.
Definition at line 567 of file ResultSetReductionJIT.cpp.
References AUTOMATIC_IR_METADATA, AUTOMATIC_IR_METADATA_DONE, QueryMemoryDescriptor::blocksShareMemory(), cacheKey(), anonymous_namespace{ResultSetReductionJIT.cpp}::create_llvm_function(), QueryMemoryDescriptor::didOutputColumnar(), executor_id_, f(), logger::FATAL, finalizeReductionCode(), QueryMemoryDescriptor::getEntryCount(), QueryMemoryDescriptor::getExecutor(), Executor::getExecutor(), QueryEngine::getInstance(), QueryMemoryDescriptor::getQueryDescriptionType(), heavyai::GroupByBaselineHash, heavyai::GroupByPerfectHash, anonymous_namespace{ResultSetReductionJIT.cpp}::INTERP_THRESHOLD, anonymous_namespace{ResultSetReductionJIT.cpp}::is_aggregate_query(), isEmpty(), LOG, heavyai::NonGroupedAggregate, query_mem_desc_, reduceLoop(), reduceOneEntryBaseline(), reduceOneEntryBaselineIdx(), reduceOneEntryNoCollisions(), reduceOneEntryNoCollisionsIdx(), anonymous_namespace{ResultSetReductionJIT.cpp}::setup_functions_ir(), and translate_function().
Referenced by anonymous_namespace{Execute.cpp}::get_reduction_code(), and ResultSetManager::reduce().
|
private |
Definition at line 1257 of file ResultSetReductionJIT.cpp.
References CPU, CodeGenerator::generateNativeCPUCode(), logger::IR, ReductionCode::llvm_reduce_loop, LOG, ReductionCode::module, ReductionJIT, serialize_llvm_object(), and VLOG.
Referenced by codegen().
|
protected |
Definition at line 641 of file ResultSetReductionJIT.cpp.
References CHECK, CHECK_GE, CHECK_LT, QueryMemoryDescriptor::didOutputColumnar(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_load_i32(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_load_i64(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_read_int_from_buff(), EMPTY_KEY_32, EMPTY_KEY_64, ICmp::EQ, logger::FATAL, result_set::get_byteoff_of_slot(), QueryMemoryDescriptor::getEffectiveKeyWidth(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), QueryMemoryDescriptor::getQueryDescriptionType(), QueryMemoryDescriptor::getTargetIdxForKey(), heavyai::GroupByPerfectHash, QueryMemoryDescriptor::hasKeylessHash(), Int32, Int64, ReductionCode::ir_is_empty, anonymous_namespace{ResultSetReductionJIT.cpp}::is_aggregate_query(), LOG, query_mem_desc_, and target_init_vals_.
Referenced by codegen(), and GpuReductionHelperJIT::codegen().
|
protected |
Definition at line 1033 of file ResultSetReductionJIT.cpp.
References anonymous_namespace{ResultSetReductionJIT.cpp}::generate_loop_body(), Int32, ReductionCode::ir_reduce_loop, and ReductionCode::ir_reduce_one_entry_idx.
Referenced by codegen(), and GpuReductionHelperJIT::codegen().
|
private |
Definition at line 1133 of file ResultSetReductionJIT.cpp.
References TargetInfo::agg_kind, CHECK_EQ, anonymous_namespace{ResultSetReductionJIT.cpp}::emit_aggregate_one_count(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_aggregate_one_nullable_value(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), is_distinct_target(), kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, kAVG, kCOUNT, kCOUNT_IF, kMAX, kMIN, kMODE, kSUM, kSUM_IF, query_mem_desc_, reduceOneApproxQuantileSlot(), reduceOneCountDistinctSlot(), reduceOneModeSlot(), and UNREACHABLE.
Referenced by reduceOneSlot().
|
private |
Definition at line 1214 of file ResultSetReductionJIT.cpp.
References CHECK_LT, anonymous_namespace{ResultSetReductionJIT.cpp}::emit_load_i64(), QueryMemoryDescriptor::getCountDistinctDescriptorsSize(), Int64, query_mem_desc_, and Void.
Referenced by reduceOneAggregateSlot().
|
private |
Definition at line 1192 of file ResultSetReductionJIT.cpp.
References CHECK_LT, anonymous_namespace{ResultSetReductionJIT.cpp}::emit_load_i64(), QueryMemoryDescriptor::getCountDistinctDescriptorsSize(), Int64, query_mem_desc_, and Void.
Referenced by reduceOneAggregateSlot().
|
private |
Definition at line 803 of file ResultSetReductionJIT.cpp.
References advance_slot(), QueryMemoryDescriptor::getTargetGroupbyIndex(), Int32, ReductionCode::ir_reduce_one_entry, kAVG, kSAMPLE, query_mem_desc_, reduceOneSlot(), QueryMemoryDescriptor::targetGroupbyIndicesSize(), targets_, and to_string().
Referenced by codegen().
|
private |
Definition at line 896 of file ResultSetReductionJIT.cpp.
References Cast::BitCast, CHECK, QueryMemoryDescriptor::didOutputColumnar(), get_row_bytes(), get_slot_off_quad(), QueryMemoryDescriptor::getGroupbyColCount(), QueryMemoryDescriptor::getQueryDescriptionType(), heavyai::GroupByBaselineHash, QueryMemoryDescriptor::hasKeylessHash(), Int1, Int32, Int64, Int64Ptr, Int8, Int8Ptr, ReductionCode::ir_is_empty, ReductionCode::ir_reduce_one_entry, ReductionCode::ir_reduce_one_entry_idx, BinaryOperator::Mul, query_mem_desc_, Cast::SExt, Cast::Trunc, and Void.
Referenced by codegen().
|
protected |
Definition at line 688 of file ResultSetReductionJIT.cpp.
References align_to_int64(), get_key_bytes_rowwise(), Int32, ReductionCode::ir_is_empty, ReductionCode::ir_reduce_one_entry, query_mem_desc_, and reduceOneEntryTargetsNoCollisions().
Referenced by codegen(), and GpuReductionHelperJIT::codegen().
|
protected |
Definition at line 862 of file ResultSetReductionJIT.cpp.
References CHECK, get_row_bytes(), QueryMemoryDescriptor::getQueryDescriptionType(), heavyai::GroupByPerfectHash, Int64, ReductionCode::ir_reduce_one_entry, ReductionCode::ir_reduce_one_entry_idx, BinaryOperator::Mul, heavyai::NonGroupedAggregate, query_mem_desc_, and Cast::SExt.
Referenced by codegen(), and GpuReductionHelperJIT::codegen().
|
private |
Definition at line 720 of file ResultSetReductionJIT.cpp.
References QueryMemoryDescriptor::getColSlotContext(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), QueryMemoryDescriptor::getTargetGroupbyIndex(), Int32, kAVG, kSAMPLE, query_mem_desc_, reduceOneSlot(), QueryMemoryDescriptor::targetGroupbyIndicesSize(), targets_, to_string(), and UNLIKELY.
Referenced by reduceOneEntryNoCollisions().
|
private |
Definition at line 1236 of file ResultSetReductionJIT.cpp.
References CHECK_LT, anonymous_namespace{ResultSetReductionJIT.cpp}::emit_load_i64(), QueryMemoryDescriptor::getCountDistinctDescriptorsSize(), Int64, query_mem_desc_, and Void.
Referenced by reduceOneAggregateSlot().
|
private |
Definition at line 1058 of file ResultSetReductionJIT.cpp.
References TargetInfo::agg_kind, CHECK, CHECK_LT, anonymous_namespace{ResultSetReductionJIT.cpp}::emit_checked_write_projection(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_write_projection(), SQLTypeInfo::get_elem_type(), result_set::get_width_for_slot(), QueryMemoryDescriptor::getTargetGroupbyIndex(), Int32, Int64, TargetInfo::is_agg, SQLTypeInfo::is_geometry(), SQLTypeInfo::is_string(), SQLTypeInfo::is_varlen(), kSAMPLE, kSINGLE_VALUE, ICmp::NE, query_mem_desc_, reduceOneAggregateSlot(), TargetInfo::sql_type, takes_float_argument(), target_init_vals_, QueryMemoryDescriptor::targetGroupbyIndicesSize(), and Void.
Referenced by reduceOneEntryBaseline(), and reduceOneEntryTargetsNoCollisions().
|
protected |
Definition at line 78 of file ResultSetReductionJIT.h.
Referenced by codegen(), and GpuReductionHelperJIT::codegen().
|
private |
Definition at line 140 of file ResultSetReductionJIT.h.
Referenced by cacheKey(), codegen(), GpuReductionHelperJIT::codegen(), isEmpty(), reduceOneAggregateSlot(), reduceOneApproxQuantileSlot(), reduceOneCountDistinctSlot(), reduceOneEntryBaseline(), reduceOneEntryBaselineIdx(), reduceOneEntryNoCollisions(), reduceOneEntryNoCollisionsIdx(), reduceOneEntryTargetsNoCollisions(), reduceOneModeSlot(), and reduceOneSlot().
|
private |
Definition at line 142 of file ResultSetReductionJIT.h.
Referenced by cacheKey(), isEmpty(), and reduceOneSlot().
|
private |
Definition at line 141 of file ResultSetReductionJIT.h.
Referenced by cacheKey(), reduceOneEntryBaseline(), and reduceOneEntryTargetsNoCollisions().