aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/Utils.h
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-11-09 10:29:59 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitab14c15dc9a0f55664fe523aed072fffa60da420 (patch)
treeb5a90018b71d10cd5a7ac2f19acdb34354208baa /tests/framework/Utils.h
parent33da05bc53a3de35c8b2fad04ab78d5b40d6aa77 (diff)
downloadComputeLibrary-ab14c15dc9a0f55664fe523aed072fffa60da420.tar.gz
COMPMID-663: Reworked / cleaned up instuments' measurements
Everything used to be stored as double which led to some numbers appearing in scientific notation and some counters values getting corrupted. Now measurements can be stored as either floating point or integer values. Added support for raw_data in order to output more detailed information to the JSON files (Will make use of that in the OpenCL timer instrument) Change-Id: Ie83776b347a764c8bf45b47d7d9d7bec02b04257 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95035 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/framework/Utils.h')
-rw-r--r--tests/framework/Utils.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/framework/Utils.h b/tests/framework/Utils.h
index a9fe0dcaa3..4f4b6fce56 100644
--- a/tests/framework/Utils.h
+++ b/tests/framework/Utils.h
@@ -152,6 +152,22 @@ inline std::string tolower(std::string string)
});
return string;
}
+
+/** Create a string with the arithmetic value in full precision.
+ *
+ * @param val Arithmetic value
+ *
+ * @return String with the arithmetic value.
+ */
+template <typename T, typename std::enable_if<std::is_arithmetic<T>::value, int>::type = 0>
+inline std::string arithmetic_to_string(T val)
+{
+ std::stringstream ss;
+ ss.precision(std::numeric_limits<T>::digits10 + 1);
+ ss << val;
+ return ss.str();
+}
+
} // namespace framework
} // namespace test
} // namespace arm_compute