aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-10-13 14:40:29 +0100
committerJim Flynn <jim.flynn@arm.com>2020-10-13 14:40:29 +0100
commitc456c31a5871a4ae1a8bbc687557ff304078aacc (patch)
treedfae516568e79c989723454c267fdfdd807cca9d /src
parentf290d88d34991c2478e5b22ef119f8537d923d77 (diff)
downloadarmnn-c456c31a5871a4ae1a8bbc687557ff304078aacc.tar.gz
IVGCVSW-5434 Remove boost/preprocessor.hpp
Change-Id: I51462d18ce0be4b88a23453cfdd16510f30dd1e3 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/armnn/Profiling.hpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp
index 08e55a14c5..c0d37dc13e 100644
--- a/src/armnn/Profiling.hpp
+++ b/src/armnn/Profiling.hpp
@@ -156,15 +156,21 @@ private:
} // namespace armnn
-
-#include <boost/preprocessor.hpp>
-
-#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(backendId, /*name,*/ ...) \
- armnn::ScopedProfilingEvent BOOST_PP_CAT(e_,__LINE__)(backendId, /*name,*/ __VA_ARGS__);
-
-// The event name must be known at compile time
+#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC_INNER(lineNumber, backendId, /*name,*/ ...) \
+ armnn::ScopedProfilingEvent e_ ## lineNumber(backendId, /*name,*/ __VA_ARGS__);
+
+#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(lineNumber, backendId, /*name,*/ ...) \
+ ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC_INNER(lineNumber, backendId, /*name,*/ __VA_ARGS__)
+
+// The event name must be known at compile time i.e. if you are going to use this version of the macro
+// in code the first argument you supply after the backendId must be the name.
+// NOTE: need to pass the line number as an argument from here so by the time it gets to the UNIQUE_LOC_INNER
+// above it has expanded to a string and will concat (##) correctly with the 'e_' prefix to yield a
+// legal and unique variable name (so long as you don't use the macro twice on the same line).
+// The concat preprocessing operator (##) very unhelpfully will not expand macros see
+// https://gcc.gnu.org/onlinedocs/cpp/Concatenation.html for the gory details.
#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, /*name,*/ ...) \
- ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(backendId, /*name,*/ __VA_ARGS__);
+ ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS_UNIQUE_LOC(__LINE__,backendId, /*name,*/ __VA_ARGS__)
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name) \
ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, name, armnn::WallClockTimer())