From 671a11e1c8e1e4db7bcae9ce97b0c97ebcb97464 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Fri, 6 Jul 2018 15:11:36 +0100 Subject: COMPMID-1379: Created WindowIterator and TensorAccessor - WindowIterator: used to iterate over arbitrary positions of a window. (More flexible than execute_window_loop which only can iterate over entire dimensions) - TensorAccessor: RSH's code uses pointers to specialised types and strides in element sizes, this helps interfacing with their code. Change-Id: I8ded8758d345668804873409f949b8cec694d289 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139082 Tested-by: Jenkins Reviewed-by: Georgios Pinitas --- utils/TypePrinter.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 49c07938bd..9bd8c2a667 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -60,7 +60,6 @@ std::string to_string_if_not_null(T *arg) return to_string(*arg); } } - /** Formatted output of the Dimensions type. * * @param[out] os Output stream. @@ -1627,6 +1626,48 @@ inline std::string to_string(const Termination &termination) return str.str(); } +/** Formatted output of a vector of objects. + * + * @param[out] os Output stream + * @param[in] args Vector of objects to print + * + * @return Modified output stream. + */ +template +inline ::std::ostream &operator<<(::std::ostream &os, const std::vector &args) +{ + os << "["; + bool first = true; + for(auto &arg : args) + { + if(first) + { + first = false; + } + else + { + os << ", "; + } + os << arg; + } + os << "]"; + return os; +} + +/** Formatted output of a vector of objects. + * + * @param[in] args Vector of objects to print + * + * @return String representing args. + */ +template +std::string to_string(const std::vector &args) +{ + std::stringstream str; + str << args; + return str.str(); +} + /** Formatted output of the WinogradInfo type. */ inline ::std::ostream &operator<<(::std::ostream &os, const WinogradInfo &info) { @@ -1644,5 +1685,18 @@ inline std::string to_string(const WinogradInfo &type) str << type; return str.str(); } + +/** Fallback method: try to use std::to_string: + * + * @param[in] val Value to convert to string + * + * @return String representing val. + */ +template +inline std::string to_string(const T &val) +{ + return support::cpp11::to_string(val); +} + } // namespace arm_compute #endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */ -- cgit v1.2.1