OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CompilationOptions.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, 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 
17 #ifndef QUERYENGINE_COMPILATIONOPTIONS_H
18 #define QUERYENGINE_COMPILATIONOPTIONS_H
19 
20 #include <vector>
21 #ifndef __CUDACC__
22 #include <ostream>
23 #endif
24 
25 enum class ExecutorDeviceType { CPU = 0, GPU };
26 #ifndef __CUDACC__
27 inline std::ostream& operator<<(std::ostream& os, ExecutorDeviceType const dt) {
28  constexpr char const* strings[]{"CPU", "GPU"};
29  return os << strings[static_cast<int>(dt)];
30 }
31 
32 inline std::string toString(const ExecutorDeviceType& device_type) {
33  return (device_type == ExecutorDeviceType::CPU) ? "CPU" : "GPU";
34 }
35 #endif
36 
38 
40 
42 
49  bool filter_on_deleted_column{true}; // if false, ignore the delete column during table
50  // scans. Primarily disabled for delete queries.
53 
56  in.hoist_literals,
57  in.opt_level,
61  in.explain_type,
63  }
64 
68  /*hoist_literals=*/true,
69  /*opt_level=*/ExecutorOptLevel::Default,
70  /*with_dynamic_watchdog=*/false,
71  /*allow_lazy_fetch=*/true,
72  /*filter_on_delted_column=*/true,
73  /*explain_type=*/ExecutorExplainType::Default,
74  /*register_intel_jit_listener=*/false};
75  }
76 };
77 
79 
84  bool just_explain; // return the generated IR for the first step
86  bool with_watchdog; // Per work unit, not global.
87  bool jit_debug;
89  bool with_dynamic_watchdog; // Per work unit, not global.
90  unsigned dynamic_watchdog_time_limit; // Dynamic watchdog time limit, in milliseconds.
93  double gpu_input_mem_limit_percent; // punt to CPU if input memory exceeds this
98  size_t max_join_hash_table_size = std::numeric_limits<size_t>::max();
100  std::vector<size_t> outer_fragment_indices{};
101 
103  return ExecutionOptions{/*output_columnar_hint=*/false,
104  /*keep_result=*/false,
105  /*allow_multifrag=*/true,
106  /*just_explain=*/false,
107  /*allow_loop_joins=*/false,
108  /*with_watchdog=*/true,
109  /*jit_debug=*/false,
110  /*just_validate=*/false,
111  /*with_dynamic_watchdog=*/false,
112  /*dynamic_watchdog_time_limit=*/0,
113  /*find_push_down_candidates=*/false,
114  /*just_calcite_explain=*/false,
115  /*=gpu_input_mem_limit_percent=*/1.0,
116  /*allow_runtime_query_interrupt=*/false,
117  /*running_query_interrupt_freq=*/0.5,
118  /*pending_query_interrupt_freq=*/1000,
119  /*optimize_cuda_block_and_grid_sizes*/ false};
120  }
121  void setNoExplainExecutionOptions(bool no_validation = false) {
122  just_explain = false;
123  just_calcite_explain = false;
124  if (no_validation) {
125  just_validate = false;
126  }
127  }
128 };
129 
130 #endif // QUERYENGINE_COMPILATIONOPTIONS_H
ExecutorDeviceType
std::vector< size_t > outer_fragment_indices
std::ostream & operator<<(std::ostream &os, const SessionInfo &session_info)
Definition: SessionInfo.cpp:57
ExecutorOptLevel opt_level
void setNoExplainExecutionOptions(bool no_validation=false)
double running_query_interrupt_freq
ExecutorOptLevel
ExecutorDispatchMode
ExecutorType
static CompilationOptions makeCpuOnly(const CompilationOptions &in)
ExecutorType executor_type
ExecutorExplainType explain_type
std::string toString(const ExecutorDeviceType &device_type)
unsigned pending_query_interrupt_freq
ExecutorDeviceType device_type
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
bool optimize_cuda_block_and_grid_sizes
double gpu_input_mem_limit_percent
unsigned dynamic_watchdog_time_limit
static ExecutionOptions defaults()
ExecutorExplainType