aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/Runtime.cpp
diff options
context:
space:
mode:
authorRyan OShea <ryan.oshea3@arm.com>2023-03-20 11:10:40 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2023-05-08 16:59:40 +0000
commita3dc95ec2b0ac9e7f87dd32d03679a4b2a9b5d2a (patch)
treef65bf6ebae620be85cd1122e32889b9e8b69e1b8 /src/armnn/Runtime.cpp
parentf6ed6d410dca0bbf22f338ca6e2fafd36d5c963f (diff)
downloadarmnn-a3dc95ec2b0ac9e7f87dd32d03679a4b2a9b5d2a.tar.gz
Improve reusability of code that is defined out by cmake build paths
* Added new ARMNN_STUB_PROFILING and ARMNN_DISABLE_DYNAMIC_BACKEND defines to replace BUILD_BARE_METAL and BUILD_EXECUTE_NETWORK_STATIC * Add new CMake variables to disable sample apps and dynamic backends * Improve BUILD_SHARED_LIBS CMake variable * Add new archive output location to various libraries so that the static libraries appear in the same location as the shared libraries * Fixes for bare metal build * Add ARMNN_DISABLE_FILE_SYSTEM defines to missing locations Signed-off-by: Ryan OShea <ryan.oshea3@arm.com> Change-Id: I1db9a8f483e7134bd261294b35240cf21b150d45
Diffstat (limited to 'src/armnn/Runtime.cpp')
-rw-r--r--src/armnn/Runtime.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index ff64e856f4..f71fad1f35 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -20,7 +20,7 @@
#include <armnn/utility/PolymorphicDowncast.hpp>
#include <armnn/utility/Timer.hpp>
-#if !defined(ARMNN_BUILD_BARE_METAL) && !defined(ARMNN_EXECUTE_NETWORK_STATIC)
+#if !defined(ARMNN_DISABLE_DYNAMIC_BACKENDS)
#include <backendsCommon/DynamicBackendUtils.hpp>
#endif
@@ -337,7 +337,7 @@ RuntimeImpl::RuntimeImpl(const IRuntime::CreationOptions& options)
throw RuntimeException(
"It is not possible to enable timeline reporting without profiling being enabled");
}
-#if !defined(ARMNN_BUILD_BARE_METAL) && !defined(ARMNN_EXECUTE_NETWORK_STATIC)
+#if !defined(ARMNN_DISABLE_DYNAMIC_BACKENDS)
// Load any available/compatible dynamic backend before the runtime
// goes through the backend registry
LoadDynamicBackends(options.m_DynamicBackendsPath);
@@ -357,7 +357,7 @@ RuntimeImpl::RuntimeImpl(const IRuntime::CreationOptions& options)
if (customAllocatorMapIterator != options.m_CustomAllocatorMap.end() &&
customAllocatorMapIterator->second == nullptr)
{
-#if !defined(ARMNN_BUILD_BARE_METAL) && !defined(ARMNN_EXECUTE_NETWORK_STATIC)
+#if !defined(ARMNN_DISABLE_DYNAMIC_BACKENDS)
// We need to manually clean up the dynamic backends before throwing an exception.
DynamicBackendUtils::DeregisterDynamicBackends(m_DeviceSpec.GetDynamicBackends());
m_DeviceSpec.ClearDynamicBackends();
@@ -584,7 +584,7 @@ RuntimeImpl::~RuntimeImpl()
<< std::endl;
}
}
-#if !defined(ARMNN_BUILD_BARE_METAL) && !defined(ARMNN_EXECUTE_NETWORK_STATIC)
+#if !defined(ARMNN_DISABLE_DYNAMIC_BACKENDS)
// Clear all dynamic backends.
DynamicBackendUtils::DeregisterDynamicBackends(m_DeviceSpec.GetDynamicBackends());
m_DeviceSpec.ClearDynamicBackends();
@@ -769,7 +769,7 @@ void RuntimeImpl::RegisterDebugCallback(NetworkId networkId, const DebugCallback
loadedNetwork->RegisterDebugCallback(func);
}
-#if !defined(ARMNN_BUILD_BARE_METAL) && !defined(ARMNN_EXECUTE_NETWORK_STATIC)
+#if !defined(ARMNN_DISABLE_DYNAMIC_BACKENDS)
void RuntimeImpl::LoadDynamicBackends(const std::string& overrideBackendPath)
{
// Get the paths where to load the dynamic backends from