From f4019872c1134c6fcc1d6993e5746f55c1e79208 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 8 Mar 2022 20:01:38 +0000 Subject: IVGCVSW-6819 Fix the directory structure and broken link to latest docu Signed-off-by: Nikhil Raj Change-Id: I05b559d15faf92c76ff536719693b361316be4f3 --- 22.02/classarmnn_1_1_optimizer.xhtml | 218 +++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 22.02/classarmnn_1_1_optimizer.xhtml (limited to '22.02/classarmnn_1_1_optimizer.xhtml') diff --git a/22.02/classarmnn_1_1_optimizer.xhtml b/22.02/classarmnn_1_1_optimizer.xhtml new file mode 100644 index 0000000000..7224fa988b --- /dev/null +++ b/22.02/classarmnn_1_1_optimizer.xhtml @@ -0,0 +1,218 @@ + + + + + + + + + + + + + +ArmNN: Optimizer Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  22.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
Optimizer Class Reference
+
+
+ +

#include <Optimizer.hpp>

+ + + + + + +

+Public Types

using OptimizationPtr = std::unique_ptr< Optimization >
 
using Optimizations = std::vector< OptimizationPtr >
 
+ + + +

+Static Public Member Functions

static void Pass (Graph &graph, const Optimizations &optimizations)
 
+

Detailed Description

+
+

Definition at line 14 of file Optimizer.hpp.

+

Member Typedef Documentation

+ +

◆ OptimizationPtr

+ +
+
+ + + + +
using OptimizationPtr = std::unique_ptr<Optimization>
+
+ +

Definition at line 17 of file Optimizer.hpp.

+ +
+
+ +

◆ Optimizations

+ +
+
+ + + + +
using Optimizations = std::vector<OptimizationPtr>
+
+ +

Definition at line 18 of file Optimizer.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ Pass()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
void Pass (Graphgraph,
const Optimizationsoptimizations 
)
+
+static
+
+ +

Definition at line 16 of file Optimizer.cpp.

+ +

References ARMNN_ASSERT, ARMNN_SCOPED_PROFILING_EVENT, Graph::begin(), GraphObservable< ObservedType >::Clear(), Graph::end(), Graph::EraseLayer(), Graph::GetPosInGraph(), Graph::TopologicalSort(), and armnn::Undefined.

+ +

Referenced by armnn::Optimize(), and TEST_SUITE().

+
17 {
19  // Create observables to observe changes to the graph
20  AddedLayerObservable addedLayerObservable(graph);
21  ErasedLayerNamesObservable erasedLayerNamesObservable(graph);
22 
23  bool graphNeedsSorting = false;
24  auto it = graph.TopologicalSort().end();
25 
26  // Calls TopologicalSort() for every iteration to re-order the list in case layers were added/removed.
27  while (it != graph.TopologicalSort().begin())
28  {
29  --it;
30  for (auto&& optimization : optimizations)
31  {
32  ARMNN_ASSERT(*it);
33  optimization->Run(graph, **it);
34 
35  if ((*it)->IsOutputUnconnected())
36  {
37  auto next = std::next(graph.GetPosInGraph(**it));
38  graph.EraseLayer(it);
39  it = next;
40  graphNeedsSorting = true;
41  }
42 
43  // Add the names of erased layers as related layers to the new added layers
44  for (auto& erasedLayerName : erasedLayerNamesObservable)
45  {
46  for (auto& addedLayer : addedLayerObservable)
47  {
48  addedLayer->AddRelatedLayerName(erasedLayerName);
49  }
50  }
51 
52  erasedLayerNamesObservable.Clear();
53  addedLayerObservable.Clear();
54 
55  if (graphNeedsSorting)
56  {
57  graphNeedsSorting = false;
58  break;
59  }
60  }
61  }
62 }
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
+ +
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1