From ee493ae23b8cd6de5a6c578cea34bccb478d2f64 Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Wed, 5 Jul 2017 10:52:21 +0100 Subject: COMPMID-415: Port benchmark tests and remove google benchmark Change-Id: I2f17720a4e974b2cc4481f2884d9f351e8f78b5f Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79776 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- tests/TypePrinter.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'tests/TypePrinter.h') diff --git a/tests/TypePrinter.h b/tests/TypePrinter.h index c4f3495761..75499065eb 100644 --- a/tests/TypePrinter.h +++ b/tests/TypePrinter.h @@ -29,6 +29,8 @@ #include "arm_compute/core/Types.h" #include +#include +#include namespace arm_compute { @@ -53,6 +55,22 @@ inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions &dimen return os; } +//FIXME: Check why this doesn't work and the TensorShape overload is needed +template +inline std::string to_string(const Dimensions &dimensions) +{ + std::stringstream str; + str << dimensions; + return str.str(); +} + +inline std::string to_string(const TensorShape &shape) +{ + std::stringstream str; + str << shape; + return str.str(); +} + /** Formatted output of the Rectangle type. */ inline ::std::ostream &operator<<(::std::ostream &os, const Rectangle &rect) { @@ -231,6 +249,13 @@ inline ::std::ostream &operator<<(::std::ostream &os, const ActivationLayerInfo: return os; } +inline std::string to_string(const arm_compute::ActivationLayerInfo &info) +{ + std::stringstream str; + str << info.activation(); + return str.str(); +} + /** Formatted output of the NormType type. */ inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) { @@ -252,6 +277,13 @@ inline ::std::ostream &operator<<(::std::ostream &os, const NormType &norm_type) return os; } +inline std::string to_string(const arm_compute::NormalizationLayerInfo &info) +{ + std::stringstream str; + str << info.type(); + return str.str(); +} + /** Formatted output of the PoolingType type. */ inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_type) { @@ -270,6 +302,14 @@ inline ::std::ostream &operator<<(::std::ostream &os, const PoolingType &pool_ty return os; } +/** Formatted output of @ref PoolingLayerInfo. */ +inline ::std::ostream &operator<<(::std::ostream &os, const PoolingLayerInfo &info) +{ + os << info.pool_type(); + + return os; +} + /** Formatted output of the RoundingPolicy type. */ inline ::std::ostream &operator<<(::std::ostream &os, const RoundingPolicy &rounding_policy) { @@ -348,6 +388,13 @@ inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type) return os; } +inline std::string to_string(const arm_compute::DataType &data_type) +{ + std::stringstream str; + str << data_type; + return str.str(); +} + /** Formatted output of the Format type. */ inline ::std::ostream &operator<<(::std::ostream &os, const Format &format) { -- cgit v1.2.1