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_optimization_views.xhtml | 680 ++++++++++++++++++++++++++ 1 file changed, 680 insertions(+) create mode 100644 22.02/classarmnn_1_1_optimization_views.xhtml (limited to '22.02/classarmnn_1_1_optimization_views.xhtml') diff --git a/22.02/classarmnn_1_1_optimization_views.xhtml b/22.02/classarmnn_1_1_optimization_views.xhtml new file mode 100644 index 0000000000..79b881964b --- /dev/null +++ b/22.02/classarmnn_1_1_optimization_views.xhtml @@ -0,0 +1,680 @@ + + + + + + + + + + + + + +ArmNN: OptimizationViews Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  22.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 ()
 
INetworkPtrGetINetwork ()
 
+

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 MockBackend::OptimizeSubgraphView(), and TEST_SUITE().

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

◆ AddSubstitution()

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

Definition at line 34 of file OptimizationViews.hpp.

+ +

Referenced by armnn::FuseLayer(), MockBackend::OptimizeSubgraphView(), armnn::ReplaceLayers(), and TEST_SUITE().

+
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.

+
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 60 of file OptimizationViews.hpp.

+
60 { return m_Graph; }
+
+
+ +

◆ GetINetwork()

+ + + +

◆ GetSubstitutions() [1/2]

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

Definition at line 49 of file OptimizationViews.hpp.

+ +

Referenced by NeonBackend::OptimizeSubgraphView(), and ClBackend::OptimizeSubgraphView().

+
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 armnn::ARMNN_DEPRECATED_MSG_REMOVAL_DATE(), and 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::GetIConnectableLayers(), SubgraphView::GetIInputSlots(), and SubgraphView::GetIOutputSlots().

+ +

Referenced by OptimizationViews::GetUntouchedSubgraphs(), and TEST_SUITE().

+
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::IConnectableLayers originalLayers = originalSubgraph.GetIConnectableLayers();
21  originalLayers.sort();
22 
23  // Create a new list based on the sum of all the subgraphs and sort it
25  for (auto& failed : m_FailedOptimizations)
26  {
27  countedLayers.insert(countedLayers.end(),
28  failed.GetIConnectableLayers().begin(),
29  failed.GetIConnectableLayers().end());
30  }
31  for (auto& untouched : m_UntouchedSubgraphs)
32  {
33  countedLayers.insert(countedLayers.end(),
34  untouched.GetIConnectableLayers().begin(),
35  untouched.GetIConnectableLayers().end());
36  }
37  for (auto& successful : m_SuccesfulOptimizations)
38  {
39  countedLayers.insert(countedLayers.end(),
40  successful.m_SubstitutableSubgraph.GetIConnectableLayers().begin(),
41  successful.m_SubstitutableSubgraph.GetIConnectableLayers().end());
42  }
43  countedLayers.sort();
44 
45  // Compare the two lists to make sure they match
46  valid &= originalLayers.size() == countedLayers.size();
47 
48  auto oIt = originalLayers.begin();
49  auto cIt = countedLayers.begin();
50  for (size_t i=0; i < originalLayers.size() && valid; ++i, ++oIt, ++cIt)
51  {
52  valid &= (*oIt == *cIt);
53  }
54 
55  // Compare the substitution subgraphs to ensure they are compatible
56  if (valid)
57  {
58  for (auto& substitution : m_SuccesfulOptimizations)
59  {
60  bool validSubstitution = true;
61  const SubgraphView& replacement = substitution.m_ReplacementSubgraph;
62  const SubgraphView& old = substitution.m_SubstitutableSubgraph;
63  validSubstitution &= replacement.GetIInputSlots().size() == old.GetIInputSlots().size();
64  validSubstitution &= replacement.GetIOutputSlots().size() == old.GetIOutputSlots().size();
65  valid &= validSubstitution;
66  }
67  }
68  return valid;
69 }
std::list< IConnectableLayer * > IConnectableLayers
+
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1