| 213 | } |
| 214 | |
| 215 | void RecordBenchmarkEntry(const string& output_prefix, |
| 216 | const string& benchmark_name, const string& postfix, |
| 217 | int num_runs, double total_time_s, |
| 218 | double throughput = -1.0) { |
| 219 | std::stringstream stream; |
| 220 | stream << benchmark_name; |
| 221 | if (!postfix.empty()) { |
| 222 | stream << "_" << postfix; |
| 223 | } |
| 224 | |
| 225 | TestReporter node_reporter(output_prefix, stream.str()); |
| 226 | TF_QCHECK_OK(node_reporter.Initialize()); |
| 227 | TF_QCHECK_OK( |
| 228 | node_reporter.Benchmark(num_runs, -1.0, total_time_s, throughput)); |
| 229 | TF_QCHECK_OK(node_reporter.Close()); |
| 230 | } |
| 231 | |
| 232 | void SleepSeconds(double sleep_seconds) { |
| 233 | if (sleep_seconds <= 0.0) { |
no test coverage detected