From a983e4699082a0b1ef685bab7354f2ad9cd37a44 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Wed, 20 May 2020 16:12:19 +0100 Subject: Updating Doxygen documentation for 20.05 release. Change-Id: I4d624343ed5fd6ae269c3d53532903084508fd14 Signed-off-by: Colm Donelan --- 20.05/_optimization_views_8cpp_source.xhtml | 121 ++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 20.05/_optimization_views_8cpp_source.xhtml (limited to '20.05/_optimization_views_8cpp_source.xhtml') diff --git a/20.05/_optimization_views_8cpp_source.xhtml b/20.05/_optimization_views_8cpp_source.xhtml new file mode 100644 index 0000000000..10b96ca3de --- /dev/null +++ b/20.05/_optimization_views_8cpp_source.xhtml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + +ArmNN: src/backends/backendsCommon/OptimizationViews.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
OptimizationViews.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 namespace armnn
9 {
10 
11 bool OptimizationViews::Validate(const armnn::SubgraphView& originalSubgraph) const
12 {
13  //This needs to verify that:
14  // 1) the sum of m_SuccesfulOptimizations & m_FailedOptimizations & m_UntouchedSubgraphs contains subgraphviews
15  // which cover the entire space of the originalSubgraph.
16  // 2) Each SubstitutionPair contains matching inputs and outputs
17  bool valid = true;
18 
19  // Create a copy of the layer list from the original subgraph and sort it
20  SubgraphView::Layers originalLayers = originalSubgraph.GetLayers();
21  originalLayers.sort();
22 
23  // Create a new list based on the sum of all the subgraphs and sort it
24  SubgraphView::Layers countedLayers;
25  for (auto& failed : m_FailedOptimizations)
26  {
27  countedLayers.insert(countedLayers.end(), failed.GetLayers().begin(), failed.GetLayers().end());
28  }
29  for (auto& untouched : m_UntouchedSubgraphs)
30  {
31  countedLayers.insert(countedLayers.end(), untouched.GetLayers().begin(), untouched.GetLayers().end());
32  }
33  for (auto& successful : m_SuccesfulOptimizations)
34  {
35  countedLayers.insert(countedLayers.end(),
36  successful.m_SubstitutableSubgraph.GetLayers().begin(),
37  successful.m_SubstitutableSubgraph.GetLayers().end());
38  }
39  countedLayers.sort();
40 
41  // Compare the two lists to make sure they match
42  valid &= originalLayers.size() == countedLayers.size();
43 
44  auto oIt = originalLayers.begin();
45  auto cIt = countedLayers.begin();
46  for (size_t i=0; i < originalLayers.size() && valid; ++i, ++oIt, ++cIt)
47  {
48  valid &= (*oIt == *cIt);
49  }
50 
51  // Compare the substitution subgraphs to ensure they are compatible
52  if (valid)
53  {
54  for (auto& substitution : m_SuccesfulOptimizations)
55  {
56  bool validSubstitution = true;
57  const SubgraphView& replacement = substitution.m_ReplacementSubgraph;
58  const SubgraphView& old = substitution.m_SubstitutableSubgraph;
59  validSubstitution &= replacement.GetInputSlots().size() == old.GetInputSlots().size();
60  validSubstitution &= replacement.GetOutputSlots().size() == old.GetOutputSlots().size();
61  valid &= validSubstitution;
62  }
63  }
64  return valid;
65 }
66 } //namespace armnn
Copyright (c) 2020 ARM Limited.
+
The SubgraphView class represents a subgraph of a Graph.
+
bool Validate(const SubgraphView &originalSubgraph) const
+ +
const InputSlots & GetInputSlots() const
+
const OutputSlots & GetOutputSlots() const
+
const Layers & GetLayers() const
+
std::list< Layer * > Layers
+
+
+ + + + -- cgit v1.2.1