Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 8fce4cb

Browse files
Use XXXOptionsAsCpp for operator<<
This changeset reuses code rather than reinvent the wheel, since the output format was not relied upon better to remove copy-pasta.
1 parent d1f7c2b commit 8fce4cb

File tree

2 files changed

+4
-38
lines changed

2 files changed

+4
-38
lines changed

src/core/cuda/cuda_mapping_options.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,8 @@ std::ostream& operator<<(
7171
std::ostream& os,
7272
const CudaMappingOptions& cudaOptions) {
7373
OstreamBoolalphaScope scope(os);
74-
os << "CudaMappingOptions(" << cudaOptions.generic << std::endl
75-
<< "block: " << cudaOptions.block << "," << std::endl
76-
<< "grid: " << cudaOptions.grid << "," << std::endl
77-
<< "use_shared_memory: " << cudaOptions.proto().use_shared_memory() << ","
78-
<< std::endl
79-
<< "use_private_memory: " << cudaOptions.proto().use_private_memory()
80-
<< "," << std::endl
81-
<< "unroll_copy_shared: " << cudaOptions.proto().unroll_copy_shared()
82-
<< "," << std::endl
83-
<< "max_shared_memory: "
84-
<< (cudaOptions.proto().has_max_shared_memory()
85-
? std::to_string(cudaOptions.proto().max_shared_memory())
86-
: "#none")
87-
<< ") @" << &cudaOptions.proto();
74+
tc::CudaMappingOptionsAsCpp cpp(cudaOptions);
75+
os << cpp;
8876
return os;
8977
}
9078

src/core/mapping_options.cc

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,8 @@ std::ostream& operator<<(
6262

6363
std::ostream& operator<<(std::ostream& os, const MappingOptions& options) {
6464
OstreamBoolalphaScope scope(os);
65-
os << "MappingOptions("
66-
<< "outer_schedule_options: " << options.view.outerScheduleOptions << ","
67-
<< std::endl;
68-
if (options.view.proto.has_intra_tile_schedule_options()) {
69-
os << "intra_tile_schedule_options: "
70-
<< options.view.intraTileScheduleOptions;
71-
} else {
72-
os << "#none";
73-
}
74-
os << ","
75-
<< "fix_parameters_before_scheduling: "
76-
<< options.view.proto.fix_parameters_before_scheduling() << ","
77-
<< std::endl
78-
<< "tiling: " << options.view.tiling << "," << std::endl
79-
<< "unroll: "
80-
<< (options.view.proto.has_unroll()
81-
? std::to_string(options.view.proto.unroll())
82-
: "#none")
83-
<< "," << std::endl
84-
<< "tile_imperfectly_nested: "
85-
<< options.view.proto.tile_imperfectly_nested() << "," << std::endl
86-
<< "," << std::endl
87-
<< "match_library_calls: " << options.view.proto.match_library_calls()
88-
<< ") @" << &options.view.proto;
65+
tc::MappingOptionsAsCpp cpp(options);
66+
os << cpp;
8967
return os;
9068
}
9169

0 commit comments

Comments
 (0)