aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm_compute/core/CPP/CPPTypes.h45
-rw-r--r--tests/framework/Framework.cpp14
-rw-r--r--tests/framework/Framework.h6
3 files changed, 65 insertions, 0 deletions
diff --git a/arm_compute/core/CPP/CPPTypes.h b/arm_compute/core/CPP/CPPTypes.h
index 3ab1316369..9ffb4840a3 100644
--- a/arm_compute/core/CPP/CPPTypes.h
+++ b/arm_compute/core/CPP/CPPTypes.h
@@ -24,6 +24,9 @@
#ifndef __ARM_COMPUTE_CPP_TYPES_H__
#define __ARM_COMPUTE_CPP_TYPES_H__
+#include "arm_compute/core/Error.h"
+
+#include <string>
#include <vector>
namespace arm_compute
@@ -43,6 +46,48 @@ enum class CPUModel
A55r1
};
+/** Convert a cpumodel value to a string
+ *
+ * @param val CPUModel value to be converted
+ *
+ * @return String representing the corresponding CPUModel.
+ */
+inline std::string cpu_model_to_string(CPUModel val)
+{
+ switch(val)
+ {
+ case CPUModel::GENERIC:
+ {
+ return std::string("GENERIC");
+ }
+ case CPUModel::GENERIC_FP16:
+ {
+ return std::string("GENERIC_FP16");
+ }
+ case CPUModel::GENERIC_FP16_DOT:
+ {
+ return std::string("GENERIC_FP16_DOT");
+ }
+ case CPUModel::A53:
+ {
+ return std::string("A53");
+ }
+ case CPUModel::A55r0:
+ {
+ return std::string("A55r0");
+ }
+ case CPUModel::A55r1:
+ {
+ return std::string("A55r1");
+ }
+ default:
+ {
+ ARM_COMPUTE_ERROR("Invalid CPUModel.");
+ return std::string("GENERIC");
+ }
+ }
+}
+
class CPUInfo final
{
public:
diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp
index eea7745230..1d889f3728 100644
--- a/tests/framework/Framework.cpp
+++ b/tests/framework/Framework.cpp
@@ -23,6 +23,7 @@
*/
#include "Framework.h"
+#include "arm_compute/runtime/Scheduler.h"
#include "support/ToolchainSupport.h"
#ifdef ARM_COMPUTE_CL
#include "arm_compute/runtime/CL/CLScheduler.h"
@@ -41,6 +42,7 @@ namespace framework
{
Framework::Framework()
{
+ print_cpu_info(std::cout);
_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>);
@@ -140,6 +142,18 @@ bool Framework::has_test_info() const
return !_test_info.empty();
}
+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;
+ }
+}
+
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 65ffc0a818..4a26b66bcb 100644
--- a/tests/framework/Framework.h
+++ b/tests/framework/Framework.h
@@ -161,6 +161,12 @@ 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.