From 555c3d6448a1dc7b326fad2ab7f75eccc8e5cff6 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Tue, 16 Oct 2018 16:00:50 +0100 Subject: COMPMID-1657 - Fix CPU info in the json file output Change-Id: I05a1b871746a32ccc1c3ecec97b8266767c9d0a7 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/153715 Reviewed-by: Pablo Tello Reviewed-by: Georgios Pinitas Tested-by: bsgcomp --- tests/main.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'tests/main.cpp') diff --git a/tests/main.cpp b/tests/main.cpp index 1e332cb457..617faaf5a9 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -84,18 +84,6 @@ bool file_exists(const std::string &filename) #endif /* ARM_COMPUTE_CL */ } //namespace -void print_cpu_info(std::ostream &os) -{ - const arm_compute::CPUInfo &cpu_info = Scheduler::get().cpu_info(); - const unsigned int num_cpus = cpu_info.get_cpu_num(); - os << "\ncpu_has_fp16 : " << cpu_info.has_fp16() << "\ncpu_has_dotprod : " << cpu_info.has_dotprod() << std::endl; - for(unsigned int j = 0; j < num_cpus; ++j) - { - const CPUModel model = cpu_info.get_cpu_model(j); - os << "CPU" << j << " : " << cpu_model_to_string(model) << std::endl; - } -} - int main(int argc, char **argv) { #ifdef ARM_COMPUTE_CL @@ -189,7 +177,6 @@ int main(int argc, char **argv) if(options.log_level->value() >= framework::LogLevel::CONFIG) { - std::stringstream ss; for(auto &p : printers) { p->print_entry("Version", build_information()); @@ -205,8 +192,16 @@ int main(int argc, char **argv) p->print_entry("CL_DEVICE_VERSION", "Unavailable"); } #endif /* ARM_COMPUTE_CL */ - print_cpu_info(ss); - p->print_entry("CPU_INFO", ss.str()); + const arm_compute::CPUInfo &cpu_info = Scheduler::get().cpu_info(); + const unsigned int num_cpus = cpu_info.get_cpu_num(); + p->print_entry("cpu_has_fp16", support::cpp11::to_string(cpu_info.has_fp16())); + p->print_entry("cpu_has_dotprod", support::cpp11::to_string(cpu_info.has_dotprod())); + + for(unsigned int j = 0; j < num_cpus; ++j) + { + const CPUModel model = cpu_info.get_cpu_model(j); + p->print_entry("CPU" + support::cpp11::to_string(j), cpu_model_to_string(model)); + } p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value())); p->print_entry("Threads", support::cpp11::to_string(threads->value())); { -- cgit v1.2.1