From 7900a9efa421f0ac8faf9bb939f5c536b42c62b0 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 23 Nov 2018 11:44:58 +0000 Subject: COMPMID-1716: CL Comparison operations Adds support for Equal,NotEqual,Less,LessEqual,Greater,GreaterEqual Change-Id: If0cdf4aae7f95c94709b195eee485f6663f45909 --- utils/TypePrinter.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 52bda2cfb3..91000cb702 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -1362,6 +1362,55 @@ inline std::string to_string(const ReductionOperation &op) return str.str(); } +/** Formatted output of the Comparison Operations. + * + * @param[out] os Output stream. + * @param[in] op Type to output. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const ComparisonOperation &op) +{ + switch(op) + { + case ComparisonOperation::Equal: + os << "Equal"; + break; + case ComparisonOperation::NotEqual: + os << "NotEqual"; + break; + case ComparisonOperation::Greater: + os << "Greater"; + break; + case ComparisonOperation::GreaterEqual: + os << "GreaterEqual"; + break; + case ComparisonOperation::Less: + os << "Less"; + break; + case ComparisonOperation::LessEqual: + os << "LessEqual"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + + return os; +} + +/** Formatted output of the Comparison Operations. + * + * @param[in] op Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(const ComparisonOperation &op) +{ + std::stringstream str; + str << op; + return str.str(); +} + /** Formatted output of the Norm Type. * * @param[in] type Type to output. -- cgit v1.2.1