From 8914e32962be3dc8608499e3c0f2f13141493fc4 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 10 Aug 2018 15:28:25 +0100 Subject: COMPMID-1473: Added missing TypePrinter for CPUModel, added accessor for number of CPUs Change-Id: If81d58b83143129bed91b9c6658b0cd4e623bc38 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143664 Tested-by: Jenkins Reviewed-by: Michele DiGiorgio --- utils/TypePrinter.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index d9b971d993..5d57dda201 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -25,6 +25,7 @@ #define __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ #include "arm_compute/core/CL/CLTypes.h" +#include "arm_compute/core/CPP/CPPTypes.h" #include "arm_compute/core/Dimensions.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/GPUTarget.h" @@ -1667,6 +1668,54 @@ inline std::string to_string(const Termination &termination) return str.str(); } +/** Formatted output of the CPUModel type. + * + * @param[out] os Output stream + * @param[in] cpu_model Model to output + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const CPUModel &cpu_model) +{ + switch(cpu_model) + { + case CPUModel::GENERIC: + os << "GENERIC"; + break; + case CPUModel::GENERIC_FP16: + os << "GENERIC_FP16"; + break; + case CPUModel::GENERIC_FP16_DOT: + os << "GENERIC_FP16_DOT"; + break; + case CPUModel::A53: + os << "A53"; + break; + case CPUModel::A55r0: + os << "A55r0"; + break; + case CPUModel::A55r1: + os << "A55r1"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + + return os; +} + +/** Formatted output of the CPUModel type. + * + * @param[in] cpu_model Model to output + * + * @return Formatted string. + */ +inline std::string to_string(const CPUModel &cpu_model) +{ + std::stringstream str; + str << cpu_model; + return str.str(); +} /** Formatted output of a vector of objects. * * @param[out] os Output stream -- cgit v1.2.1