aboutsummaryrefslogtreecommitdiff
path: root/tests/TypePrinter.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TypePrinter.h')
-rw-r--r--tests/TypePrinter.h47
1 files changed, 47 insertions, 0 deletions
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 <ostream>
+#include <sstream>
+#include <string>
namespace arm_compute
{
@@ -53,6 +55,22 @@ inline ::std::ostream &operator<<(::std::ostream &os, const Dimensions<T> &dimen
return os;
}
+//FIXME: Check why this doesn't work and the TensorShape overload is needed
+template <typename T>
+inline std::string to_string(const Dimensions<T> &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)
{