From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/classarmnn_1_1_backend_registry.xhtml | 534 ++++++++++++++++++++++++++++ 1 file changed, 534 insertions(+) create mode 100644 21.02/classarmnn_1_1_backend_registry.xhtml (limited to '21.02/classarmnn_1_1_backend_registry.xhtml') diff --git a/21.02/classarmnn_1_1_backend_registry.xhtml b/21.02/classarmnn_1_1_backend_registry.xhtml new file mode 100644 index 0000000000..a45ee956f6 --- /dev/null +++ b/21.02/classarmnn_1_1_backend_registry.xhtml @@ -0,0 +1,534 @@ + + + + + + + + + + + + + +ArmNN: BackendRegistry Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ + +
+ +

#include <BackendRegistry.hpp>

+
+Inheritance diagram for BackendRegistry:
+
+
+ + +TestBackendRegistry + +
+ + + + +

+Classes

struct  StaticRegistryInitializer
 
+ + + + + +

+Public Types

using PointerType = IBackendInternalUniquePtr
 
using FactoryFunction = std::function< PointerType()>
 
+ + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

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
 
void SetProfilingService (armnn::Optional< profiling::ProfilingService &> profilingService)
 
 BackendRegistry ()
 
virtual ~BackendRegistry ()
 
void Deregister (const BackendId &id)
 
+ + + +

+Protected Types

using FactoryStorage = std::unordered_map< BackendId, FactoryFunction >
 
+ + + + +

+Static Protected Member Functions

static void Swap (BackendRegistry &instance, FactoryStorage &other)
 For testing only. More...
 
+

Detailed Description

+
+

Definition at line 25 of file BackendRegistry.hpp.

+

Member Typedef Documentation

+ +

◆ FactoryFunction

+ +
+
+ + + + +
using FactoryFunction = std::function<PointerType()>
+
+ +

Definition at line 29 of file BackendRegistry.hpp.

+ +
+
+ +

◆ FactoryStorage

+ +
+
+ + + + + +
+ + + + +
using FactoryStorage = std::unordered_map<BackendId, FactoryFunction>
+
+protected
+
+ +

Definition at line 55 of file BackendRegistry.hpp.

+ +
+
+ +

◆ PointerType

+ +
+
+ +

Definition at line 28 of file BackendRegistry.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ BackendRegistry()

+ +
+
+ + + + + +
+ + + + + + + +
BackendRegistry ()
+
+inline
+
+ +

Definition at line 39 of file BackendRegistry.hpp.

+
39 {}
+
+
+ +

◆ ~BackendRegistry()

+ +
+
+ + + + + +
+ + + + + + + +
virtual ~BackendRegistry ()
+
+inlinevirtual
+
+ +

Definition at line 40 of file BackendRegistry.hpp.

+
40 {}
+
+
+

Member Function Documentation

+ +

◆ Deregister()

+ +
+
+ + + + + + + + +
void Deregister (const BackendIdid)
+
+ +

Definition at line 39 of file BackendRegistry.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), DynamicBackendUtils::DeregisterDynamicBackends(), MockBackendInitialiser::~MockBackendInitialiser(), and MockImportBackendInitialiser::~MockImportBackendInitialiser().

+
40 {
41  m_Factories.erase(id);
42 
43  if (m_ProfilingService.has_value() && m_ProfilingService.value().IsProfilingEnabled())
44  {
45  m_ProfilingService.value().IncrementCounterValue(armnn::profiling::UNREGISTERED_BACKENDS);
46  }
47 }
+
+
+ +

◆ GetBackendIds()

+ +
+
+ + + + + + + +
BackendIdSet GetBackendIds () const
+
+ +

Definition at line 72 of file BackendRegistry.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), and BackendRegistry::GetBackendIdsAsString().

+
73 {
74  BackendIdSet result;
75  for (const auto& it : m_Factories)
76  {
77  result.insert(it.first);
78  }
79  return result;
80 }
std::unordered_set< BackendId > BackendIdSet
Definition: BackendId.hpp:191
+
+
+
+ +

◆ GetBackendIdsAsString()

+ +
+
+ + + + + + + +
std::string GetBackendIdsAsString () const
+
+ +

Definition at line 82 of file BackendRegistry.cpp.

+ +

References BackendRegistry::GetBackendIds().

+ +

Referenced by InferenceModel< IParser, TDataType >::AddCommandLineOptions(), main(), and ProgramOptions::ProgramOptions().

+
83 {
84  static const std::string delimitator = ", ";
85 
86  std::stringstream output;
87  for (auto& backendId : GetBackendIds())
88  {
89  if (output.tellp() != std::streampos(0))
90  {
91  output << delimitator;
92  }
93  output << backendId;
94  }
95 
96  return output.str();
97 }
BackendIdSet GetBackendIds() const
+
+
+
+ +

◆ GetFactory()

+ +
+
+ + + + + + + + +
BackendRegistry::FactoryFunction GetFactory (const BackendIdid) const
+
+ +

Definition at line 54 of file BackendRegistry.cpp.

+ +

References CHECK_LOCATION.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), armnn::GetILayerSupportByBackendId(), LoadedNetwork::MakeLoadedNetwork(), armnn::Optimize(), and RuntimeImpl::RuntimeImpl().

+
55 {
56  auto it = m_Factories.find(id);
57  if (it == m_Factories.end())
58  {
59  throw InvalidArgumentException(
60  std::string(id) + " has no IBackend factory registered",
61  CHECK_LOCATION());
62  }
63 
64  return it->second;
65 }
#define CHECK_LOCATION()
Definition: Exceptions.hpp:197
+
+
+
+ +

◆ IsBackendRegistered()

+ +
+
+ + + + + + + + +
bool IsBackendRegistered (const BackendIdid) const
+
+ +

Definition at line 49 of file BackendRegistry.cpp.

+ +

Referenced by armnn::GetILayerSupportByBackendId(), and DynamicBackendUtils::RegisterDynamicBackendsImpl().

+
50 {
51  return (m_Factories.find(id) != m_Factories.end());
52 }
+
+
+ +

◆ Register()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void Register (const BackendIdid,
BackendRegistry::FactoryFunction factory 
)
+
+ +

Definition at line 19 of file BackendRegistry.cpp.

+ +

References CHECK_LOCATION.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), MockBackendInitialiser::MockBackendInitialiser(), MockImportBackendInitialiser::MockImportBackendInitialiser(), DynamicBackendUtils::RegisterDynamicBackendsImpl(), and BackendRegistry::StaticRegistryInitializer::StaticRegistryInitializer().

+
20 {
21  if (m_Factories.find(id) != m_Factories.end())
22  {
23  throw InvalidArgumentException(
24  std::string(id) + " already registered as IBackend factory",
25  CHECK_LOCATION());
26  }
27  m_Factories[id] = factory;
28 
29  if (m_ProfilingService.has_value())
30  {
31  if (m_ProfilingService.has_value() && m_ProfilingService.value().IsProfilingEnabled())
32  {
33  m_ProfilingService.value().IncrementCounterValue(armnn::profiling::REGISTERED_BACKENDS);
34  }
35  }
36 
37 }
#define CHECK_LOCATION()
Definition: Exceptions.hpp:197
+
+
+
+ +

◆ SetProfilingService()

+ +
+
+ + + + + + + + +
void SetProfilingService (armnn::Optional< profiling::ProfilingService &> profilingService)
+
+ +

Definition at line 104 of file BackendRegistry.cpp.

+ +

Referenced by RuntimeImpl::RuntimeImpl(), and RuntimeImpl::~RuntimeImpl().

+
105 {
106  m_ProfilingService = profilingService;
107 }
+
+
+ +

◆ Size()

+ +
+
+ + + + + + + +
size_t Size () const
+
+ +

Definition at line 67 of file BackendRegistry.cpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), RuntimeEmptyTestImpl(), and RuntimeInvalidOverridePathTestImpl().

+
68 {
69  return m_Factories.size();
70 }
+
+
+ +

◆ Swap()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Swap (BackendRegistryinstance,
BackendRegistry::FactoryStorageother 
)
+
+staticprotected
+
+ +

For testing only.

+ +

Definition at line 99 of file BackendRegistry.cpp.

+ +

References armnn::swap().

+
100 {
101  std::swap(instance.m_Factories, other);
102 }
void swap(OriginsDescriptor &first, OriginsDescriptor &second)
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1