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

Commit 3cca670

Browse files
nicolasvasilacheftynse
authored andcommitted
Reorder operator<< in cuda_mapping_options
Let the implementation match the order of the declarations in the .h
1 parent 5f811ef commit 3cca670

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

tc/core/cuda/cuda_mapping_options.cc

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,6 @@ std::string CudaDimView::toCommaSeparatedString() const {
4747
return ss.str();
4848
}
4949

50-
std::ostream& operator<<(std::ostream& os, const CudaDimView& view) {
51-
os << "CudaDim(" << view.toCommaSeparatedString() << ") @" << &view.proto;
52-
return os;
53-
}
54-
55-
std::ostream& operator<<(std::ostream& os, const CudaDim& dim) {
56-
os << dim.view;
57-
return os;
58-
}
59-
60-
std::ostream& operator<<(std::ostream& os, const Grid& dim) {
61-
os << dim.view;
62-
return os;
63-
}
64-
65-
std::ostream& operator<<(std::ostream& os, const Block& dim) {
66-
os << dim.view;
67-
return os;
68-
}
69-
70-
std::ostream& operator<<(
71-
std::ostream& os,
72-
const CudaMappingOptions& cudaOptions) {
73-
OstreamBoolalphaScope scope(os);
74-
tc::CudaMappingOptionsAsCpp cpp(cudaOptions);
75-
os << cpp;
76-
return os;
77-
}
78-
7950
// CudaDimView & CudaDim
8051
//
8152
CudaDim::CudaDim(std::vector<uint64_t> il) : ownedProto_(), view(ownedProto_) {
@@ -400,4 +371,32 @@ CudaMappingOptions CudaMappingOptions::makeGroupConvolutionMappingOptions() {
400371
.unroll(1);
401372
}
402373

374+
std::ostream& operator<<(std::ostream& os, const CudaDimView& view) {
375+
os << "CudaDim(" << view.toCommaSeparatedString() << ") @" << &view.proto;
376+
return os;
377+
}
378+
379+
std::ostream& operator<<(std::ostream& os, const CudaDim& dim) {
380+
os << dim.view;
381+
return os;
382+
}
383+
384+
std::ostream& operator<<(std::ostream& os, const Grid& dim) {
385+
os << dim.view;
386+
return os;
387+
}
388+
389+
std::ostream& operator<<(std::ostream& os, const Block& dim) {
390+
os << dim.view;
391+
return os;
392+
}
393+
394+
std::ostream& operator<<(
395+
std::ostream& os,
396+
const CudaMappingOptions& cudaOptions) {
397+
OstreamBoolalphaScope scope(os);
398+
tc::CudaMappingOptionsAsCpp cpp(cudaOptions);
399+
os << cpp;
400+
return os;
401+
}
403402
} // namespace tc

0 commit comments

Comments
 (0)