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