aboutsummaryrefslogtreecommitdiff
path: root/src/common/utils/Log.h
diff options
context:
space:
mode:
authorMatthew Bentham <Matthew.Bentham@arm.com>2023-07-06 13:13:59 +0000
committerMatthew Bentham <matthew.bentham@arm.com>2023-07-10 13:09:30 +0000
commit1d0620447883240776f2510942742b5abb712b19 (patch)
treecae93de525085e1a245796dbd9e648306e0ab97a /src/common/utils/Log.h
parent97f83fac63bb8932a34542972f17f25d1a55976b (diff)
downloadComputeLibrary-1d0620447883240776f2510942742b5abb712b19.tar.gz
Do not include headers necessary for logging when logging is disabled
Speeds up compilation by 30% for some files when logging is disabled. Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com> Change-Id: Ia479bd50a80616a34e33ead13db8558f8dbaa1aa Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/534480 Tested-by: bsgcomp <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: bsgcomp <bsgcomp@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9880 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/common/utils/Log.h')
-rw-r--r--src/common/utils/Log.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/common/utils/Log.h b/src/common/utils/Log.h
index f3ae38a57c..bbfe1ce1b3 100644
--- a/src/common/utils/Log.h
+++ b/src/common/utils/Log.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Arm Limited.
+ * Copyright (c) 2021,2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,11 +24,22 @@
#ifndef SRC_COMMON_LOG_H
#define SRC_COMMON_LOG_H
+#ifndef ARM_COMPUTE_LOGGING_ENABLED
+
+#define ARM_COMPUTE_CREATE_ACL_LOGGER()
+#define ARM_COMPUTE_LOG_MSG_ACL(log_level, msg)
+#define ARM_COMPUTE_LOG_MSG_WITH_FORMAT_ACL(log_level, fmt, ...)
+#define ARM_COMPUTE_LOG_ERROR_ACL(msg)
+#define ARM_COMPUTE_LOG_ERROR_WITH_FUNCNAME_ACL(msg)
+#define ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL(msg)
+#define ARM_COMPUTE_LOG_PARAMS(...)
+
+#else /* ARM_COMPUTE_LOGGING_ENABLED */
+
#include "arm_compute/core/Error.h"
#include "arm_compute/core/utils/logging/Macros.h"
#include "utils/TypePrinter.h"
-#ifdef ARM_COMPUTE_LOGGING_ENABLED
/** Create a logger
*
* @note It will eventually create all default loggers in don't exist
@@ -41,9 +52,6 @@
arm_compute::logging::LoggerRegistry::get().create_logger("ComputeLibrary", arm_compute::logging::LogLevel::INFO); \
} \
} while(false)
-#else /* ARM_COMPUTE_LOGGING_ENABLED */
-#define ARM_COMPUTE_CREATE_ACL_LOGGER()
-#endif /* ARM_COMPUTE_LOGGING_ENABLED */
/** Log a message to the logger
*
@@ -218,4 +226,5 @@ inline const std::string constructDataLog(const std::vector<std::string> &params
ARM_COMPUTE_LOG_INFO_WITH_FUNCNAME_ACL(constructDataLog(getParamsNames(#__VA_ARGS__), \
logParams(__VA_ARGS__))); \
} while(false)
+#endif /* ARM_COMPUTE_LOGGING_ENABLED */
#endif /* SRC_COMMON_LOG_H */