From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/classarmnn_1_1_optimization_views.xhtml | 651 ++++++++++++++++++++++++++ 1 file changed, 651 insertions(+) create mode 100644 20.02/classarmnn_1_1_optimization_views.xhtml (limited to '20.02/classarmnn_1_1_optimization_views.xhtml') diff --git a/20.02/classarmnn_1_1_optimization_views.xhtml b/20.02/classarmnn_1_1_optimization_views.xhtml new file mode 100644 index 0000000000..33c280b5ee --- /dev/null +++ b/20.02/classarmnn_1_1_optimization_views.xhtml @@ -0,0 +1,651 @@ + + + + + + + + + + + + + +ArmNN: OptimizationViews Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
OptimizationViews Class Reference
+
+
+ +

#include <OptimizationViews.hpp>

+ + + + +

+Classes

struct  SubstitutionPair
 
+ + + + + +

+Public Types

using Subgraphs = std::vector< SubgraphView >
 
using Substitutions = std::vector< SubstitutionPair >
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 OptimizationViews ()=default
 
 OptimizationViews (const OptimizationViews &)=delete
 
OptimizationViewsoperator= (const OptimizationViews &)=delete
 
 OptimizationViews (OptimizationViews &&)=default
 
OptimizationViewsoperator= (OptimizationViews &&)=default
 
void AddSubstitution (SubstitutionPair &&substitution)
 
void AddFailedSubgraph (SubgraphView &&subgraph)
 
void AddUntouchedSubgraph (SubgraphView &&subgraph)
 
const SubstitutionsGetSubstitutions () const
 
const SubgraphsGetFailedSubgraphs () const
 
const SubgraphsGetUntouchedSubgraphs () const
 
SubstitutionsGetSubstitutions ()
 
SubgraphsGetFailedSubgraphs ()
 
SubgraphsGetUntouchedSubgraphs ()
 
bool Validate (const SubgraphView &originalSubgraph) const
 
GraphGetGraph ()
 
+

Detailed Description

+
+

Definition at line 13 of file OptimizationViews.hpp.

+

Member Typedef Documentation

+ +

◆ Subgraphs

+ +
+
+ + + + +
using Subgraphs = std::vector<SubgraphView>
+
+ +

Definition at line 31 of file OptimizationViews.hpp.

+ +
+
+ +

◆ Substitutions

+ +
+
+ + + + +
using Substitutions = std::vector<SubstitutionPair>
+
+ +

Definition at line 32 of file OptimizationViews.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ OptimizationViews() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
OptimizationViews ()
+
+default
+
+ +
+
+ +

◆ OptimizationViews() [2/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OptimizationViews (const OptimizationViews)
+
+delete
+
+ +
+
+ +

◆ OptimizationViews() [3/3]

+ +
+
+ + + + + +
+ + + + + + + + +
OptimizationViews (OptimizationViews && )
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ AddFailedSubgraph()

+ +
+
+ + + + + +
+ + + + + + + + +
void AddFailedSubgraph (SubgraphView && subgraph)
+
+inline
+
+ +

Definition at line 39 of file OptimizationViews.hpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), and MockBackend::OptimizeSubgraphView().

+
40  {
41  m_FailedOptimizations.emplace_back(subgraph);
42  }
+
+
+ +

◆ AddSubstitution()

+ +
+
+ + + + + +
+ + + + + + + + +
void AddSubstitution (SubstitutionPair && substitution)
+
+inline
+
+ +

Definition at line 34 of file OptimizationViews.hpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), and MockBackend::OptimizeSubgraphView().

+
35  {
36  m_SuccesfulOptimizations.emplace_back(substitution);
37  }
+
+
+ +

◆ AddUntouchedSubgraph()

+ +
+
+ + + + + +
+ + + + + + + + +
void AddUntouchedSubgraph (SubgraphView && subgraph)
+
+inline
+
+
+ +

◆ GetFailedSubgraphs() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const Subgraphs& GetFailedSubgraphs () const
+
+inline
+
+ +

Definition at line 50 of file OptimizationViews.hpp.

+ +

Referenced by armnn::ApplyBackendOptimizations().

+
50 { return m_FailedOptimizations; }
+
+
+ +

◆ GetFailedSubgraphs() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Subgraphs& GetFailedSubgraphs ()
+
+inline
+
+ +

Definition at line 54 of file OptimizationViews.hpp.

+
54 { return m_FailedOptimizations; }
+
+
+ +

◆ GetGraph()

+ +
+
+ + + + + +
+ + + + + + + +
Graph& GetGraph ()
+
+inline
+
+ +

Definition at line 59 of file OptimizationViews.hpp.

+ +

Referenced by BOOST_AUTO_TEST_CASE(), and MockBackend::OptimizeSubgraphView().

+
59 { return m_Graph; }
+
+
+ +

◆ GetSubstitutions() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const Substitutions& GetSubstitutions () const
+
+inline
+
+ +

Definition at line 49 of file OptimizationViews.hpp.

+ +

Referenced by armnn::ApplyBackendOptimizations().

+
49 { return m_SuccesfulOptimizations; }
+
+
+ +

◆ GetSubstitutions() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Substitutions& GetSubstitutions ()
+
+inline
+
+ +

Definition at line 53 of file OptimizationViews.hpp.

+
53 { return m_SuccesfulOptimizations; }
+
+
+ +

◆ GetUntouchedSubgraphs() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
const Subgraphs& GetUntouchedSubgraphs () const
+
+inline
+
+ +

Definition at line 51 of file OptimizationViews.hpp.

+
51 { return m_UntouchedSubgraphs; }
+
+
+ +

◆ GetUntouchedSubgraphs() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Subgraphs& GetUntouchedSubgraphs ()
+
+inline
+
+ +

Definition at line 55 of file OptimizationViews.hpp.

+ +

References OptimizationViews::Validate().

+
55 { return m_UntouchedSubgraphs; }
+
+
+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
OptimizationViews& operator= (const OptimizationViews)
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
OptimizationViews& operator= (OptimizationViews && )
+
+default
+
+ +
+
+ +

◆ Validate()

+ +
+
+ + + + + + + + +
bool Validate (const SubgraphVieworiginalSubgraph) const
+
+ +

Definition at line 11 of file OptimizationViews.cpp.

+ +

References SubgraphView::GetInputSlots(), SubgraphView::GetLayers(), and SubgraphView::GetOutputSlots().

+ +

Referenced by armnn::ApplyBackendOptimizations(), BOOST_AUTO_TEST_CASE(), and OptimizationViews::GetUntouchedSubgraphs().

+
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 }
std::list< Layer * > Layers
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1