From 2b147ee857eb237613670460c52efedd43601955 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 8 Jul 2021 18:14:45 +0100 Subject: Avoid multiple Rhs matrix transformation on ClGemm ClWinogradConv2d was performing Rhs transformation on every step impacting the performance. Adds scope logging support through ARM_COMPUTE_LOG_MSG_WITH_FUNCNAME Resolves: COMPMID-4596 Signed-off-by: Georgios Pinitas Change-Id: Ib329d3bc8d8aa21abae9fabfe61de35cc84d4819 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5925 Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- arm_compute/core/utils/logging/Macros.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/utils') diff --git a/arm_compute/core/utils/logging/Macros.h b/arm_compute/core/utils/logging/Macros.h index 1108dd3800..4900bf9e6b 100644 --- a/arm_compute/core/utils/logging/Macros.h +++ b/arm_compute/core/utils/logging/Macros.h @@ -30,6 +30,20 @@ #ifdef ARM_COMPUTE_LOGGING_ENABLED +#ifdef __GNUC__ +inline std::string signature_name(const std::string &pretty_func) +{ + const auto scope_op = pretty_func.find("::"); + const auto begin = pretty_func.substr(0, scope_op).rfind(" ") + 1; + const auto end = pretty_func.rfind("(") - begin; + + return pretty_func.substr(begin, end) + "()"; +} +#define ARM_COMPUTE_SIGNATURE_NAME signature_name(__PRETTY_FUNCTION__) +#else /* __GNUC__ */ +#define ARM_COMPUTE_SIGNATURE_NAME (__func__) +#endif /* __GNUC__ */ + #define ARM_COMPUTE_LOG_MSG(logger_name, log_level, msg) \ do \ { \ @@ -47,7 +61,7 @@ if(__logger != nullptr) \ { \ std::ostringstream s; \ - s << __func__ << ":" << msg; \ + s << ARM_COMPUTE_SIGNATURE_NAME << " : " << msg; \ __logger->log(log_level, s.str()); \ } \ } while(false) -- cgit v1.2.1