aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/mlgo/Utils.cpp
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2021-02-05 09:19:51 +0000
committerSiCong Li <sicong.li@arm.com>2021-02-09 09:47:22 +0000
commit70858d8eb178532b0e728e6a7d09a77d27605020 (patch)
tree7eb80b2d8febd955908286b2279621ae86157520 /src/runtime/CL/mlgo/Utils.cpp
parent8e2133152285a80d2997ab21f6a3397f7c60a929 (diff)
downloadComputeLibrary-70858d8eb178532b0e728e6a7d09a77d27605020.tar.gz
Integrate MLGO into CLGEMM and CLGEMMLowpMatrixMultiplyCore: Part1
* Create a new public handle class CLGEMMHeuristicsHandle It is responsible for the loading and lifetime management of the underlying heuristics * Add to_string utility to several mlgo constructs for logging Resolves: COMPMID-3843, COMPMID-3844 Signed-off-by: SiCong Li <sicong.li@arm.com> Change-Id: Ib9c65e076daa6a9a204999cde9abf366dbabc496 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5001 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/mlgo/Utils.cpp')
-rw-r--r--src/runtime/CL/mlgo/Utils.cpp50
1 files changed, 47 insertions, 3 deletions
diff --git a/src/runtime/CL/mlgo/Utils.cpp b/src/runtime/CL/mlgo/Utils.cpp
index bd06bdf521..81d418c28e 100644
--- a/src/runtime/CL/mlgo/Utils.cpp
+++ b/src/runtime/CL/mlgo/Utils.cpp
@@ -23,10 +23,23 @@
*/
#include "src/runtime/CL/mlgo/Utils.h"
+#include <sstream>
+
namespace arm_compute
{
namespace mlgo
{
+namespace
+{
+template <typename T>
+inline std::string to_str(const T &val)
+{
+ std::stringstream ss;
+ ss << val;
+ return ss.str();
+}
+} // namespace
+
std::ostream &operator<<(std::ostream &os, const GEMMConfigNative &config)
{
return os << "Native:{"
@@ -61,7 +74,7 @@ std::ostream &operator<<(std::ostream &os, const GEMMConfigReshaped &config)
<< "export_cl_image: " << config.export_cl_image
<< "}";
}
-std::ostream &operator<<(std::ostream &os, const HeuristicType &ht)
+std::ostream &operator<<(std::ostream &os, HeuristicType ht)
{
switch(ht)
{
@@ -88,7 +101,7 @@ std::ostream &operator<<(std::ostream &os, const HeuristicType &ht)
}
return os;
}
-std::ostream &operator<<(std::ostream &os, const DataType &dt)
+std::ostream &operator<<(std::ostream &os, DataType dt)
{
switch(dt)
{
@@ -128,10 +141,41 @@ std::ostream &operator<<(std::ostream &os, const HeuristicTree::Index &index)
os << ")";
return os;
}
+std::ostream &operator<<(std::ostream &os, const Query &query)
+{
+ os << "Query(";
+ os << "IP=" << query.ip_target << ",";
+ os << "DataType=" << query.data_type << ",";
+ os << "M=" << query.m << ",";
+ os << "N=" << query.n << ",";
+ os << "K=" << query.k << ",";
+ os << "B=" << query.b << ")";
+ return os;
+}
+
+std::string to_string(const GEMMConfigNative &config)
+{
+ return to_str(config);
+}
+
+std::string to_string(const GEMMConfigReshapedOnlyRHS &config)
+{
+ return to_str(config);
+}
+
+std::string to_string(const GEMMConfigReshaped &config)
+{
+ return to_str(config);
+}
+
+std::string to_string(const Query &query)
+{
+ return to_str(query);
+}
namespace parser
{
-std::ostream &operator<<(std::ostream &os, CharPosition pos)
+std::ostream &operator<<(std::ostream &os, const CharPosition &pos)
{
os << "(Ln: " << pos.ln << ", Col: " << pos.col << ")";
return os;