diff options
author | Vidhya Sudhan Loganathan <vidhyasudhan.loganathan@arm.com> | 2018-10-10 11:46:55 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:55:45 +0000 |
commit | 709d27bcb451f4425e688024c629830e04b61cb0 (patch) | |
tree | 5804982612266c2f3f00b137ac3df62c0794996e /tests | |
parent | ecae3a14746fc7f678735b1a82347bd03f9a397f (diff) | |
download | ComputeLibrary-709d27bcb451f4425e688024c629830e04b61cb0.tar.gz |
COMPMID-1622 : (Nightly) Seg fault on android
call to print_cpu_info moved to main
Change-Id: I6d82649964542df4e944bc79e4c16f0813976295
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/152695
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/framework/Framework.cpp | 17 | ||||
-rw-r--r-- | tests/framework/Framework.h | 6 | ||||
-rw-r--r-- | tests/main.cpp | 15 |
3 files changed, 15 insertions, 23 deletions
diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp index 2452fd670a..20510ba6af 100644 --- a/tests/framework/Framework.cpp +++ b/tests/framework/Framework.cpp @@ -42,9 +42,6 @@ namespace framework { Framework::Framework() { -#if defined(__linux__) && !defined(__ANDROID__) - print_cpu_info(std::cout); -#endif /*#if defined(__linux__) && !defined(__ANDROID__)*/ _available_instruments.emplace(std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::NONE), Instrument::make_instrument<WallClockTimer, ScaleFactor::NONE>); _available_instruments.emplace(std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_MS), Instrument::make_instrument<WallClockTimer, ScaleFactor::TIME_MS>); _available_instruments.emplace(std::pair<InstrumentType, ScaleFactor>(InstrumentType::WALL_CLOCK_TIMER, ScaleFactor::TIME_S), Instrument::make_instrument<WallClockTimer, ScaleFactor::TIME_S>); @@ -144,20 +141,6 @@ bool Framework::has_test_info() const return !_test_info.empty(); } -#if defined(__linux__) && !defined(__ANDROID__) -void Framework::print_cpu_info(std::ostream &os) const -{ - const arm_compute::CPUInfo &cpu_info = Scheduler::get().cpu_info(); - const unsigned int num_cpus = cpu_info.get_cpu_num(); - os << "cpu_has_fp16 : " << cpu_info.has_fp16() << " cpu_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; - } -} -#endif /*#if defined(__linux__) && !defined(__ANDROID__)*/ - void Framework::print_test_info(std::ostream &os) const { if(!_test_info.empty()) diff --git a/tests/framework/Framework.h b/tests/framework/Framework.h index 4a26b66bcb..65ffc0a818 100644 --- a/tests/framework/Framework.h +++ b/tests/framework/Framework.h @@ -161,12 +161,6 @@ public: */ bool has_test_info() const; - /** Print CPU info - * - * @param[out] os Output stream. - */ - void print_cpu_info(std::ostream &os) const; - /** Print test info. * * @param[out] os Output stream. diff --git a/tests/main.cpp b/tests/main.cpp index 13f5aff14a..1e332cb457 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -84,6 +84,18 @@ 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 @@ -177,6 +189,7 @@ 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()); @@ -192,6 +205,8 @@ 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()); p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value())); p->print_entry("Threads", support::cpp11::to_string(threads->value())); { |