Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame^] | 1 | <!-- Copyright (c) 2020 ARM Limited. --> |
| 2 | <!-- --> |
| 3 | <!-- SPDX-License-Identifier: MIT --> |
| 4 | <!-- --> |
| 5 | <!-- HTML header for doxygen 1.8.13--> |
| 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 8 | <head> |
| 9 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 10 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 11 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 12 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> |
| 13 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 14 | <title>ArmNN: SubgraphViewSelector Class Reference</title> |
| 15 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 16 | <script type="text/javascript" src="jquery.js"></script> |
| 17 | <script type="text/javascript" src="dynsections.js"></script> |
| 18 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 19 | <script type="text/javascript" src="resize.js"></script> |
| 20 | <script type="text/javascript" src="navtreedata.js"></script> |
| 21 | <script type="text/javascript" src="navtree.js"></script> |
| 22 | <script type="text/javascript"> |
| 23 | $(document).ready(initResizable); |
| 24 | </script> |
| 25 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 26 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 27 | <script type="text/javascript" src="search/search.js"></script> |
| 28 | <script type="text/x-mathjax-config"> |
| 29 | MathJax.Hub.Config({ |
| 30 | extensions: ["tex2jax.js"], |
| 31 | jax: ["input/TeX","output/HTML-CSS"], |
| 32 | }); |
| 33 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 34 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 35 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
| 36 | </head> |
| 37 | <body> |
| 38 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 39 | <div id="titlearea"> |
| 40 | <table cellspacing="0" cellpadding="0"> |
| 41 | <tbody> |
| 42 | <tr style="height: 56px;"> |
| 43 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/> |
| 44 | <td style="padding-left: 0.5em;"> |
| 45 | <div id="projectname"> |
| 46 |  <span id="projectnumber">20.02</span> |
| 47 | </div> |
| 48 | </td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </div> |
| 53 | <!-- end header part --> |
| 54 | <!-- Generated by Doxygen 1.8.13 --> |
| 55 | <script type="text/javascript"> |
| 56 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 57 | </script> |
| 58 | <script type="text/javascript" src="menudata.js"></script> |
| 59 | <script type="text/javascript" src="menu.js"></script> |
| 60 | <script type="text/javascript"> |
| 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
| 65 | </script> |
| 66 | <div id="main-nav"></div> |
| 67 | </div><!-- top --> |
| 68 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 69 | <div id="nav-tree"> |
| 70 | <div id="nav-tree-contents"> |
| 71 | <div id="nav-sync" class="sync"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div id="splitbar" style="-moz-user-select:none;" |
| 75 | class="ui-resizable-handle"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <script type="text/javascript"> |
| 79 | $(document).ready(function(){initNavTree('classarmnn_1_1_subgraph_view_selector.xhtml','');}); |
| 80 | </script> |
| 81 | <div id="doc-content"> |
| 82 | <!-- window showing the filter options --> |
| 83 | <div id="MSearchSelectWindow" |
| 84 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 85 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 86 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 87 | </div> |
| 88 | |
| 89 | <!-- iframe showing the search results (closed by default) --> |
| 90 | <div id="MSearchResultsWindow"> |
| 91 | <iframe src="javascript:void(0)" frameborder="0" |
| 92 | name="MSearchResults" id="MSearchResults"> |
| 93 | </iframe> |
| 94 | </div> |
| 95 | |
| 96 | <div class="header"> |
| 97 | <div class="summary"> |
| 98 | <a href="#pub-types">Public Types</a> | |
| 99 | <a href="#pub-static-methods">Static Public Member Functions</a> | |
| 100 | <a href="classarmnn_1_1_subgraph_view_selector-members.xhtml">List of all members</a> </div> |
| 101 | <div class="headertitle"> |
| 102 | <div class="title">SubgraphViewSelector Class Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div> |
| 103 | </div><!--header--> |
| 104 | <div class="contents"> |
| 105 | |
| 106 | <p>Algorithm that splits a <a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> into Subgraphs based on a filtering of layers (e.g. |
| 107 | <a href="classarmnn_1_1_subgraph_view_selector.xhtml#details">More...</a></p> |
| 108 | |
| 109 | <p><code>#include <<a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a>></code></p> |
| 110 | <table class="memberdecls"> |
| 111 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> |
| 112 | Public Types</h2></td></tr> |
| 113 | <tr class="memitem:a4684a457c7786484375f06e9ab2d2265"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a4684a457c7786484375f06e9ab2d2265">SubgraphViewPtr</a> = std::unique_ptr< <a class="el" href="classarmnn_1_1_subgraph_view.xhtml">SubgraphView</a> ></td></tr> |
| 114 | <tr class="separator:a4684a457c7786484375f06e9ab2d2265"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:aaf71a63dbbc776f8961b0f4fdb9da021"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">Subgraphs</a> = std::vector< <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a4684a457c7786484375f06e9ab2d2265">SubgraphViewPtr</a> ></td></tr> |
| 116 | <tr class="separator:aaf71a63dbbc776f8961b0f4fdb9da021"><td class="memSeparator" colspan="2"> </td></tr> |
| 117 | <tr class="memitem:a341a1b47a5f71edaebf81f3a5f0f4c55"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> = std::function< bool(const <a class="el" href="classarmnn_1_1_layer.xhtml">Layer</a> &)></td></tr> |
| 118 | <tr class="separator:a341a1b47a5f71edaebf81f3a5f0f4c55"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | </table><table class="memberdecls"> |
| 120 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> |
| 121 | Static Public Member Functions</h2></td></tr> |
| 122 | <tr class="memitem:a3730b0a6006f0d87f894a44e01869d90"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">Subgraphs</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a3730b0a6006f0d87f894a44e01869d90">SelectSubgraphs</a> (<a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> &graph, const <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> &selector)</td></tr> |
| 123 | <tr class="memdesc:a3730b0a6006f0d87f894a44e01869d90"><td class="mdescLeft"> </td><td class="mdescRight">Selects subgraphs from a graph based on the selector function and the algorithm. <a href="#a3730b0a6006f0d87f894a44e01869d90">More...</a><br /></td></tr> |
| 124 | <tr class="separator:a3730b0a6006f0d87f894a44e01869d90"><td class="memSeparator" colspan="2"> </td></tr> |
| 125 | <tr class="memitem:ad28bb1b624cde39578cfefa8b7809aef"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">Subgraphs</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#ad28bb1b624cde39578cfefa8b7809aef">SelectSubgraphs</a> (<a class="el" href="classarmnn_1_1_subgraph_view.xhtml">SubgraphView</a> &subgraph, const <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> &selector)</td></tr> |
| 126 | <tr class="separator:ad28bb1b624cde39578cfefa8b7809aef"><td class="memSeparator" colspan="2"> </td></tr> |
| 127 | </table> |
| 128 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 129 | <div class="textblock"><p>Algorithm that splits a <a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> into Subgraphs based on a filtering of layers (e.g. </p> |
| 130 | <p>which layers are appropriate for a certain backend). The resulting subgraphs are guaranteed to be form a DAG (i.e. there are no dependency loops).</p> |
| 131 | <p>The algorithm aims to produce as few subgraphs as possible. </p> |
| 132 | |
| 133 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml#l00021">21</a> of file <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a>.</p> |
| 134 | </div><h2 class="groupheader">Member Typedef Documentation</h2> |
| 135 | <a id="a341a1b47a5f71edaebf81f3a5f0f4c55"></a> |
| 136 | <h2 class="memtitle"><span class="permalink"><a href="#a341a1b47a5f71edaebf81f3a5f0f4c55">◆ </a></span>LayerSelectorFunction</h2> |
| 137 | |
| 138 | <div class="memitem"> |
| 139 | <div class="memproto"> |
| 140 | <table class="memname"> |
| 141 | <tr> |
| 142 | <td class="memname">using <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> = std::function<bool(const <a class="el" href="classarmnn_1_1_layer.xhtml">Layer</a>&)></td> |
| 143 | </tr> |
| 144 | </table> |
| 145 | </div><div class="memdoc"> |
| 146 | |
| 147 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml#l00026">26</a> of file <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a>.</p> |
| 148 | |
| 149 | </div> |
| 150 | </div> |
| 151 | <a id="aaf71a63dbbc776f8961b0f4fdb9da021"></a> |
| 152 | <h2 class="memtitle"><span class="permalink"><a href="#aaf71a63dbbc776f8961b0f4fdb9da021">◆ </a></span>Subgraphs</h2> |
| 153 | |
| 154 | <div class="memitem"> |
| 155 | <div class="memproto"> |
| 156 | <table class="memname"> |
| 157 | <tr> |
| 158 | <td class="memname">using <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">Subgraphs</a> = std::vector<<a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a4684a457c7786484375f06e9ab2d2265">SubgraphViewPtr</a>></td> |
| 159 | </tr> |
| 160 | </table> |
| 161 | </div><div class="memdoc"> |
| 162 | |
| 163 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml#l00025">25</a> of file <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a>.</p> |
| 164 | |
| 165 | </div> |
| 166 | </div> |
| 167 | <a id="a4684a457c7786484375f06e9ab2d2265"></a> |
| 168 | <h2 class="memtitle"><span class="permalink"><a href="#a4684a457c7786484375f06e9ab2d2265">◆ </a></span>SubgraphViewPtr</h2> |
| 169 | |
| 170 | <div class="memitem"> |
| 171 | <div class="memproto"> |
| 172 | <table class="memname"> |
| 173 | <tr> |
| 174 | <td class="memname">using <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a4684a457c7786484375f06e9ab2d2265">SubgraphViewPtr</a> = std::unique_ptr<<a class="el" href="classarmnn_1_1_subgraph_view.xhtml">SubgraphView</a>></td> |
| 175 | </tr> |
| 176 | </table> |
| 177 | </div><div class="memdoc"> |
| 178 | |
| 179 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml#l00024">24</a> of file <a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a>.</p> |
| 180 | |
| 181 | </div> |
| 182 | </div> |
| 183 | <h2 class="groupheader">Member Function Documentation</h2> |
| 184 | <a id="a3730b0a6006f0d87f894a44e01869d90"></a> |
| 185 | <h2 class="memtitle"><span class="permalink"><a href="#a3730b0a6006f0d87f894a44e01869d90">◆ </a></span>SelectSubgraphs() <span class="overload">[1/2]</span></h2> |
| 186 | |
| 187 | <div class="memitem"> |
| 188 | <div class="memproto"> |
| 189 | <table class="mlabels"> |
| 190 | <tr> |
| 191 | <td class="mlabels-left"> |
| 192 | <table class="memname"> |
| 193 | <tr> |
| 194 | <td class="memname"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">SubgraphViewSelector::Subgraphs</a> SelectSubgraphs </td> |
| 195 | <td>(</td> |
| 196 | <td class="paramtype"><a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> & </td> |
| 197 | <td class="paramname"><em>graph</em>, </td> |
| 198 | </tr> |
| 199 | <tr> |
| 200 | <td class="paramkey"></td> |
| 201 | <td></td> |
| 202 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> & </td> |
| 203 | <td class="paramname"><em>selector</em> </td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td></td> |
| 207 | <td>)</td> |
| 208 | <td></td><td></td> |
| 209 | </tr> |
| 210 | </table> |
| 211 | </td> |
| 212 | <td class="mlabels-right"> |
| 213 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 214 | </tr> |
| 215 | </table> |
| 216 | </div><div class="memdoc"> |
| 217 | |
| 218 | <p>Selects subgraphs from a graph based on the selector function and the algorithm. </p> |
| 219 | <p>Since the Subgraphs object returns modifiable pointers to the input and output slots of the graph: 1) the graph/sub-graph cannot be const 2) the caller needs to make sure that the Subgraphs lifetime is shorter than the parent graph's </p> |
| 220 | |
| 221 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml#l00254">254</a> of file <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml">SubgraphViewSelector.cpp</a>.</p> |
| 222 | |
| 223 | <p class="reference">Referenced by <a class="el" href="_network_8cpp_source.xhtml#l00428">armnn::ApplyBackendOptimizations()</a>, <a class="el" href="_subgraph_view_tests_8cpp_source.xhtml#l00443">BOOST_AUTO_TEST_CASE()</a>, and <a class="el" href="_mock_backend_8cpp_source.xhtml#l00134">MockBackend::OptimizeSubgraphView()</a>.</p> |
| 224 | <div class="fragment"><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> {</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  SubgraphView subgraph(graph);</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_subgraph_view_selector.xhtml#a3730b0a6006f0d87f894a44e01869d90">SubgraphViewSelector::SelectSubgraphs</a>(subgraph, selector);</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> }</div><div class="ttc" id="classarmnn_1_1_subgraph_view_selector_xhtml_a3730b0a6006f0d87f894a44e01869d90"><div class="ttname"><a href="classarmnn_1_1_subgraph_view_selector.xhtml#a3730b0a6006f0d87f894a44e01869d90">armnn::SubgraphViewSelector::SelectSubgraphs</a></div><div class="ttdeci">static Subgraphs SelectSubgraphs(Graph &graph, const LayerSelectorFunction &selector)</div><div class="ttdoc">Selects subgraphs from a graph based on the selector function and the algorithm. </div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_selector_8cpp_source.xhtml#l00254">SubgraphViewSelector.cpp:254</a></div></div> |
| 225 | </div><!-- fragment --> |
| 226 | </div> |
| 227 | </div> |
| 228 | <a id="ad28bb1b624cde39578cfefa8b7809aef"></a> |
| 229 | <h2 class="memtitle"><span class="permalink"><a href="#ad28bb1b624cde39578cfefa8b7809aef">◆ </a></span>SelectSubgraphs() <span class="overload">[2/2]</span></h2> |
| 230 | |
| 231 | <div class="memitem"> |
| 232 | <div class="memproto"> |
| 233 | <table class="mlabels"> |
| 234 | <tr> |
| 235 | <td class="mlabels-left"> |
| 236 | <table class="memname"> |
| 237 | <tr> |
| 238 | <td class="memname"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">SubgraphViewSelector::Subgraphs</a> SelectSubgraphs </td> |
| 239 | <td>(</td> |
| 240 | <td class="paramtype"><a class="el" href="classarmnn_1_1_subgraph_view.xhtml">SubgraphView</a> & </td> |
| 241 | <td class="paramname"><em>subgraph</em>, </td> |
| 242 | </tr> |
| 243 | <tr> |
| 244 | <td class="paramkey"></td> |
| 245 | <td></td> |
| 246 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml#a341a1b47a5f71edaebf81f3a5f0f4c55">LayerSelectorFunction</a> & </td> |
| 247 | <td class="paramname"><em>selector</em> </td> |
| 248 | </tr> |
| 249 | <tr> |
| 250 | <td></td> |
| 251 | <td>)</td> |
| 252 | <td></td><td></td> |
| 253 | </tr> |
| 254 | </table> |
| 255 | </td> |
| 256 | <td class="mlabels-right"> |
| 257 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 258 | </tr> |
| 259 | </table> |
| 260 | </div><div class="memdoc"> |
| 261 | |
| 262 | <p class="definition">Definition at line <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml#l00384">384</a> of file <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml">SubgraphViewSelector.cpp</a>.</p> |
| 263 | |
| 264 | <p class="reference">References <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml#l00304">armnn::AssignSplitId()</a>, <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml#l00283">armnn::ForEachLayerOutput()</a>, <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::info</a>, and <a class="el" href="_subgraph_view_selector_8cpp_source.xhtml#l00369">armnn::IsReadyForSplitAssignment()</a>.</p> |
| 265 | <div class="fragment"><div class="line"><a name="l00385"></a><span class="lineno"> 385</span> {</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  LayerSelectionInfo::LayerInfoContainer layerInfos;</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span> </div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  LayerSelectionInfo::LayerInfoQueue processQueue;</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>& layer : subgraph)</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  {</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="keyword">auto</span> emplaced = layerInfos.emplace(layer, LayerSelectionInfo{layer, selector});</div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  LayerSelectionInfo& layerInfo = emplaced.first->second;</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span> </div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="comment">// Start with Input type layers</span></div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <span class="keywordflow">if</span> (layerInfo.IsInputLayer())</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  {</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  processQueue.push(&layerInfo);</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  }</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  }</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span> </div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keyword">const</span> <a class="code" href="classarmnn_1_1_subgraph_view.xhtml#a5cc65e15002dbc33a5c8a7d6680e9a9d">SubgraphView::InputSlots</a>& subgraphInputSlots = subgraph.GetInputSlots();</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>& inputSlot : subgraphInputSlots)</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  {</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  Layer& layer = inputSlot->GetOwningLayer();</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keyword">auto</span> emplaced = layerInfos.emplace(&layer, LayerSelectionInfo{&layer, selector});</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  LayerSelectionInfo& layerInfo = emplaced.first->second;</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  processQueue.push(&layerInfo);</div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  }</div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span> </div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="keywordflow">while</span> (!processQueue.empty())</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  {</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  LayerSelectionInfo& layerInfo = *processQueue.front();</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  processQueue.pop(); <span class="comment">// remove front from queue</span></div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span> </div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="comment">// This layerInfo may have been added to the queue multiple times, so skip if we have already processed it</span></div><div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="keywordflow">if</span> (!layerInfo.m_IsProcessed)</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  {</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <span class="comment">// Only process this layerInfo if all inputs have been processed</span></div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <span class="keywordflow">if</span> (!<a class="code" href="namespacearmnn.xhtml#a6b10dc0d12c7f4a52ad01b9975dbe908">IsReadyForSplitAssignment</a>(layerInfos, layerInfo))</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  {</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="comment">// Put back of the process queue if we can't process it just yet</span></div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  processQueue.push(&layerInfo);</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="keywordflow">continue</span>; <span class="comment">// Skip to next iteration</span></div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  }</div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span> </div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <span class="comment">// Now we do the processing</span></div><div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <a class="code" href="namespacearmnn.xhtml#a09ff1f6670d27d3b41e5b5d35a6c9f37">AssignSplitId</a>(layerInfos, layerInfo);</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span> </div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="comment">// Queue any child nodes for processing</span></div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <a class="code" href="namespacearmnn.xhtml#a49538fa883b70c944e437d65d6628eec">ForEachLayerOutput</a>(layerInfos, layerInfo, [&processQueue](LayerSelectionInfo& childInfo)</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  {</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  processQueue.push(&childInfo);</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  });</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span> </div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <span class="comment">// We don't need to process this node again</span></div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  layerInfo.m_IsProcessed = <span class="keyword">true</span>;</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  }</div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  }</div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span> </div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="comment">// Collect all selected layers keyed by subgraph representative into a map</span></div><div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="keyword">using</span> SelectionInfoPtrs = std::vector<LayerSelectionInfo*>;</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  std::map<PartialSubgraph*, SelectionInfoPtrs> splitMap;</div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>& <a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a> : layerInfos)</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  {</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="keywordflow">if</span> (<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>.second.m_IsSelected)</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  {</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="keyword">auto</span> it = splitMap.find(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>.second.m_Subgraph->GetRepresentative());</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="keywordflow">if</span> (it == splitMap.end())</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  {</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  splitMap.insert(</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  std::make_pair(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>.second.m_Subgraph->GetRepresentative(), SelectionInfoPtrs{&<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>.second}));</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  }</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  {</div><div class="line"><a name="l00456"></a><span class="lineno"> 456</span>  it->second.push_back(&<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>.second);</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  }</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  }</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  }</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span> </div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  <span class="comment">// Now each entry in splitMap represents a subgraph</span></div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>  <a class="code" href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">Subgraphs</a> result;</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>& splitGraph : splitMap)</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  {</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  <a class="code" href="classarmnn_1_1_subgraph_view.xhtml#a5cc65e15002dbc33a5c8a7d6680e9a9d">SubgraphView::InputSlots</a> inputs;</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  <a class="code" href="classarmnn_1_1_subgraph_view.xhtml#a78293334750ec5279eb9c96d56deaf08">SubgraphView::OutputSlots</a> outputs;</div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>  <a class="code" href="classarmnn_1_1_subgraph_view.xhtml#a74798938fdaeae75c8adfa4a7439e7f9">SubgraphView::Layers</a> layers;</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& infoPtr : splitGraph.second)</div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  {</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  infoPtr->CollectNonSelectedInputs(layerInfos, inputs);</div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  infoPtr->CollectNonSelectedOutputSlots(layerInfos, outputs);</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  layers.push_back(infoPtr->m_Layer);</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  }</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  <span class="comment">// Create a new sub-graph with the new lists of input/output slots and layer</span></div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  result.emplace_back(std::make_unique<SubgraphView>(std::move(inputs),</div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>  std::move(outputs),</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  std::move(layers)));</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  }</div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span> </div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a09ff1f6670d27d3b41e5b5d35a6c9f37"><div class="ttname"><a href="namespacearmnn.xhtml#a09ff1f6670d27d3b41e5b5d35a6c9f37">armnn::AssignSplitId</a></div><div class="ttdeci">void AssignSplitId(LayerSelectionInfo::LayerInfoContainer &layerInfos, LayerSelectionInfo &layerInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_selector_8cpp_source.xhtml#l00304">SubgraphViewSelector.cpp:304</a></div></div> |
| 266 | <div class="ttc" id="classarmnn_1_1_subgraph_view_xhtml_a78293334750ec5279eb9c96d56deaf08"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.xhtml#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a></div><div class="ttdeci">std::vector< OutputSlot * > OutputSlots</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.xhtml#l00039">SubgraphView.hpp:39</a></div></div> |
| 267 | <div class="ttc" id="namespacearmnn_xhtml_a6b10dc0d12c7f4a52ad01b9975dbe908"><div class="ttname"><a href="namespacearmnn.xhtml#a6b10dc0d12c7f4a52ad01b9975dbe908">armnn::IsReadyForSplitAssignment</a></div><div class="ttdeci">bool IsReadyForSplitAssignment(LayerSelectionInfo::LayerInfoContainer &layerInfos, LayerSelectionInfo &layerInfo)</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_selector_8cpp_source.xhtml#l00369">SubgraphViewSelector.cpp:369</a></div></div> |
| 268 | <div class="ttc" id="classarmnn_1_1_subgraph_view_selector_xhtml_aaf71a63dbbc776f8961b0f4fdb9da021"><div class="ttname"><a href="classarmnn_1_1_subgraph_view_selector.xhtml#aaf71a63dbbc776f8961b0f4fdb9da021">armnn::SubgraphViewSelector::Subgraphs</a></div><div class="ttdeci">std::vector< SubgraphViewPtr > Subgraphs</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_selector_8hpp_source.xhtml#l00025">SubgraphViewSelector.hpp:25</a></div></div> |
| 269 | <div class="ttc" id="classarmnn_1_1_subgraph_view_xhtml_a5cc65e15002dbc33a5c8a7d6680e9a9d"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.xhtml#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a></div><div class="ttdeci">std::vector< InputSlot * > InputSlots</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.xhtml#l00038">SubgraphView.hpp:38</a></div></div> |
| 270 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::BoostLogSeverityMapping::info</a></div></div> |
| 271 | <div class="ttc" id="classarmnn_1_1_subgraph_view_xhtml_a74798938fdaeae75c8adfa4a7439e7f9"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.xhtml#a74798938fdaeae75c8adfa4a7439e7f9">armnn::SubgraphView::Layers</a></div><div class="ttdeci">std::list< Layer * > Layers</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.xhtml#l00040">SubgraphView.hpp:40</a></div></div> |
| 272 | <div class="ttc" id="namespacearmnn_xhtml_a49538fa883b70c944e437d65d6628eec"><div class="ttname"><a href="namespacearmnn.xhtml#a49538fa883b70c944e437d65d6628eec">armnn::ForEachLayerOutput</a></div><div class="ttdeci">void ForEachLayerOutput(LayerSelectionInfo::LayerInfoContainer &layerInfos, LayerSelectionInfo &layerInfo, Delegate function)</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_selector_8cpp_source.xhtml#l00283">SubgraphViewSelector.cpp:283</a></div></div> |
| 273 | </div><!-- fragment --> |
| 274 | </div> |
| 275 | </div> |
| 276 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 277 | <li>src/armnn/<a class="el" href="_subgraph_view_selector_8hpp_source.xhtml">SubgraphViewSelector.hpp</a></li> |
| 278 | <li>src/armnn/<a class="el" href="_subgraph_view_selector_8cpp_source.xhtml">SubgraphViewSelector.cpp</a></li> |
| 279 | </ul> |
| 280 | </div><!-- contents --> |
| 281 | </div><!-- doc-content --> |
| 282 | <!-- start footer part --> |
| 283 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 284 | <ul> |
| 285 | <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_subgraph_view_selector.xhtml">SubgraphViewSelector</a></li> |
| 286 | <li class="footer">Generated on Fri Mar 13 2020 16:09:20 for ArmNN by |
| 287 | <a href="http://www.doxygen.org/index.html"> |
| 288 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 289 | </ul> |
| 290 | </div> |
| 291 | </body> |
| 292 | </html> |