From 895339092fa9edc0aa59de0309f79bebacc3fa63 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Thu, 15 Aug 2019 12:08:06 +0100 Subject: IVGCVSW-3545 Update the device specs with the dynamic backend ids * Now the utility function RegisterDynamicBackends returns a list of the backend ids that have been registered * The list of registered ids is added to the list of supported backends in the Runtime * Added unit tests Change-Id: I97bbe1f680920358f5baba5a4666e4983b849cac Signed-off-by: Matteo Martincigh --- src/armnn/Runtime.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/armnn/Runtime.cpp') diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp index 6b91863deb..9e874848ec 100644 --- a/src/armnn/Runtime.cpp +++ b/src/armnn/Runtime.cpp @@ -144,8 +144,7 @@ Runtime::Runtime(const CreationOptions& options) { // Store backend contexts for the supported ones const BackendIdSet& supportedBackends = m_DeviceSpec.GetSupportedBackends(); - auto it = supportedBackends.find(id); - if (it != supportedBackends.end()) + if (supportedBackends.find(id) != supportedBackends.end()) { auto factoryFun = BackendRegistryInstance().GetFactory(id); auto backend = factoryFun(); @@ -257,7 +256,10 @@ void Runtime::LoadDynamicBackends(const std::string& overrideBackendPath) m_DynamicBackends = DynamicBackendUtils::CreateDynamicBackends(sharedObjects); // Register the dynamic backends in the backend registry - DynamicBackendUtils::RegisterDynamicBackends(m_DynamicBackends); + BackendIdSet registeredBackendIds = DynamicBackendUtils::RegisterDynamicBackends(m_DynamicBackends); + + // Add the registered dynamic backend ids to the list of supported backends + m_DeviceSpec.AddSupportedBackends(registeredBackendIds); } } // namespace armnn -- cgit v1.2.1