From 164a2727d3bbce0e575d24b7db787c85e2e2c203 Mon Sep 17 00:00:00 2001 From: giuros01 Date: Tue, 20 Nov 2018 18:34:46 +0000 Subject: COMPMID-1717: CL: Implement Maximum, Minimum, SquaredDifference Change-Id: Ice653e48211053bd3cd20a693bd76de6b4efc370 Reviewed-on: https://review.mlplatform.org/270 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins --- utils/TypePrinter.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 2b81192a44..27560e6b07 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -1322,6 +1322,55 @@ inline std::string to_string(const ConvertPolicy &policy) return str.str(); } +/** Formatted output of the ArithmeticOperation type. + * + * @param[out] os Output stream. + * @param[in] op Operation to output. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const ArithmeticOperation &op) +{ + switch(op) + { + case ArithmeticOperation::ADD: + os << "ADD"; + break; + case ArithmeticOperation::SUB: + os << "SUB"; + break; + case ArithmeticOperation::DIV: + os << "DIV"; + break; + case ArithmeticOperation::MAX: + os << "MAX"; + break; + case ArithmeticOperation::MIN: + os << "MIN"; + break; + case ArithmeticOperation::SQUARED_DIFF: + os << "SQUARED_DIFF"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + + return os; +} + +/** Formatted output of the Arithmetic Operation + * + * @param[in] op Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(const ArithmeticOperation &op) +{ + std::stringstream str; + str << op; + return str.str(); +} + /** Formatted output of the Reduction Operations. * * @param[out] os Output stream. -- cgit v1.2.1