aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/LoadedNetwork.cpp
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 /src/armnn/LoadedNetwork.cpp
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 'src/armnn/LoadedNetwork.cpp')
-rw-r--r--src/armnn/LoadedNetwork.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp
index 0e577354f0..f10fb89e15 100644
--- a/src/armnn/LoadedNetwork.cpp
+++ b/src/armnn/LoadedNetwork.cpp
@@ -1087,13 +1087,18 @@ void LoadedNetwork::EnqueueOutput(const BindableLayer& layer, ITensorHandle* ten
}
}
-void LoadedNetwork::AllocateWorkingMemory(std::lock_guard<std::mutex>& lock)
+void LoadedNetwork::AllocateWorkingMemory(
+#if !defined(ARMNN_DISABLE_THREADS)
+ std::lock_guard<std::mutex>& lock
+#endif
+ )
{
ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "Working Memory Allocation");
+#if !defined(ARMNN_DISABLE_THREADS)
// this unused parameter makes sure we can only call this function with a valid lock
IgnoreUnused(lock);
-
+#endif
if (m_IsWorkingMemAllocated)
{
return;
@@ -1122,7 +1127,9 @@ void LoadedNetwork::AllocateWorkingMemory(std::lock_guard<std::mutex>& lock)
void LoadedNetwork::FreeWorkingMemory()
{
+#if !defined(ARMNN_DISABLE_THREADS)
std::lock_guard<std::mutex> lockGuard(m_WorkingMemMutex);
+#endif
if (!m_IsWorkingMemAllocated)
{
@@ -1159,8 +1166,12 @@ bool LoadedNetwork::Execute(std::unique_ptr<TimelineUtilityMethods>& timelineUti
try
{
+#if !defined(ARMNN_DISABLE_THREADS)
std::lock_guard<std::mutex> lockGuard(m_WorkingMemMutex);
AllocateWorkingMemory(lockGuard);
+#else
+ AllocateWorkingMemory();
+#endif
ProfilingDynamicGuid workloadInferenceID(0);
auto ExecuteQueue = [&timelineUtils, &workloadInferenceID, &inferenceGuid](WorkloadQueue& queue)