diff options
author | David Beck <david.beck@arm.com> | 2018-10-10 15:11:44 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-22 16:57:53 +0100 |
commit | 9df2d951616e3d76b67a9852d5324de96633f0f9 (patch) | |
tree | 37a57a98ef8aafba748d332bfc686e2b022398d6 /src/backends/BackendRegistry.hpp | |
parent | 6b779f0e437127bfa71a529e9b848b5e41683ab8 (diff) | |
download | armnn-9df2d951616e3d76b67a9852d5324de96633f0f9.tar.gz |
IVGCVSW-1952 : add BackendId class to prepare for the replacement of Compute enum
!armnn:152674
Change-Id: I1bcdfdfbfb73e502d58f35717e2558e24651013c
Diffstat (limited to 'src/backends/BackendRegistry.hpp')
-rw-r--r-- | src/backends/BackendRegistry.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backends/BackendRegistry.hpp b/src/backends/BackendRegistry.hpp index ff01d21715..e2c526d293 100644 --- a/src/backends/BackendRegistry.hpp +++ b/src/backends/BackendRegistry.hpp @@ -5,7 +5,6 @@ #pragma once #include <armnn/Types.hpp> -#include <string> #include <functional> #include <memory> #include <unordered_map> @@ -21,21 +20,23 @@ public: using FactoryFunction = std::function<IBackendUniquePtr()>; static BackendRegistry& Instance(); - void Register(const std::string& name, FactoryFunction factory); - FactoryFunction GetFactory(const std::string& name) const; + + void Register(const BackendId& id, FactoryFunction factory); + FactoryFunction GetFactory(const BackendId& id) const; struct Helper { - Helper(const std::string& name, FactoryFunction factory) + Helper(const BackendId& id, FactoryFunction factory) { - BackendRegistry::Instance().Register(name, factory); + BackendRegistry::Instance().Register(id, factory); } }; size_t Size() const { return m_BackendFactories.size(); } + BackendIdSet GetBackendIds() const; protected: - using FactoryStorage = std::unordered_map<std::string, FactoryFunction>; + using FactoryStorage = std::unordered_map<BackendId, FactoryFunction>; // For testing only static void Swap(FactoryStorage& other); |