From 4a65b9855f71fff11a4c18d2fa4bccc74303e5c6 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Fri, 2 Mar 2018 11:21:38 +0000 Subject: COMPMID-991: Add data layout information to the test framework Change-Id: Iccf66f7476e697e8fdee5a7441cc06b936bbba09 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/122986 Reviewed-by: Michalis Spyrou Tested-by: Jenkins --- utils/TypePrinter.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 63fba35052..e5f860812d 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -338,6 +338,34 @@ inline std::string to_string(const RoundingPolicy &rounding_policy) return str.str(); } +/** Formatted output of the DataLayout type. */ +inline ::std::ostream &operator<<(::std::ostream &os, const DataLayout &data_layout) +{ + switch(data_layout) + { + case DataLayout::UNKNOWN: + os << "UNKNOWN"; + break; + case DataLayout::NHWC: + os << "NHWC"; + break; + case DataLayout::NCHW: + os << "NCHW"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + + return os; +} + +inline std::string to_string(const arm_compute::DataLayout &data_layout) +{ + std::stringstream str; + str << data_layout; + return str.str(); +} + /** Formatted output of the DataType type. */ inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) { -- cgit v1.2.1