From 8efb48a6847c5cd166c561127ae6611150963ce3 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 19 May 2023 11:14:28 +0100 Subject: Update Doxygen docu for 23.05 Signed-off-by: Nikhil Raj Change-Id: I0a992286f14fa68fcc6e5eba31ac39fed003cbbe --- ...ry_optimizer_strategy_library_8hpp_source.xhtml | 181 +++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 23.05/_memory_optimizer_strategy_library_8hpp_source.xhtml (limited to '23.05/_memory_optimizer_strategy_library_8hpp_source.xhtml') diff --git a/23.05/_memory_optimizer_strategy_library_8hpp_source.xhtml b/23.05/_memory_optimizer_strategy_library_8hpp_source.xhtml new file mode 100644 index 0000000000..3d51650f33 --- /dev/null +++ b/23.05/_memory_optimizer_strategy_library_8hpp_source.xhtml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + +ArmNN: src/backends/backendsCommon/memoryOptimizerStrategyLibrary/MemoryOptimizerStrategyLibrary.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
MemoryOptimizerStrategyLibrary.hpp
+
+
+Go to the documentation of this file.
1 //
+
2 // Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+
3 // SPDX-License-Identifier: MIT
+
4 //
+
5 #pragma once
+
6 
+ + +
9 
+ + + +
13 
+
14 #include <map>
+
15 
+
16 namespace armnn
+
17 {
+
18 namespace
+
19 {
+
20 
+
21 static std::map<std::string, std::unique_ptr<IMemoryOptimizerStrategyFactory>>& GetStrategyFactories()
+
22 {
+
23  static std::map<std::string, std::unique_ptr<IMemoryOptimizerStrategyFactory>> strategies;
+
24 
+
25  if (strategies.size() == 0)
+
26  {
+
27  strategies["ConstantMemoryStrategy"] = std::make_unique<StrategyFactory<ConstantMemoryStrategy>>();
+
28  strategies["SingleAxisPriorityList"] = std::make_unique<StrategyFactory<SingleAxisPriorityList>>();
+
29  strategies["StrategyValidator"] = std::make_unique<StrategyFactory<StrategyValidator>>();
+
30  }
+
31  return strategies;
+
32 }
+
33 
+
34 } // anonymous namespace
+
35 
+
36 std::unique_ptr<IMemoryOptimizerStrategy> GetMemoryOptimizerStrategy(const std::string& strategyName)
+
37 {
+
38  const auto& strategyFactoryMap = GetStrategyFactories();
+
39  auto strategyFactory = strategyFactoryMap.find(strategyName);
+
40  if (strategyFactory != GetStrategyFactories().end())
+
41  {
+
42  return strategyFactory->second->CreateMemoryOptimizerStrategy();
+
43  }
+
44  return nullptr;
+
45 }
+
46 
+
47 const std::vector<std::string> GetMemoryOptimizerStrategyNames()
+
48 {
+
49  const auto& strategyFactoryMap = GetStrategyFactories();
+
50  std::vector<std::string> strategyNames;
+
51  for (const auto& strategyFactory : strategyFactoryMap)
+
52  {
+
53  strategyNames.emplace_back(strategyFactory.first);
+
54  }
+
55  return strategyNames;
+
56 }
+
57 } // namespace armnn
+
+
+
Copyright (c) 2021 ARM Limited and Contributors.
+
std::unique_ptr< IMemoryOptimizerStrategy > GetMemoryOptimizerStrategy(const std::string &strategyName)
+ + + + +
const std::vector< std::string > GetMemoryOptimizerStrategyNames()
+ + + + + -- cgit v1.2.1