aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-07-06 15:11:36 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:10 +0000
commit671a11e1c8e1e4db7bcae9ce97b0c97ebcb97464 (patch)
tree6bdeaf330a81e3f4f35c34817fe594d6fbc81897 /utils
parent42a31723ebe79895c9bb2297a9c2ef22c01a6f26 (diff)
downloadComputeLibrary-671a11e1c8e1e4db7bcae9ce97b0c97ebcb97464.tar.gz
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 <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/TypePrinter.h56
1 files changed, 55 insertions, 1 deletions
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 <typename T>
+inline ::std::ostream &operator<<(::std::ostream &os, const std::vector<T> &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 <typename T>
+std::string to_string(const std::vector<T> &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 <typename T>
+inline std::string to_string(const T &val)
+{
+ return support::cpp11::to_string(val);
+}
+
} // namespace arm_compute
#endif /* __ARM_COMPUTE_TEST_TYPE_PRINTER_H__ */