26 #include "tbb/enumerable_thread_specific.h"
34 , task_group_(nullptr)
42 std::vector<size_t> outer_table_fragment_ids);
61 auto getThreadPool() {
67 auto& getTlsExecutionContext() {
68 return tls_execution_context_;
87 tbb::enumerable_thread_specific<std::unique_ptr<QueryExecutionContext>>
88 tls_execution_context_;
106 , chosen_device_type(chosen_device_type)
107 , chosen_device_id(chosen_device_id)
109 , column_fetcher(column_fetcher)
110 , query_comp_desc(query_comp_desc)
111 , query_mem_desc(query_mem_desc)
112 , frag_list(frag_list)
113 , kernel_dispatch_mode(kernel_dispatch_mode)
115 , rowid_lookup_key(rowid_lookup_key) {}
117 void run(Executor* executor,
118 const size_t thread_idx,
139 void runImpl(Executor* executor,
140 const size_t thread_idx,
147 class KernelSubtask {
151 std::shared_ptr<FetchResult> fetch_result,
152 std::shared_ptr<std::list<ChunkIter>> chunk_iterators,
153 int64_t total_num_input_rows,
158 , shared_context_(shared_context)
159 , fetch_result_(fetch_result)
160 , chunk_iterators_(chunk_iterators)
161 , total_num_input_rows_(total_num_input_rows)
162 , start_rowid_(start_rowid)
163 , num_rows_to_process_(num_rows_to_process)
166 void run(Executor* executor);
169 void runImpl(Executor* executor);
173 std::shared_ptr<FetchResult> fetch_result_;
174 std::shared_ptr<std::list<ChunkIter>> chunk_iterators_;
175 int64_t total_num_input_rows_;
177 size_t num_rows_to_process_;
std::atomic_flag dynamic_watchdog_set
const ExecutionOptions & eo
const std::vector< uint64_t > & getFragOffsets()
int32_t get_chosen_device_id() const
size_t num_allocated_threads_
const ExecutorDispatchMode kernel_dispatch_mode
const RelAlgExecutionUnit & ra_exe_unit_
std::vector< uint64_t > all_frag_row_offsets_
const int64_t rowid_lookup_key
std::mutex all_frag_row_offsets_mutex_
void addDeviceResults(ResultSetPtr &&device_results, std::vector< size_t > outer_table_fragment_ids)
const ExecutorDeviceType chosen_device_type
size_t num_rows_to_process(const size_t start_row_index, const size_t max_fragment_size, const size_t rows_remaining)
std::shared_ptr< ResultSet > ResultSetPtr
RenderInfo * render_info_
Container for compilation results and assorted options for a single execution unit.
std::vector< FragmentsPerTable > FragmentsList
FragmentsList get_fragment_list() const
const RegisteredQueryHint query_hint_
const QueryMemoryDescriptor & query_mem_desc
const QueryCompilationDescriptor & query_comp_desc
void runImpl(Executor *executor, const size_t thread_idx, SharedKernelContext &shared_context)
std::vector< std::pair< ResultSetPtr, std::vector< size_t > > > all_fragment_results_
void run(Executor *executor, const size_t thread_idx, SharedKernelContext &shared_context)
const FragmentsList frag_list
ExecutionKernel(const RelAlgExecutionUnit &ra_exe_unit, const ExecutorDeviceType chosen_device_type, int chosen_device_id, const ExecutionOptions &eo, const ColumnFetcher &column_fetcher, const QueryCompilationDescriptor &query_comp_desc, const QueryMemoryDescriptor &query_mem_desc, const FragmentsList &frag_list, const ExecutorDispatchMode kernel_dispatch_mode, RenderInfo *render_info, const int64_t rowid_lookup_key)
const std::vector< InputTableInfo > & getQueryInfos() const
ResultSetPtr device_results_
std::vector< std::pair< ResultSetPtr, std::vector< size_t > > > & getFragmentResults()
void setNumAllocatedThreads(size_t num_threads)
const std::vector< InputTableInfo > & query_infos_
size_t getNumAllocatedThreads()
friend class KernelSubtask
SharedKernelContext(const std::vector< InputTableInfo > &query_infos)
const ColumnFetcher & column_fetcher