aboutsummaryrefslogtreecommitdiff
path: root/profiling/common/include
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2022-03-25 21:24:56 +0000
committerJim Flynn <jim.flynn@arm.com>2022-04-11 14:24:34 +0100
commit870b96c643388ae88dd4245b9169f526d6a8d49e (patch)
tree44a675f1eecdbf0eff40dc4ee623e0a2f03b2f96 /profiling/common/include
parentb99799bda8fe0fb0a755eebbe2d02dbb74507c9f (diff)
downloadarmnn-870b96c643388ae88dd4245b9169f526d6a8d49e.tar.gz
IVGCVSW-6707 Enables a bare metal compile
Change-Id: Icc2f83c5f27f413758fee3e5c1445e9fc44f42c8 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'profiling/common/include')
-rw-r--r--profiling/common/include/ProfilingGuidGenerator.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/profiling/common/include/ProfilingGuidGenerator.hpp b/profiling/common/include/ProfilingGuidGenerator.hpp
index bfee7642e9..22a488df93 100644
--- a/profiling/common/include/ProfilingGuidGenerator.hpp
+++ b/profiling/common/include/ProfilingGuidGenerator.hpp
@@ -26,7 +26,9 @@ public:
/// Return the next random Guid in the sequence
inline ProfilingDynamicGuid NextGuid() override
{
+#if !defined(ARMNN_DISABLE_THREADS)
std::lock_guard<std::mutex> sequencelock(m_SequenceMutex);
+#endif
ProfilingDynamicGuid guid(m_Sequence);
m_Sequence++;
if (m_Sequence >= MIN_STATIC_GUID)
@@ -47,14 +49,18 @@ public:
/// Reset the generator back to zero. Used mainly for test.
inline void Reset()
{
+#if !defined(ARMNN_DISABLE_THREADS)
std::lock_guard<std::mutex> sequencelock(m_SequenceMutex);
+#endif
m_Sequence = 0;
}
private:
std::hash<std::string> m_Hash;
uint64_t m_Sequence;
+#if !defined(ARMNN_DISABLE_THREADS)
std::mutex m_SequenceMutex;
+#endif
};
} // namespace pipe