| 202 | } |
| 203 | |
| 204 | PerformanceReport::~PerformanceReport() { |
| 205 | |
| 206 | // |
| 207 | // Output results to stdout if they were not written to a file already. |
| 208 | // |
| 209 | if (options_.report.verbose && !concatenated_results_.empty()) { |
| 210 | |
| 211 | if (options_.report.sort_flops_per_byte) { |
| 212 | sort_flops_per_byte(concatenated_results_); |
| 213 | } |
| 214 | |
| 215 | if (options_.report.sort_flops_per_sec) { |
| 216 | sort_flops_per_sec(concatenated_results_); |
| 217 | } |
| 218 | |
| 219 | std::cout << "\n\n"; |
| 220 | std::cout << "=============================\n\n"; |
| 221 | std::cout << "CSV Results:\n\n"; |
| 222 | |
| 223 | print_csv_header_(std::cout) << std::endl; |
| 224 | |
| 225 | for (auto const &result : concatenated_results_) { |
| 226 | print_result_csv_(std::cout, result) << "\n"; |
| 227 | } |
| 228 | } |
| 229 | else if (output_file_.is_open() && options_.report.verbose) { |
| 230 | std::cout << "\nWrote results to '" << op_file_name_ << "'" << std::endl; |
| 231 | } |
| 232 | |
| 233 | if (output_file_.is_open()) { |
| 234 | output_file_.close(); |
| 235 | } |
| 236 | |
| 237 | if (junit_output_file_.is_open()) { |
| 238 | print_junit_footer_(junit_output_file_); |
| 239 | junit_output_file_.close(); |
| 240 | std::cout << "\nWrote jUnit results to '" << op_junit_file_name_ << "'" << std::endl; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | static const char *disposition_status_color(Disposition disposition) { |
| 245 | switch (disposition) { |