OmniSciDB  c07336695a
QueryCompilationDescriptor.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 OmniSci, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
24 #pragma once
25 
26 #include "../ColumnFetcher.h"
27 #include "../Execute.h"
28 
30  public:
33  , hoist_literals_(false)
35 
36  std::unique_ptr<QueryMemoryDescriptor> compile(
37  const size_t max_groups_buffer_entry_guess,
38  const int8_t crt_min_byte_width,
39  const bool has_cardinality_estimation,
40  const RelAlgExecutionUnit& ra_exe_unit,
41  const std::vector<InputTableInfo>& table_infos,
42  const ColumnFetcher& column_fetcher,
43  const CompilationOptions& co,
44  const ExecutionOptions& eo,
45  RenderInfo* render_info,
46  Executor* executor);
47 
48  auto getCompilationResult() const { return compilation_result_; }
49 
50  std::string getIR() const {
51  switch (compilation_device_type_) {
53  return std::string{"IR for the CPU:\n===============\n" +
55  }
57  return std::string{"IR for the GPU:\n===============\n" +
59  }
60  }
61  UNREACHABLE();
62  return "";
63  }
64 
66  bool hoistLiterals() const { return hoist_literals_; }
67  int8_t getMinByteWidth() const { return actual_min_byte_width_; }
68 
69  private:
74 };
ExecutorDeviceType
#define UNREACHABLE()
Definition: Logger.h:231
Executor::CompilationResult compilation_result_
ExecutorDeviceType getDeviceType() const
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)
constexpr int8_t MAX_BYTE_WIDTH_SUPPORTED