OmniSciDB  21ac014ffc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QueryCompilationDescriptor Class Reference

#include <QueryCompilationDescriptor.h>

+ Collaboration diagram for QueryCompilationDescriptor:

Public Member Functions

 QueryCompilationDescriptor ()
 
std::unique_ptr
< QueryMemoryDescriptor
compile (const size_t max_groups_buffer_entry_guess, const int8_t crt_min_byte_width, const bool has_cardinality_estimation, const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &table_infos, const PlanState::DeletedColumnsMap &deleted_cols_map, const ColumnFetcher &column_fetcher, const CompilationOptions &co, const ExecutionOptions &eo, RenderInfo *render_info, Executor *executor)
 
auto getCompilationResult () const
 
std::string getIR () const
 
ExecutorDeviceType getDeviceType () const
 
bool hoistLiterals () const
 
int8_t getMinByteWidth () const
 

Private Attributes

CompilationResult compilation_result_
 
ExecutorDeviceType compilation_device_type_
 
bool hoist_literals_
 
int8_t actual_min_byte_width_
 

Detailed Description

Definition at line 40 of file QueryCompilationDescriptor.h.

Constructor & Destructor Documentation

QueryCompilationDescriptor::QueryCompilationDescriptor ( )
inline

Member Function Documentation

std::unique_ptr< QueryMemoryDescriptor > QueryCompilationDescriptor::compile ( const size_t  max_groups_buffer_entry_guess,
const int8_t  crt_min_byte_width,
const bool  has_cardinality_estimation,
const RelAlgExecutionUnit ra_exe_unit,
const std::vector< InputTableInfo > &  table_infos,
const PlanState::DeletedColumnsMap deleted_cols_map,
const ColumnFetcher column_fetcher,
const CompilationOptions co,
const ExecutionOptions eo,
RenderInfo render_info,
Executor executor 
)

Definition at line 21 of file QueryCompilationDescriptor.cpp.

References actual_min_byte_width_, CompilationOptions::allow_lazy_fetch, cat(), CHECK, ColumnFetcher::columnarized_table_cache_, compilation_device_type_, compilation_result_, CompilationOptions::device_type, g_enable_lazy_fetch, CompilationOptions::hoist_literals, hoist_literals_, MAX_BYTE_WIDTH_SUPPORTED, and query_mem_desc.

32  {
35  CHECK(executor);
36  std::unique_ptr<QueryMemoryDescriptor> query_mem_desc;
37  const auto cat = executor->getCatalog();
38  try {
39  std::tie(compilation_result_, query_mem_desc) = executor->compileWorkUnit(
40  table_infos,
41  deleted_cols_map,
42  ra_exe_unit,
43  co,
44  eo,
45  cat->getDataMgr().getCudaMgr(),
47  co.allow_lazy_fetch, // TODO(adb): remove param and just read from CO
48  executor->row_set_mem_owner_,
49  max_groups_buffer_entry_guess,
50  crt_min_byte_width,
51  has_cardinality_estimation,
52  column_fetcher.columnarized_table_cache_,
53  render_info);
54  } catch (const CompilationRetryNoLazyFetch&) {
55  if (executor->cgen_state_->module_) {
56  delete executor->cgen_state_->module_;
57  }
58  std::tie(compilation_result_, query_mem_desc) =
59  executor->compileWorkUnit(table_infos,
60  deleted_cols_map,
61  ra_exe_unit,
62  co,
63  eo,
64  cat->getDataMgr().getCudaMgr(),
65  false,
66  executor->row_set_mem_owner_,
67  max_groups_buffer_entry_guess,
68  crt_min_byte_width,
69  has_cardinality_estimation,
70  column_fetcher.columnarized_table_cache_,
71  render_info);
72  }
74  std::max(query_mem_desc->updateActualMinByteWidth(MAX_BYTE_WIDTH_SUPPORTED),
75  crt_min_byte_width);
76  return query_mem_desc;
77 }
std::string cat(Ts &&...args)
bool g_enable_lazy_fetch
Definition: Execute.cpp:113
ColumnCacheMap columnarized_table_cache_
ExecutorDeviceType device_type
#define CHECK(condition)
Definition: Logger.h:206
constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED

+ Here is the call graph for this function:

auto QueryCompilationDescriptor::getCompilationResult ( ) const
inline

Definition at line 60 of file QueryCompilationDescriptor.h.

References compilation_result_.

Referenced by ExecutionKernel::runImpl().

60 { return compilation_result_; }

+ Here is the caller graph for this function:

ExecutorDeviceType QueryCompilationDescriptor::getDeviceType ( ) const
inline

Definition at line 77 of file QueryCompilationDescriptor.h.

References compilation_device_type_.

Referenced by Executor::createKernels().

77 { return compilation_device_type_; }

+ Here is the caller graph for this function:

std::string QueryCompilationDescriptor::getIR ( ) const
inline

Definition at line 62 of file QueryCompilationDescriptor.h.

References compilation_device_type_, compilation_result_, CPU, GPU, CompilationResult::llvm_ir, and UNREACHABLE.

Referenced by Executor::executeExplain().

62  {
63  switch (compilation_device_type_) {
65  return std::string{"IR for the CPU:\n===============\n" +
67  }
69  return std::string{"IR for the GPU:\n===============\n" +
71  }
72  }
73  UNREACHABLE();
74  return "";
75  }
#define UNREACHABLE()
Definition: Logger.h:250

+ Here is the caller graph for this function:

int8_t QueryCompilationDescriptor::getMinByteWidth ( ) const
inline
bool QueryCompilationDescriptor::hoistLiterals ( ) const
inline

Definition at line 78 of file QueryCompilationDescriptor.h.

References hoist_literals_.

Referenced by ExecutionKernel::runImpl().

+ Here is the caller graph for this function:

Member Data Documentation

int8_t QueryCompilationDescriptor::actual_min_byte_width_
private

Definition at line 85 of file QueryCompilationDescriptor.h.

Referenced by compile(), and getMinByteWidth().

ExecutorDeviceType QueryCompilationDescriptor::compilation_device_type_
private

Definition at line 83 of file QueryCompilationDescriptor.h.

Referenced by compile(), getDeviceType(), and getIR().

CompilationResult QueryCompilationDescriptor::compilation_result_
private

Definition at line 82 of file QueryCompilationDescriptor.h.

Referenced by compile(), getCompilationResult(), and getIR().

bool QueryCompilationDescriptor::hoist_literals_
private

Definition at line 84 of file QueryCompilationDescriptor.h.

Referenced by compile(), and hoistLiterals().


The documentation for this class was generated from the following files: