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 <matteo.martincigh@arm.com>
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index 6b91863..9e87484 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -144,8 +144,7 @@
{
// 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 @@
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