diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-23 11:44:58 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-28 11:56:01 +0000 |
commit | 7900a9efa421f0ac8faf9bb939f5c536b42c62b0 (patch) | |
tree | 5f336a5be6463025ed5f88b3752aaf28d7fe46a4 /utils/TypePrinter.h | |
parent | 3175fcf63249673f33fd1638879adad4baab545b (diff) | |
download | ComputeLibrary-7900a9efa421f0ac8faf9bb939f5c536b42c62b0.tar.gz |
COMPMID-1716: CL Comparison operations
Adds support for Equal,NotEqual,Less,LessEqual,Greater,GreaterEqual
Change-Id: If0cdf4aae7f95c94709b195eee485f6663f45909
Diffstat (limited to 'utils/TypePrinter.h')
-rw-r--r-- | utils/TypePrinter.h | 49 |
1 files changed, 49 insertions, 0 deletions
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. |