parent
7c99e90ecd
commit
94e655329f
@ -281,10 +281,10 @@ struct WQSummary {
|
||||
// helper function to print the current content of sketch
|
||||
inline void Print() const {
|
||||
for (size_t i = 0; i < this->size; ++i) {
|
||||
LOG(INFO) << "[" << i << "] rmin=" << data[i].rmin
|
||||
<< ", rmax=" << data[i].rmax
|
||||
<< ", wmin=" << data[i].wmin
|
||||
<< ", v=" << data[i].value;
|
||||
LOG(CONSOLE) << "[" << i << "] rmin=" << data[i].rmin
|
||||
<< ", rmax=" << data[i].rmax
|
||||
<< ", wmin=" << data[i].wmin
|
||||
<< ", v=" << data[i].value;
|
||||
}
|
||||
}
|
||||
// try to fix rounding error
|
||||
@ -321,7 +321,7 @@ struct WQSummary {
|
||||
for (size_t i = 0; i < this->size; ++i) {
|
||||
if (data[i].rmin + data[i].wmin > data[i].rmax + tol ||
|
||||
data[i].rmin < -1e-6f || data[i].rmax < -1e-6f) {
|
||||
LOG(INFO) << "----------check not pass----------";
|
||||
LOG(INFO) << "---------- WQSummary::Check did not pass ----------";
|
||||
this->Print();
|
||||
return false;
|
||||
}
|
||||
@ -503,9 +503,8 @@ struct GKSummary {
|
||||
/*! \brief used for debug purpose, print the summary */
|
||||
inline void Print() const {
|
||||
for (size_t i = 0; i < size; ++i) {
|
||||
std::cout << "x=" << data[i].value << "\t"
|
||||
<< "[" << data[i].rmin << "," << data[i].rmax << "]"
|
||||
<< std::endl;
|
||||
LOG(CONSOLE) << "x=" << data[i].value << "\t"
|
||||
<< "[" << data[i].rmin << "," << data[i].rmax << "]";
|
||||
}
|
||||
}
|
||||
/*!
|
||||
|
||||
@ -27,7 +27,9 @@ struct Timer {
|
||||
void Stop() { elapsed += ClockT::now() - start; }
|
||||
double ElapsedSeconds() const { return SecondsT(elapsed).count(); }
|
||||
void PrintElapsed(std::string label) {
|
||||
printf("%s:\t %fs\n", label.c_str(), SecondsT(elapsed).count());
|
||||
char buffer[255];
|
||||
snprintf(buffer, sizeof(buffer), "%s:\t %fs", label.c_str(), SecondsT(elapsed).count());
|
||||
LOG(CONSOLE) << buffer;
|
||||
Reset();
|
||||
}
|
||||
};
|
||||
@ -50,9 +52,7 @@ struct Monitor {
|
||||
~Monitor() {
|
||||
if (!debug_verbose) return;
|
||||
|
||||
std::cout << "========\n";
|
||||
std::cout << "Monitor: " << label << "\n";
|
||||
std::cout << "========\n";
|
||||
LOG(CONSOLE) << "======== Monitor: " << label << " ========";
|
||||
for (auto &kv : timer_map) {
|
||||
kv.second.PrintElapsed(kv.first);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user