aboutsummaryrefslogtreecommitdiff
path: root/include/armnn
diff options
context:
space:
mode:
Diffstat (limited to 'include/armnn')
-rw-r--r--include/armnn/Threadpool.hpp3
-rw-r--r--include/armnn/backends/Workload.hpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/include/armnn/Threadpool.hpp b/include/armnn/Threadpool.hpp
index e2458dbb65..672f8b8de6 100644
--- a/include/armnn/Threadpool.hpp
+++ b/include/armnn/Threadpool.hpp
@@ -2,6 +2,7 @@
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
+#if !defined(ARMNN_DISABLE_THREADS)
#pragma once
@@ -76,3 +77,5 @@ private:
} // namespace experimental
} // namespace armnn
+
+#endif
diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp
index d426486f89..6c9fcabd55 100644
--- a/include/armnn/backends/Workload.hpp
+++ b/include/armnn/backends/Workload.hpp
@@ -43,8 +43,9 @@ public:
void ExecuteAsync(WorkingMemDescriptor& workingMemDescriptor) override
{
ARMNN_LOG(info) << "Using default async workload execution, this will network affect performance";
+#if !defined(ARMNN_DISABLE_THREADS)
std::lock_guard<std::mutex> lockGuard(m_AsyncWorkloadMutex);
-
+#endif
m_Data.m_Inputs = workingMemDescriptor.m_Inputs;
m_Data.m_Outputs = workingMemDescriptor.m_Outputs;
@@ -81,7 +82,9 @@ protected:
const arm::pipe::ProfilingGuid m_Guid;
private:
+#if !defined(ARMNN_DISABLE_THREADS)
std::mutex m_AsyncWorkloadMutex;
+#endif
};
// TypedWorkload used