OmniSciDB
c1a53651b2
|
#include <QueryExecutionContext.h>
Public Member Functions | |
QueryExecutionContext (const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &, const Executor *executor, const ExecutorDeviceType device_type, const ExecutorDispatchMode dispatch_mode, const int device_id, const shared::TableKey &outer_table_key, const int64_t num_rows, const std::vector< std::vector< const int8_t * >> &col_buffers, const std::vector< std::vector< uint64_t >> &frag_offsets, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const bool output_columnar, const bool sort_on_gpu, const size_t thread_idx, RenderInfo *) | |
ResultSetPtr | getRowSet (const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc) const |
ResultSetPtr | groupBufferToResults (const size_t i) const |
std::vector< int64_t * > | launchGpuCode (const RelAlgExecutionUnit &ra_exe_unit, const CompilationContext *compilation_context, const bool hoist_literals, const std::vector< int8_t > &literal_buff, std::vector< std::vector< const int8_t * >> col_buffers, const std::vector< std::vector< int64_t >> &num_rows, const std::vector< std::vector< uint64_t >> &frag_row_offsets, const int32_t scan_limit, Data_Namespace::DataMgr *data_mgr, const unsigned block_size_x, const unsigned grid_size_x, const int device_id, const size_t shared_memory_size, int32_t *error_code, const uint32_t num_tables, const bool allow_runtime_interrupt, const std::vector< int8_t * > &join_hash_tables, RenderAllocatorMap *render_allocator_map, bool optimize_cuda_block_and_grid_sizes) |
std::vector< int64_t * > | launchCpuCode (const RelAlgExecutionUnit &ra_exe_unit, const CpuCompilationContext *fn_ptrs, const bool hoist_literals, const std::vector< int8_t > &literal_buff, std::vector< std::vector< const int8_t * >> col_buffers, const std::vector< std::vector< int64_t >> &num_rows, const std::vector< std::vector< uint64_t >> &frag_row_offsets, const int32_t scan_limit, int32_t *error_code, const uint32_t num_tables, const std::vector< int8_t * > &join_hash_tables, const int64_t num_rows_to_process=-1) |
int64_t | getAggInitValForIndex (const size_t index) const |
Private Types | |
enum | { COL_BUFFERS, NUM_FRAGMENTS, LITERALS, NUM_ROWS, FRAG_ROW_OFFSETS, MAX_MATCHED, TOTAL_MATCHED, INIT_AGG_VALS, GROUPBY_BUF, ERROR_CODE, NUM_TABLES, JOIN_HASH_TABLES, ROW_FUNC_MGR, KERN_PARAM_COUNT } |
Private Member Functions | |
std::vector< int8_t * > | prepareKernelParams (const std::vector< std::vector< const int8_t * >> &col_buffers, const std::vector< int8_t > &literal_buff, const std::vector< std::vector< int64_t >> &num_rows, const std::vector< std::vector< uint64_t >> &frag_offsets, const int32_t scan_limit, const std::vector< int64_t > &init_agg_vals, const std::vector< int32_t > &error_codes, const uint32_t num_tables, const std::vector< int8_t * > &join_hash_tables, Data_Namespace::DataMgr *data_mgr, const int device_id, const bool hoist_literals, const bool is_group_by) const |
ResultSetPtr | groupBufferToDeinterleavedResults (const size_t i) const |
Private Attributes | |
std::unique_ptr< DeviceAllocator > | gpu_allocator_ |
QueryMemoryDescriptor | query_mem_desc_ |
const Executor * | executor_ |
const ExecutorDeviceType | device_type_ |
const ExecutorDispatchMode | dispatch_mode_ |
std::shared_ptr < RowSetMemoryOwner > | row_set_mem_owner_ |
const bool | output_columnar_ |
std::unique_ptr < QueryMemoryInitializer > | query_buffers_ |
std::unique_ptr< ResultSet > | estimator_result_set_ |
Friends | |
class | Executor |
Definition at line 39 of file QueryExecutionContext.h.
|
private |
Enumerator | |
---|---|
COL_BUFFERS | |
NUM_FRAGMENTS | |
LITERALS | |
NUM_ROWS | |
FRAG_ROW_OFFSETS | |
MAX_MATCHED | |
TOTAL_MATCHED | |
INIT_AGG_VALS | |
GROUPBY_BUF | |
ERROR_CODE | |
NUM_TABLES | |
JOIN_HASH_TABLES | |
ROW_FUNC_MGR | |
KERN_PARAM_COUNT |
Definition at line 101 of file QueryExecutionContext.h.
QueryExecutionContext::QueryExecutionContext | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const QueryMemoryDescriptor & | query_mem_desc, | ||
const Executor * | executor, | ||
const ExecutorDeviceType | device_type, | ||
const ExecutorDispatchMode | dispatch_mode, | ||
const int | device_id, | ||
const shared::TableKey & | outer_table_key, | ||
const int64_t | num_rows, | ||
const std::vector< std::vector< const int8_t * >> & | col_buffers, | ||
const std::vector< std::vector< uint64_t >> & | frag_offsets, | ||
std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner, | ||
const bool | output_columnar, | ||
const bool | sort_on_gpu, | ||
const size_t | thread_idx, | ||
RenderInfo * | render_info | ||
) |
Definition at line 33 of file QueryExecutionContext.cpp.
References CHECK, getQueryEngineCudaStreamForDevice(), GPU, gpu_allocator_, heavyai::InSituFlagsOwnerInterface::isInSitu(), query_buffers_, query_mem_desc, RenderInfo::render_allocator_map_ptr, and sort_on_gpu().
int64_t QueryExecutionContext::getAggInitValForIndex | ( | const size_t | index | ) | const |
Definition at line 152 of file QueryExecutionContext.cpp.
References CHECK, and query_buffers_.
Referenced by Executor::executePlanWithoutGroupBy().
ResultSetPtr QueryExecutionContext::getRowSet | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const QueryMemoryDescriptor & | query_mem_desc | ||
) | const |
Definition at line 157 of file QueryExecutionContext.cpp.
References CHECK, CHECK_EQ, CPU, DEBUG_TIMER, device_type_, executor_, GPU, groupBufferToResults(), QueryMemoryDescriptor::hasVarlenOutput(), query_buffers_, query_mem_desc_, row_set_mem_owner_, and QueryMemoryDescriptor::threadsShareMemory().
Referenced by Executor::executePlanWithGroupBy().
|
private |
Definition at line 84 of file QueryExecutionContext.cpp.
References CHECK, CPU, executor_, ResultSet::fixupQueryMemoryDescriptor(), g_enable_non_kernel_time_query_interrupt, QueryMemoryDescriptor::getColOffInBytes(), QueryMemoryDescriptor::getColOffInBytesInNextBin(), QueryMemoryDescriptor::getSlotCount(), output_columnar_, query_buffers_, query_mem_desc_, ResultSetStorage::reduceSingleRow(), row_set_mem_owner_, and UNLIKELY.
Referenced by groupBufferToResults().
ResultSetPtr QueryExecutionContext::groupBufferToResults | ( | const size_t | i | ) | const |
Definition at line 180 of file QueryExecutionContext.cpp.
References device_type_, groupBufferToDeinterleavedResults(), QueryMemoryDescriptor::interleavedBins(), query_buffers_, and query_mem_desc_.
Referenced by getRowSet().
std::vector< int64_t * > QueryExecutionContext::launchCpuCode | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const CpuCompilationContext * | fn_ptrs, | ||
const bool | hoist_literals, | ||
const std::vector< int8_t > & | literal_buff, | ||
std::vector< std::vector< const int8_t * >> | col_buffers, | ||
const std::vector< std::vector< int64_t >> & | num_rows, | ||
const std::vector< std::vector< uint64_t >> & | frag_row_offsets, | ||
const int32_t | scan_limit, | ||
int32_t * | error_code, | ||
const uint32_t | num_tables, | ||
const std::vector< int8_t * > & | join_hash_tables, | ||
const int64_t | num_rows_to_process = -1 |
||
) |
Definition at line 556 of file QueryExecutionContext.cpp.
References align_to_int64(), CHECK, CHECK_EQ, compact_init_vals(), CPU, DEBUG_TIMER, QueryMemoryDescriptor::didOutputColumnar(), RelAlgExecutionUnit::estimator, estimator_result_set_, executor_, CpuCompilationContext::func(), QueryMemoryDescriptor::getColsSize(), QueryMemoryDescriptor::getQueryDescriptionType(), INJECT_TIMER, QueryMemoryDescriptor::isGroupBy(), foreign_storage::num_rows_to_process(), Projection, query_buffers_, query_mem_desc_, and QueryMemoryDescriptor::useStreamingTopN().
Referenced by Executor::executePlanWithGroupBy(), and Executor::executePlanWithoutGroupBy().
std::vector< int64_t * > QueryExecutionContext::launchGpuCode | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const CompilationContext * | compilation_context, | ||
const bool | hoist_literals, | ||
const std::vector< int8_t > & | literal_buff, | ||
std::vector< std::vector< const int8_t * >> | col_buffers, | ||
const std::vector< std::vector< int64_t >> & | num_rows, | ||
const std::vector< std::vector< uint64_t >> & | frag_row_offsets, | ||
const int32_t | scan_limit, | ||
Data_Namespace::DataMgr * | data_mgr, | ||
const unsigned | block_size_x, | ||
const unsigned | grid_size_x, | ||
const int | device_id, | ||
const size_t | shared_memory_size, | ||
int32_t * | error_code, | ||
const uint32_t | num_tables, | ||
const bool | allow_runtime_interrupt, | ||
const std::vector< int8_t * > & | join_hash_tables, | ||
RenderAllocatorMap * | render_allocator_map, | ||
bool | optimize_cuda_block_and_grid_sizes | ||
) |
Definition at line 206 of file QueryExecutionContext.cpp.
References anonymous_namespace{QueryExecutionContext.cpp}::aggregate_error_codes(), CHECK, CHECK_EQ, create_device_kernel(), DEBUG_TIMER, QueryMemoryDescriptor::didOutputColumnar(), dispatch_mode_, ERROR_CODE, RelAlgExecutionUnit::estimator, estimator_result_set_, executor_, g_dynamic_watchdog_time_limit, g_enable_dynamic_watchdog, get_num_allocated_rows_from_gpu(), QueryMemoryDescriptor::getEntryCount(), QueryMemoryDescriptor::getQueryDescriptionType(), RenderAllocatorMap::getRenderAllocator(), GPU, gpu_allocator_, GROUPBY_BUF, QueryMemoryDescriptor::hasKeylessHash(), INIT_AGG_VALS, INJECT_TIMER, inplace_sort_gpu(), QueryMemoryDescriptor::isGroupBy(), KERN_PARAM_COUNT, LITERALS, MAX_MATCHED, SortInfo::order_entries, output_columnar_, prepareKernelParams(), Projection, query_buffers_, query_mem_desc_, RelAlgExecutionUnit::sort_info, QueryMemoryDescriptor::sortOnGpu(), to_string(), TOTAL_MATCHED, RelAlgExecutionUnit::use_bump_allocator, use_speculative_top_n(), QueryMemoryDescriptor::useStreamingTopN(), QueryMemoryDescriptor::varlenOutputBufferElemSize(), and VLOG.
Referenced by Executor::executePlanWithGroupBy(), and Executor::executePlanWithoutGroupBy().
|
private |
Definition at line 750 of file QueryExecutionContext.cpp.
References align_to_int64(), CHECK, CHECK_EQ, COL_BUFFERS, compact_init_vals(), ERROR_CODE, FRAG_ROW_OFFSETS, QueryMemoryDescriptor::getColsSize(), gpu_allocator_, INIT_AGG_VALS, JOIN_HASH_TABLES, KERN_PARAM_COUNT, LITERALS, MAX_MATCHED, NUM_FRAGMENTS, NUM_ROWS, NUM_TABLES, output_columnar_, query_buffers_, query_mem_desc_, ROW_FUNC_MGR, and TOTAL_MATCHED.
Referenced by launchGpuCode().
|
friend |
Definition at line 147 of file QueryExecutionContext.h.
|
private |
Definition at line 140 of file QueryExecutionContext.h.
Referenced by getRowSet(), and groupBufferToResults().
|
private |
Definition at line 141 of file QueryExecutionContext.h.
Referenced by launchGpuCode().
|
mutableprivate |
Definition at line 145 of file QueryExecutionContext.h.
Referenced by Executor::executePlanWithoutGroupBy(), launchCpuCode(), and launchGpuCode().
|
private |
Definition at line 139 of file QueryExecutionContext.h.
Referenced by getRowSet(), groupBufferToDeinterleavedResults(), launchCpuCode(), and launchGpuCode().
|
private |
Definition at line 135 of file QueryExecutionContext.h.
Referenced by launchGpuCode(), prepareKernelParams(), and QueryExecutionContext().
|
private |
Definition at line 143 of file QueryExecutionContext.h.
Referenced by groupBufferToDeinterleavedResults(), launchGpuCode(), and prepareKernelParams().
|
private |
Definition at line 144 of file QueryExecutionContext.h.
Referenced by Executor::executePlanWithGroupBy(), Executor::executePlanWithoutGroupBy(), getAggInitValForIndex(), getRowSet(), groupBufferToDeinterleavedResults(), groupBufferToResults(), launchCpuCode(), launchGpuCode(), prepareKernelParams(), and QueryExecutionContext().
|
private |
Definition at line 138 of file QueryExecutionContext.h.
Referenced by Executor::executePlanWithGroupBy(), Executor::executePlanWithoutGroupBy(), getRowSet(), groupBufferToDeinterleavedResults(), groupBufferToResults(), launchCpuCode(), launchGpuCode(), and prepareKernelParams().
|
private |
Definition at line 142 of file QueryExecutionContext.h.
Referenced by getRowSet(), and groupBufferToDeinterleavedResults().