Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 2908054

Browse files
committed
Add ostream operators for compilation options
Signed-off-by: Petr Kurapov <[email protected]>
1 parent 0570a23 commit 2908054

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

omniscidb/QueryEngine/CompilationOptions.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,59 @@ std::ostream& operator<<(std::ostream& os, const ExecutionOptions& eo) {
3737
<< "preserve_order=" << eo.preserve_order << "\n";
3838
return os;
3939
}
40+
41+
std::ostream& operator<<(std::ostream& os, const ExecutorOptLevel& eol) {
42+
switch (eol) {
43+
case ExecutorOptLevel::Default:
44+
return os << "ExecutorOptLevel::Default";
45+
case ExecutorOptLevel::ReductionJIT:
46+
return os << "ExecutorOptLevel::ReductionJIT";
47+
default:
48+
return os << "ExecutorOptLevel::UNKNOWN";
49+
}
50+
}
51+
52+
std::ostream& operator<<(std::ostream& os, const ExecutorExplainType& eet) {
53+
switch (eet) {
54+
case ExecutorExplainType::Default:
55+
return os << "ExecutorExplainType::Default";
56+
case ExecutorExplainType::Optimized:
57+
return os << "ExecutorExplainType::Optimized";
58+
default:
59+
return os << "ExecutorExplainType::UNKNOWN";
60+
}
61+
}
62+
63+
std::ostream& operator<<(std::ostream& os, const compiler::CallingConvDesc& desc) {
64+
switch (desc) {
65+
case compiler::CallingConvDesc::C:
66+
return os << "CallingConvDesc::C";
67+
case compiler::CallingConvDesc::SPIR_FUNC:
68+
return os << "CallingConvDesc::SPIR_FUNC";
69+
default:
70+
return os << "CallingConvDesc::UNKNOWN";
71+
}
72+
}
73+
74+
std::ostream& operator<<(std::ostream& os,
75+
const compiler::CodegenTraitsDescriptor& desc) {
76+
os << "{local=" << desc.local_addr_space_ << ",global=" << desc.global_addr_space_
77+
<< ",shared=" << desc.smem_addr_space_ << ",conv=" << desc.conv_
78+
<< ",trpile=" << desc.triple_ << "}";
79+
return os;
80+
}
81+
82+
std::ostream& operator<<(std::ostream& os, const CompilationOptions& co) {
83+
os << "device_type=" << co.device_type << "\n"
84+
<< "hoist_literals=" << co.hoist_literals << "\n"
85+
<< "opt_level=" << co.opt_level << "\n"
86+
<< "with_dynamic_watchdog=" << co.with_dynamic_watchdog << "\n"
87+
<< "allow_lazy_fetch=" << co.allow_lazy_fetch << "\n"
88+
<< "filter_on_deleted_column=" << co.filter_on_deleted_column << "\n"
89+
<< "explain_type=" << co.explain_type << "\n"
90+
<< "register_intel_jit_listener=" << co.register_intel_jit_listener << "\n"
91+
<< "use_groupby_buffer_desc=" << co.use_groupby_buffer_desc << "\n"
92+
<< "codegen_traits_desc=" << co.codegen_traits_desc << "\n";
93+
return os;
94+
}
4095
#endif

omniscidb/QueryEngine/CompilationOptions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ struct ExecutionOptions {
172172

173173
#ifndef __CUDACC__
174174
std::ostream& operator<<(std::ostream& os, const ExecutionOptions& eo);
175+
std::ostream& operator<<(std::ostream& os, const ExecutorOptLevel& eol);
176+
std::ostream& operator<<(std::ostream& os, const compiler::CallingConvDesc& desc);
177+
std::ostream& operator<<(std::ostream& os, const compiler::CodegenTraitsDescriptor& desc);
178+
std::ostream& operator<<(std::ostream& os, const ExecutorExplainType& eet);
179+
std::ostream& operator<<(std::ostream& os, const CompilationOptions& co);
175180
#endif
176181

177182
#endif // QUERYENGINE_COMPILATIONOPTIONS_H

0 commit comments

Comments
 (0)