OmniSciDB  06b3bd477c
 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 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 39 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 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.

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

+ Here is the call graph for this function:

auto QueryCompilationDescriptor::getCompilationResult ( ) const
inline

Definition at line 58 of file QueryCompilationDescriptor.h.

References compilation_result_.

Referenced by ExecutionKernel::runImpl().

58 { return compilation_result_; }

+ Here is the caller graph for this function:

ExecutorDeviceType QueryCompilationDescriptor::getDeviceType ( ) const
inline

Definition at line 75 of file QueryCompilationDescriptor.h.

References compilation_device_type_.

Referenced by Executor::createKernels().

75 { return compilation_device_type_; }

+ Here is the caller graph for this function:

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

Definition at line 60 of file QueryCompilationDescriptor.h.

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

Referenced by Executor::executeExplain().

60  {
61  switch (compilation_device_type_) {
63  return std::string{"IR for the CPU:\n===============\n" +
65  }
67  return std::string{"IR for the GPU:\n===============\n" +
69  }
70  }
71  UNREACHABLE();
72  return "";
73  }
#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 76 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 83 of file QueryCompilationDescriptor.h.

Referenced by compile(), and getMinByteWidth().

ExecutorDeviceType QueryCompilationDescriptor::compilation_device_type_
private

Definition at line 81 of file QueryCompilationDescriptor.h.

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

CompilationResult QueryCompilationDescriptor::compilation_result_
private

Definition at line 80 of file QueryCompilationDescriptor.h.

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

bool QueryCompilationDescriptor::hoist_literals_
private

Definition at line 82 of file QueryCompilationDescriptor.h.

Referenced by compile(), and hoistLiterals().


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