OmniSciDB  a5dc49c757
 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
 
std::string toString () const
 

Private Attributes

CompilationResult compilation_result_
 
ExecutorDeviceType compilation_device_type_
 
bool hoist_literals_
 
int8_t actual_min_byte_width_
 

Detailed Description

Definition at line 53 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, 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, query_mem_desc, and VLOG.

32  {
35  CHECK(executor);
36  std::unique_ptr<QueryMemoryDescriptor> query_mem_desc;
37  const auto data_mgr = executor->getDataMgr();
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  data_mgr->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& e) {
55  VLOG(1) << e.what();
56  if (executor->cgen_state_->module_) {
57  delete executor->cgen_state_->module_;
58  }
59  std::tie(compilation_result_, query_mem_desc) =
60  executor->compileWorkUnit(table_infos,
61  deleted_cols_map,
62  ra_exe_unit,
63  co,
64  eo,
65  data_mgr->getCudaMgr(),
66  false,
67  executor->row_set_mem_owner_,
68  max_groups_buffer_entry_guess,
69  crt_min_byte_width,
70  has_cardinality_estimation,
71  column_fetcher.columnarized_table_cache_,
72  render_info);
73  }
75  std::max(query_mem_desc->updateActualMinByteWidth(MAX_BYTE_WIDTH_SUPPORTED),
76  crt_min_byte_width);
77  return query_mem_desc;
78 }
bool g_enable_lazy_fetch
Definition: Execute.cpp:136
ExecutorDeviceType device_type
#define CHECK(condition)
Definition: Logger.h:291
constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED
ColumnCacheMap & columnarized_table_cache_
#define VLOG(n)
Definition: Logger.h:388
auto QueryCompilationDescriptor::getCompilationResult ( ) const
inline

Definition at line 73 of file QueryCompilationDescriptor.h.

References compilation_result_.

Referenced by ExecutionKernel::runImpl().

73 { return compilation_result_; }

+ Here is the caller graph for this function:

ExecutorDeviceType QueryCompilationDescriptor::getDeviceType ( ) const
inline

Definition at line 90 of file QueryCompilationDescriptor.h.

References compilation_device_type_.

Referenced by Executor::createKernels().

90 { return compilation_device_type_; }

+ Here is the caller graph for this function:

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

Definition at line 75 of file QueryCompilationDescriptor.h.

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

Referenced by Executor::executeExplain().

75  {
76  switch (compilation_device_type_) {
78  return std::string{"IR for the CPU:\n===============\n" +
80  }
82  return std::string{"IR for the GPU:\n===============\n" +
84  }
85  }
86  UNREACHABLE();
87  return "";
88  }
#define UNREACHABLE()
Definition: Logger.h:338

+ Here is the caller graph for this function:

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

Definition at line 91 of file QueryCompilationDescriptor.h.

References hoist_literals_.

Referenced by ExecutionKernel::runImpl().

+ Here is the caller graph for this function:

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

Definition at line 94 of file QueryCompilationDescriptor.h.

References actual_min_byte_width_, compilation_device_type_, compilation_result_, hoist_literals_, run_benchmark_import::result, and typeName().

94  {
95  auto result = ::typeName(this) + "{";
100  result += "}";
101  return result;
102  };
std::string typeName(const T *v)
Definition: toString.h:106

+ Here is the call graph for this function:

Member Data Documentation

int8_t QueryCompilationDescriptor::actual_min_byte_width_
private

Definition at line 108 of file QueryCompilationDescriptor.h.

Referenced by compile(), getMinByteWidth(), and toString().

ExecutorDeviceType QueryCompilationDescriptor::compilation_device_type_
private

Definition at line 106 of file QueryCompilationDescriptor.h.

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

CompilationResult QueryCompilationDescriptor::compilation_result_
private

Definition at line 102 of file QueryCompilationDescriptor.h.

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

bool QueryCompilationDescriptor::hoist_literals_
private

Definition at line 107 of file QueryCompilationDescriptor.h.

Referenced by compile(), hoistLiterals(), and toString().


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