From 3ae3d88c1a305ef4fc0beed8fda3cfc39ddb2ae8 Mon Sep 17 00:00:00 2001 From: ramelg01 Date: Sun, 12 Sep 2021 23:07:47 +0100 Subject: Provide logging for configure functions in all cpu operators Partially Resolves: COMPMID-4718 Signed-off-by: Ramy Elgammal Change-Id: I02eabdd6bce8cd561ab2fdfd644a686a3762b817 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6253 Reviewed-by: Giorgio Arena Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- src/common/utils/Log.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/common/utils/Log.h') diff --git a/src/common/utils/Log.h b/src/common/utils/Log.h index 89e86bf2fc..a9d0d79876 100644 --- a/src/common/utils/Log.h +++ b/src/common/utils/Log.h @@ -134,15 +134,17 @@ logParamsImpl(std::vector &data_registry, const std::tuple & /** Function Template with variable number of inputs to collect all the passed parameters from * the logging macro ARM_COMPUTE_LOG_PARAMS(...) * - * @param[in] ...ins The input parameters in the variadic template + * @param[in] ...ins The input parameters in the variadic template, taken by reference, (not by value) to avoid + * detecting T as an abstract data type when passing any of these parameters as L-value reference + * to an abstract type. * - * @return vector of the parameters' data in a string format + * @return Vector of the parameters' data in a string format */ template -const std::vector logParams(Ts... ins) +const std::vector logParams(Ts &&... ins) { std::vector data_registry{}; - std::tuple in_params_tuple(ins...); + std::tuple in_params_tuple{ ins... }; // Start logging the tuple elements, starting from 0 to tuple_size-1 logParamsImpl<0>(data_registry, in_params_tuple); @@ -210,8 +212,10 @@ inline const std::string constructDataLog(const std::vector ¶ms * * @param[in] ... Input parameters */ -#define ARM_COMPUTE_LOG_PARAMS(...) \ - ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL(constructDataLog(getParamsNames(#__VA_ARGS__), \ - logParams(__VA_ARGS__))); - +#define ARM_COMPUTE_LOG_PARAMS(...) \ + do \ + { \ + ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL(constructDataLog(getParamsNames(#__VA_ARGS__), \ + logParams(__VA_ARGS__))); \ + } while(false) #endif /* SRC_COMMON_LOG_H */ -- cgit v1.2.1