From c601aa626dac78e1482a258e493a6c186e6bf514 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Tue, 29 Oct 2019 15:03:22 +0000 Subject: GitHub #292 Move BackendRegistry.hpp to the public API * Moved to BackendRegistry.hpp include/armnn * Updated makefiles and sources accordingly Signed-off-by: Matteo Martincigh Change-Id: I4d83abb581d523218a880c879fcf30c9611f7fd7 --- src/backends/backendsCommon/BackendRegistry.hpp | 61 ------------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/backends/backendsCommon/BackendRegistry.hpp (limited to 'src/backends/backendsCommon/BackendRegistry.hpp') diff --git a/src/backends/backendsCommon/BackendRegistry.hpp b/src/backends/backendsCommon/BackendRegistry.hpp deleted file mode 100644 index 82e59d970b..0000000000 --- a/src/backends/backendsCommon/BackendRegistry.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// -#pragma once - -#include -#include - -#include -#include -#include - -namespace armnn -{ - -class IBackendInternal; -using IBackendInternalUniquePtr = std::unique_ptr; - -class BackendRegistry -{ -public: - using PointerType = IBackendInternalUniquePtr; - using FactoryFunction = std::function; - - void Register(const BackendId& id, FactoryFunction factory); - bool IsBackendRegistered(const BackendId& id) const; - FactoryFunction GetFactory(const BackendId& id) const; - size_t Size() const; - BackendIdSet GetBackendIds() const; - std::string GetBackendIdsAsString() const; - - BackendRegistry() {} - virtual ~BackendRegistry() {} - - struct StaticRegistryInitializer - { - StaticRegistryInitializer(BackendRegistry& instance, - const BackendId& id, - FactoryFunction factory) - { - instance.Register(id, factory); - } - }; - -protected: - using FactoryStorage = std::unordered_map; - - // For testing only - static void Swap(BackendRegistry& instance, FactoryStorage& other); - -private: - BackendRegistry(const BackendRegistry&) = delete; - BackendRegistry& operator=(const BackendRegistry&) = delete; - - FactoryStorage m_Factories; -}; - -BackendRegistry& BackendRegistryInstance(); - -} // namespace armnn -- cgit v1.2.1