OmniSciDB  94e8789169
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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, 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(),
46  co.allow_lazy_fetch, // TODO(adb): remove param and just read from CO
47  executor->row_set_mem_owner_,
48  max_groups_buffer_entry_guess,
49  crt_min_byte_width,
50  has_cardinality_estimation,
51  column_fetcher.columnarized_table_cache_,
52  render_info);
53  } catch (const CompilationRetryNoLazyFetch&) {
54  if (executor->cgen_state_->module_) {
55  delete executor->cgen_state_->module_;
56  }
57  std::tie(compilation_result_, query_mem_desc) =
58  executor->compileWorkUnit(table_infos,
59  deleted_cols_map,
60  ra_exe_unit,
61  co,
62  eo,
63  cat->getDataMgr().getCudaMgr(),
64  false,
65  executor->row_set_mem_owner_,
66  max_groups_buffer_entry_guess,
67  crt_min_byte_width,
68  has_cardinality_estimation,
69  column_fetcher.columnarized_table_cache_,
70  render_info);
71  }
73  std::max(query_mem_desc->updateActualMinByteWidth(MAX_BYTE_WIDTH_SUPPORTED),
74  crt_min_byte_width);
75  return query_mem_desc;
76 }
std::string cat(Ts &&...args)
ColumnCacheMap columnarized_table_cache_
ExecutorDeviceType device_type
#define CHECK(condition)
Definition: Logger.h:197
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:241

+ 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: