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: Runtime 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_runtime.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-methods">Public Member Functions</a> | |
| 99 | <a href="#friends">Friends</a> | |
| 100 | <a href="classarmnn_1_1_runtime-members.xhtml">List of all members</a> </div> |
| 101 | <div class="headertitle"> |
| 102 | <div class="title">Runtime Class Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div> |
| 103 | </div><!--header--> |
| 104 | <div class="contents"> |
| 105 | |
| 106 | <p><code>#include <<a class="el" href="_runtime_8hpp_source.xhtml">Runtime.hpp</a>></code></p> |
| 107 | <div class="dynheader"> |
| 108 | Inheritance diagram for Runtime:</div> |
| 109 | <div class="dyncontent"> |
| 110 | <div class="center"> |
| 111 | <img src="classarmnn_1_1_runtime.png" usemap="#Runtime_map" alt=""/> |
| 112 | <map id="Runtime_map" name="Runtime_map"> |
| 113 | <area href="classarmnn_1_1_i_runtime.xhtml" alt="IRuntime" shape="rect" coords="0,0,59,24"/> |
| 114 | </map> |
| 115 | </div></div> |
| 116 | <table class="memberdecls"> |
| 117 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 118 | Public Member Functions</h2></td></tr> |
| 119 | <tr class="memitem:ae225e29e38b44860a32d766053a383dc"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc">LoadNetwork</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> &networkIdOut, <a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> network) override</td></tr> |
| 120 | <tr class="memdesc:ae225e29e38b44860a32d766053a383dc"><td class="mdescLeft"> </td><td class="mdescRight">Loads a complete network into the <a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a>. <a href="#ae225e29e38b44860a32d766053a383dc">More...</a><br /></td></tr> |
| 121 | <tr class="separator:ae225e29e38b44860a32d766053a383dc"><td class="memSeparator" colspan="2"> </td></tr> |
| 122 | <tr class="memitem:a115d6e9020c106d938a431e92141456e"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a115d6e9020c106d938a431e92141456e">LoadNetwork</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> &networkIdOut, <a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> network, std::string &errorMessage) override</td></tr> |
| 123 | <tr class="memdesc:a115d6e9020c106d938a431e92141456e"><td class="mdescLeft"> </td><td class="mdescRight">Load a complete network into the <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a>. <a href="#a115d6e9020c106d938a431e92141456e">More...</a><br /></td></tr> |
| 124 | <tr class="separator:a115d6e9020c106d938a431e92141456e"><td class="memSeparator" colspan="2"> </td></tr> |
| 125 | <tr class="memitem:aa1ca93de061aac0fb5b59082f1b8984e"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#aa1ca93de061aac0fb5b59082f1b8984e">LoadNetwork</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> &networkIdOut, <a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> network, std::string &errorMessage, const <a class="el" href="structarmnn_1_1_i_network_properties.xhtml">INetworkProperties</a> &networkProperties) override</td></tr> |
| 126 | <tr class="separator:aa1ca93de061aac0fb5b59082f1b8984e"><td class="memSeparator" colspan="2"> </td></tr> |
| 127 | <tr class="memitem:a7d0ddcd74d6f6438283e511480b64cc1"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a7d0ddcd74d6f6438283e511480b64cc1">GetInputTensorInfo</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId, <a class="el" href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">LayerBindingId</a> layerId) const override</td></tr> |
| 128 | <tr class="separator:a7d0ddcd74d6f6438283e511480b64cc1"><td class="memSeparator" colspan="2"> </td></tr> |
| 129 | <tr class="memitem:a1d5d285b79758564ee68f234e02dd2b2"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a1d5d285b79758564ee68f234e02dd2b2">GetOutputTensorInfo</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId, <a class="el" href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">LayerBindingId</a> layerId) const override</td></tr> |
| 130 | <tr class="separator:a1d5d285b79758564ee68f234e02dd2b2"><td class="memSeparator" colspan="2"> </td></tr> |
| 131 | <tr class="memitem:ad3be3cca4ac08a262383b96868f7123d"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#ad3be3cca4ac08a262383b96868f7123d">EnqueueWorkload</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId, const <a class="el" href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">InputTensors</a> &inputTensors, const <a class="el" href="namespacearmnn.xhtml#a8f091a512915d1cb29a4ebf13dfc53ea">OutputTensors</a> &outputTensors) override</td></tr> |
| 132 | <tr class="memdesc:ad3be3cca4ac08a262383b96868f7123d"><td class="mdescLeft"> </td><td class="mdescRight">Evaluates a network using input in inputTensors and outputs filled into outputTensors. <a href="#ad3be3cca4ac08a262383b96868f7123d">More...</a><br /></td></tr> |
| 133 | <tr class="separator:ad3be3cca4ac08a262383b96868f7123d"><td class="memSeparator" colspan="2"> </td></tr> |
| 134 | <tr class="memitem:ae54a3b358f009aec340d443d038805a4"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#ae54a3b358f009aec340d443d038805a4">UnloadNetwork</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId) override</td></tr> |
| 135 | <tr class="memdesc:ae54a3b358f009aec340d443d038805a4"><td class="mdescLeft"> </td><td class="mdescRight">Unloads a network from the <a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a>. <a href="#ae54a3b358f009aec340d443d038805a4">More...</a><br /></td></tr> |
| 136 | <tr class="separator:ae54a3b358f009aec340d443d038805a4"><td class="memSeparator" colspan="2"> </td></tr> |
| 137 | <tr class="memitem:a25505c77f282c0295765d81c86514539"><td class="memItemLeft" align="right" valign="top">virtual const <a class="el" href="classarmnn_1_1_i_device_spec.xhtml">IDeviceSpec</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a25505c77f282c0295765d81c86514539">GetDeviceSpec</a> () const override</td></tr> |
| 138 | <tr class="separator:a25505c77f282c0295765d81c86514539"><td class="memSeparator" colspan="2"> </td></tr> |
| 139 | <tr class="memitem:a4bcf6ecfacedc0567e1c044f1b0823f0"><td class="memItemLeft" align="right" valign="top">virtual const std::shared_ptr< <a class="el" href="classarmnn_1_1_i_profiler.xhtml">IProfiler</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a4bcf6ecfacedc0567e1c044f1b0823f0">GetProfiler</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId) const override</td></tr> |
| 140 | <tr class="memdesc:a4bcf6ecfacedc0567e1c044f1b0823f0"><td class="mdescLeft"> </td><td class="mdescRight">Gets the profiler corresponding to the given network id. <a href="#a4bcf6ecfacedc0567e1c044f1b0823f0">More...</a><br /></td></tr> |
| 141 | <tr class="separator:a4bcf6ecfacedc0567e1c044f1b0823f0"><td class="memSeparator" colspan="2"> </td></tr> |
| 142 | <tr class="memitem:abb2506e9166cd0467deaa9651fdade77"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#abb2506e9166cd0467deaa9651fdade77">RegisterDebugCallback</a> (<a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> networkId, const <a class="el" href="namespacearmnn.xhtml#a15f3ad9b5e4e3d46b0a6dda246a7bc28">DebugCallbackFunction</a> &func) override</td></tr> |
| 143 | <tr class="memdesc:abb2506e9166cd0467deaa9651fdade77"><td class="mdescLeft"> </td><td class="mdescRight">Registers a callback function to debug layers performing custom computations on intermediate tensors. <a href="#abb2506e9166cd0467deaa9651fdade77">More...</a><br /></td></tr> |
| 144 | <tr class="separator:abb2506e9166cd0467deaa9651fdade77"><td class="memSeparator" colspan="2"> </td></tr> |
| 145 | <tr class="memitem:a013ec7e08ae653e003956b4c9b5d0748"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a013ec7e08ae653e003956b4c9b5d0748">Runtime</a> (const <a class="el" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">CreationOptions</a> &<a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>)</td></tr> |
| 146 | <tr class="memdesc:a013ec7e08ae653e003956b4c9b5d0748"><td class="mdescLeft"> </td><td class="mdescRight">Creates a runtime for workload execution. <a href="#a013ec7e08ae653e003956b4c9b5d0748">More...</a><br /></td></tr> |
| 147 | <tr class="separator:a013ec7e08ae653e003956b4c9b5d0748"><td class="memSeparator" colspan="2"> </td></tr> |
| 148 | <tr class="memitem:acedafca2d2711908fe94f2ef71286437"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#acedafca2d2711908fe94f2ef71286437">~Runtime</a> ()</td></tr> |
| 149 | <tr class="separator:acedafca2d2711908fe94f2ef71286437"><td class="memSeparator" colspan="2"> </td></tr> |
| 150 | </table><table class="memberdecls"> |
| 151 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a> |
| 152 | Friends</h2></td></tr> |
| 153 | <tr class="memitem:a01fa2d4db2c1b4ee5269a31e514f37ec"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_runtime.xhtml#a01fa2d4db2c1b4ee5269a31e514f37ec">RuntimeLoadedNetworksReserve</a> (<a class="el" href="classarmnn_1_1_runtime.xhtml">armnn::Runtime</a> *runtime)</td></tr> |
| 154 | <tr class="separator:a01fa2d4db2c1b4ee5269a31e514f37ec"><td class="memSeparator" colspan="2"> </td></tr> |
| 155 | </table><table class="memberdecls"> |
| 156 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a> |
| 157 | Additional Inherited Members</h2></td></tr> |
| 158 | <tr class="inherit_header pub_static_methods_classarmnn_1_1_i_runtime"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classarmnn_1_1_i_runtime')"><img src="closed.png" alt="-"/> Static Public Member Functions inherited from <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a></td></tr> |
| 159 | <tr class="memitem:a4646ef5dbce8d3aae30fc99638226069 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_runtime.xhtml#a4646ef5dbce8d3aae30fc99638226069">CreateRaw</a> (const <a class="el" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">CreationOptions</a> &<a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>)</td></tr> |
| 160 | <tr class="separator:a4646ef5dbce8d3aae30fc99638226069 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memSeparator" colspan="2"> </td></tr> |
| 161 | <tr class="memitem:ad44ecd3700748dc30dc4bbe34ba5bde7 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacearmnn.xhtml#a150468a02bd7b2d2d061c4aaaee939f0">IRuntimePtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_runtime.xhtml#ad44ecd3700748dc30dc4bbe34ba5bde7">Create</a> (const <a class="el" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">CreationOptions</a> &<a class="el" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>)</td></tr> |
| 162 | <tr class="separator:ad44ecd3700748dc30dc4bbe34ba5bde7 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memSeparator" colspan="2"> </td></tr> |
| 163 | <tr class="memitem:a978f3d0d34a944b40240bd130d61e3b6 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_runtime.xhtml#a978f3d0d34a944b40240bd130d61e3b6">Destroy</a> (<a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a> *runtime)</td></tr> |
| 164 | <tr class="separator:a978f3d0d34a944b40240bd130d61e3b6 inherit pub_static_methods_classarmnn_1_1_i_runtime"><td class="memSeparator" colspan="2"> </td></tr> |
| 165 | <tr class="inherit_header pro_methods_classarmnn_1_1_i_runtime"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classarmnn_1_1_i_runtime')"><img src="closed.png" alt="-"/> Protected Member Functions inherited from <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a></td></tr> |
| 166 | <tr class="memitem:ad728a798fda08188df91623caebd527c inherit pro_methods_classarmnn_1_1_i_runtime"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_i_runtime.xhtml#ad728a798fda08188df91623caebd527c">~IRuntime</a> ()</td></tr> |
| 167 | <tr class="separator:ad728a798fda08188df91623caebd527c inherit pro_methods_classarmnn_1_1_i_runtime"><td class="memSeparator" colspan="2"> </td></tr> |
| 168 | </table> |
| 169 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 170 | <div class="textblock"> |
| 171 | <p class="definition">Definition at line <a class="el" href="_runtime_8hpp_source.xhtml#l00023">23</a> of file <a class="el" href="_runtime_8hpp_source.xhtml">Runtime.hpp</a>.</p> |
| 172 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 173 | <a id="a013ec7e08ae653e003956b4c9b5d0748"></a> |
| 174 | <h2 class="memtitle"><span class="permalink"><a href="#a013ec7e08ae653e003956b4c9b5d0748">◆ </a></span>Runtime()</h2> |
| 175 | |
| 176 | <div class="memitem"> |
| 177 | <div class="memproto"> |
| 178 | <table class="memname"> |
| 179 | <tr> |
| 180 | <td class="memname"><a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a> </td> |
| 181 | <td>(</td> |
| 182 | <td class="paramtype">const <a class="el" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">CreationOptions</a> & </td> |
| 183 | <td class="paramname"><em>options</em></td><td>)</td> |
| 184 | <td></td> |
| 185 | </tr> |
| 186 | </table> |
| 187 | </div><div class="memdoc"> |
| 188 | |
| 189 | <p>Creates a runtime for workload execution. </p> |
| 190 | |
| 191 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00155">155</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 192 | |
| 193 | <p class="reference">References <a class="el" href="_profiling_service_8cpp_source.xhtml#l00191">ProfilingService::AddBackendProfilingContext()</a>, <a class="el" href="_device_spec_8hpp_source.xhtml#l00030">DeviceSpec::AddSupportedBackends()</a>, <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="_version_8hpp_source.xhtml#l00024">ARMNN_VERSION</a>, <a class="el" href="_backend_registry_8cpp_source.xhtml#l00013">armnn::BackendRegistryInstance()</a>, <a class="el" href="_profiling_service_8cpp_source.xhtml#l00039">ProfilingService::ConfigureProfilingService()</a>, <a class="el" href="_backend_registry_8cpp_source.xhtml#l00048">BackendRegistry::GetFactory()</a>, <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::info</a>, <a class="el" href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService::Instance()</a>, <a class="el" href="_i_runtime_8hpp_source.xhtml#l00058">IRuntime::CreationOptions::m_DynamicBackendsPath</a>, and <a class="el" href="_i_runtime_8hpp_source.xhtml#l00076">IRuntime::CreationOptions::m_ProfilingOptions</a>.</p> |
| 194 | |
| 195 | <p class="reference">Referenced by <a class="el" href="_runtime_8hpp_source.xhtml#l00063">Runtime::GetDeviceSpec()</a>.</p> |
| 196 | <div class="fragment"><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  : m_NetworkIdCounter(0)</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">info</a>) << <span class="stringliteral">"ArmNN v"</span> << <a class="code" href="_version_8hpp.xhtml#a50bf0553d5c4b76d18a3d37e155b4d11">ARMNN_VERSION</a> << <span class="stringliteral">"\n"</span>;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="comment">// pass configuration info to the profiling service</span></div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a>().<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a004992fdba75e298495d6b628234a4bd">ConfigureProfilingService</a>(<a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>.m_ProfilingOptions);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">// Load any available/compatible dynamic backend before the runtime</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="comment">// goes through the backend registry</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  LoadDynamicBackends(<a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>.m_DynamicBackendsPath);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> </div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <a class="code" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> supportedBackends;</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>& <span class="keywordtype">id</span> : <a class="code" href="namespacearmnn.xhtml#ac2807505b850738bc8a1991ce669dd47">BackendRegistryInstance</a>().GetBackendIds())</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  {</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="comment">// Store backend contexts for the supported ones</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">try</span> {</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keyword">auto</span> factoryFun = <a class="code" href="namespacearmnn.xhtml#ac2807505b850738bc8a1991ce669dd47">BackendRegistryInstance</a>().<a class="code" href="classarmnn_1_1_backend_registry.xhtml#afc0c63ca8db8957b58826f6d7bd231b2">GetFactory</a>(<span class="keywordtype">id</span>);</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keyword">auto</span> backend = factoryFun();</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  BOOST_ASSERT(backend.get() != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keyword">auto</span> context = backend->CreateBackendContext(<a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="comment">// backends are allowed to return nullptrs if they</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">// don't wish to create a backend specific context</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="keywordflow">if</span> (context)</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  m_BackendContexts.emplace(std::make_pair(<span class="keywordtype">id</span>, std::move(context)));</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  }</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  supportedBackends.emplace(<span class="keywordtype">id</span>);</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  unique_ptr<armnn::profiling::IBackendProfiling> profilingIface =</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  std::make_unique<armnn::profiling::BackendProfiling>(<a class="code" href="classarmnn_1_1profiling_1_1_backend_profiling.xhtml">armnn::profiling::BackendProfiling</a>(</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>, <a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a>(), <span class="keywordtype">id</span>));</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span> </div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="comment">// Backends may also provide a profiling context. Ask for it now.</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keyword">auto</span> profilingContext = backend->CreateBackendProfilingContext(<a class="code" href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a>, profilingIface);</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// Backends that don't support profiling will return a null profiling context.</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keywordflow">if</span> (profilingContext)</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  {</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="comment">// Enable profiling on the backend and assert that it returns true</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">if</span>(profilingContext->EnableProfiling(<span class="keyword">true</span>))</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  {</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="comment">// Pass the context onto the profiling service.</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a>().<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#ab156998ddd9e58d2f79567bfb70e122c">AddBackendProfilingContext</a>(<span class="keywordtype">id</span>, profilingContext);</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  }</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  {</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_backend_profiling_exception.xhtml">BackendProfilingException</a>(<span class="stringliteral">"Unable to enable profiling on Backend Id: "</span> + <span class="keywordtype">id</span>.Get());</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  }</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  }</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  }</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_backend_unavailable_exception.xhtml">BackendUnavailableException</a>&)</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  {</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="comment">// Ignore backends which are unavailable</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  }</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  m_DeviceSpec.<a class="code" href="classarmnn_1_1_device_spec.xhtml#a35b48a741948fd9b2fca9698a698fdae">AddSupportedBackends</a>(supportedBackends);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span> }</div><div class="ttc" id="classarmnn_1_1_device_spec_xhtml_a35b48a741948fd9b2fca9698a698fdae"><div class="ttname"><a href="classarmnn_1_1_device_spec.xhtml#a35b48a741948fd9b2fca9698a698fdae">armnn::DeviceSpec::AddSupportedBackends</a></div><div class="ttdeci">void AddSupportedBackends(const BackendIdSet &backendIds, bool isDynamic=false)</div><div class="ttdef"><b>Definition:</b> <a href="_device_spec_8hpp_source.xhtml#l00030">DeviceSpec.hpp:30</a></div></div> |
| 197 | <div class="ttc" id="_version_8hpp_xhtml_a50bf0553d5c4b76d18a3d37e155b4d11"><div class="ttname"><a href="_version_8hpp.xhtml#a50bf0553d5c4b76d18a3d37e155b4d11">ARMNN_VERSION</a></div><div class="ttdeci">#define ARMNN_VERSION</div><div class="ttdoc">ARMNN_VERSION: "YYYYMMPP" where: YYYY = 4-digit year number MM = 2-digit month number PP = 2-digit pa...</div><div class="ttdef"><b>Definition:</b> <a href="_version_8hpp_source.xhtml#l00024">Version.hpp:24</a></div></div> |
| 198 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a6d016886de3596fe67dbabf107168f97"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a></div><div class="ttdeci">static ProfilingService & Instance()</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService.hpp:52</a></div></div> |
| 199 | <div class="ttc" id="classarmnn_1_1_backend_registry_xhtml_afc0c63ca8db8957b58826f6d7bd231b2"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml#afc0c63ca8db8957b58826f6d7bd231b2">armnn::BackendRegistry::GetFactory</a></div><div class="ttdeci">FactoryFunction GetFactory(const BackendId &id) const</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.xhtml#l00048">BackendRegistry.cpp:48</a></div></div> |
| 200 | <div class="ttc" id="namespacearmnn_xhtml_a1854d9cda81304325664363c1fd0fb27"><div class="ttname"><a href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">armnn::BackendIdSet</a></div><div class="ttdeci">std::unordered_set< BackendId > BackendIdSet</div><div class="ttdef"><b>Definition:</b> <a href="_backend_id_8hpp_source.xhtml#l00191">BackendId.hpp:191</a></div></div> |
| 201 | <div class="ttc" id="_logging_8hpp_xhtml_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.xhtml#l00163">Logging.hpp:163</a></div></div> |
| 202 | <div class="ttc" id="namespacearmnn_xhtml_ac2807505b850738bc8a1991ce669dd47"><div class="ttname"><a href="namespacearmnn.xhtml#ac2807505b850738bc8a1991ce669dd47">armnn::BackendRegistryInstance</a></div><div class="ttdeci">BackendRegistry & BackendRegistryInstance()</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.xhtml#l00013">BackendRegistry.cpp:13</a></div></div> |
| 203 | <div class="ttc" id="classarmnn_1_1profiling_1_1_backend_profiling_xhtml"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_backend_profiling.xhtml">armnn::profiling::BackendProfiling</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_profiling_8hpp_source.xhtml#l00017">BackendProfiling.hpp:17</a></div></div> |
| 204 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407acaf9b6b99962bf5c2264824231d7a40c">armnn::BoostLogSeverityMapping::info</a></div></div> |
| 205 | <div class="ttc" id="classarmnn_1_1_backend_profiling_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_backend_profiling_exception.xhtml">armnn::BackendProfilingException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00140">Exceptions.hpp:140</a></div></div> |
| 206 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_ab156998ddd9e58d2f79567bfb70e122c"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#ab156998ddd9e58d2f79567bfb70e122c">armnn::profiling::ProfilingService::AddBackendProfilingContext</a></div><div class="ttdeci">void AddBackendProfilingContext(const BackendId backendId, std::shared_ptr< armnn::profiling::IBackendProfilingContext > profilingContext)</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8cpp_source.xhtml#l00191">ProfilingService.cpp:191</a></div></div> |
| 207 | <div class="ttc" id="_file_only_profiling_decorator_tests_8cpp_xhtml_a6560146509197f3e197d8d36f76c1347"><div class="ttname"><a href="_file_only_profiling_decorator_tests_8cpp.xhtml#a6560146509197f3e197d8d36f76c1347">options</a></div><div class="ttdeci">armnn::Runtime::CreationOptions::ExternalProfilingOptions options</div><div class="ttdef"><b>Definition:</b> <a href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">FileOnlyProfilingDecoratorTests.cpp:45</a></div></div> |
| 208 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a004992fdba75e298495d6b628234a4bd"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a004992fdba75e298495d6b628234a4bd">armnn::profiling::ProfilingService::ConfigureProfilingService</a></div><div class="ttdeci">ProfilingState ConfigureProfilingService(const ExternalProfilingOptions &options, bool resetProfilingService=false)</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8cpp_source.xhtml#l00039">ProfilingService.cpp:39</a></div></div> |
| 209 | <div class="ttc" id="classarmnn_1_1_backend_unavailable_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_backend_unavailable_exception.xhtml">armnn::BackendUnavailableException</a></div><div class="ttdoc">Class for non-fatal exceptions raised while initialising a backend. </div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00068">Exceptions.hpp:68</a></div></div> |
| 210 | </div><!-- fragment --> |
| 211 | </div> |
| 212 | </div> |
| 213 | <a id="acedafca2d2711908fe94f2ef71286437"></a> |
| 214 | <h2 class="memtitle"><span class="permalink"><a href="#acedafca2d2711908fe94f2ef71286437">◆ </a></span>~Runtime()</h2> |
| 215 | |
| 216 | <div class="memitem"> |
| 217 | <div class="memproto"> |
| 218 | <table class="memname"> |
| 219 | <tr> |
| 220 | <td class="memname">~<a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a> </td> |
| 221 | <td>(</td> |
| 222 | <td class="paramname"></td><td>)</td> |
| 223 | <td></td> |
| 224 | </tr> |
| 225 | </table> |
| 226 | </div><div class="memdoc"> |
| 227 | |
| 228 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00216">216</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 229 | |
| 230 | <p class="reference">References <a class="el" href="_device_spec_8hpp_source.xhtml#l00039">DeviceSpec::ClearDynamicBackends()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00314">DynamicBackendUtils::DeregisterDynamicBackends()</a>, <a class="el" href="_device_spec_8hpp_source.xhtml#l00048">DeviceSpec::GetDynamicBackends()</a>, and <a class="el" href="_runtime_8cpp_source.xhtml#l00105">Runtime::UnloadNetwork()</a>.</p> |
| 231 | |
| 232 | <p class="reference">Referenced by <a class="el" href="_runtime_8hpp_source.xhtml#l00063">Runtime::GetDeviceSpec()</a>.</p> |
| 233 | <div class="fragment"><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> {</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  std::vector<int> networkIDs;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="comment">// Coverity fix: The following code may throw an exception of type std::length_error.</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  std::transform(m_LoadedNetworks.begin(), m_LoadedNetworks.end(),</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  std::back_inserter(networkIDs),</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  [](<span class="keyword">const</span> <span class="keyword">auto</span> &pair) { <span class="keywordflow">return</span> pair.first; });</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  }</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception& e)</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="comment">// Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an</span></div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">// exception of type std::length_error.</span></div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="comment">// Using stderr instead in this context as there is no point in nesting try-catch blocks here.</span></div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  std::cerr << <span class="stringliteral">"WARNING: An error has occurred when getting the IDs of the networks to unload: "</span> << e.what()</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  << <span class="stringliteral">"\nSome of the loaded networks may not be unloaded"</span> << std::endl;</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  }</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  <span class="comment">// We then proceed to unload all the networks which IDs have been appended to the list</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="comment">// up to the point the exception was thrown (if any).</span></div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> </div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> networkID : networkIDs)</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  {</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  {</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">// Coverity fix: UnloadNetwork() may throw an exception of type std::length_error,</span></div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="comment">// boost::log::v2s_mt_posix::odr_violation or boost::log::v2s_mt_posix::system_error</span></div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="code" href="classarmnn_1_1_runtime.xhtml#ae54a3b358f009aec340d443d038805a4">UnloadNetwork</a>(networkID);</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  }</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception& e)</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  {</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="comment">// Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="comment">// exception of type std::length_error.</span></div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="comment">// Using stderr instead in this context as there is no point in nesting try-catch blocks here.</span></div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  std::cerr << <span class="stringliteral">"WARNING: An error has occurred when unloading network "</span> << networkID << <span class="stringliteral">": "</span> << e.what()</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  << std::endl;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  }</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  }</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><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>  <span class="comment">// Clear all dynamic backends.</span></div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b">DynamicBackendUtils::DeregisterDynamicBackends</a>(m_DeviceSpec.<a class="code" href="classarmnn_1_1_device_spec.xhtml#a2a52bc9548350a186cdb8f9565eed4f0">GetDynamicBackends</a>());</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  m_DeviceSpec.<a class="code" href="classarmnn_1_1_device_spec.xhtml#a5051d926510964d87440330c0469d9c5">ClearDynamicBackends</a>();</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  m_BackendContexts.clear();</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> }</div><div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a7e786263f454b19c40b78c4092a4af5b"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b">armnn::DynamicBackendUtils::DeregisterDynamicBackends</a></div><div class="ttdeci">static void DeregisterDynamicBackends(const BackendIdSet &dynamicBackends)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00314">DynamicBackendUtils.cpp:314</a></div></div> |
| 234 | <div class="ttc" id="classarmnn_1_1_device_spec_xhtml_a2a52bc9548350a186cdb8f9565eed4f0"><div class="ttname"><a href="classarmnn_1_1_device_spec.xhtml#a2a52bc9548350a186cdb8f9565eed4f0">armnn::DeviceSpec::GetDynamicBackends</a></div><div class="ttdeci">const BackendIdSet & GetDynamicBackends() const</div><div class="ttdef"><b>Definition:</b> <a href="_device_spec_8hpp_source.xhtml#l00048">DeviceSpec.hpp:48</a></div></div> |
| 235 | <div class="ttc" id="classarmnn_1_1_device_spec_xhtml_a5051d926510964d87440330c0469d9c5"><div class="ttname"><a href="classarmnn_1_1_device_spec.xhtml#a5051d926510964d87440330c0469d9c5">armnn::DeviceSpec::ClearDynamicBackends</a></div><div class="ttdeci">void ClearDynamicBackends()</div><div class="ttdef"><b>Definition:</b> <a href="_device_spec_8hpp_source.xhtml#l00039">DeviceSpec.hpp:39</a></div></div> |
| 236 | <div class="ttc" id="classarmnn_1_1_runtime_xhtml_ae54a3b358f009aec340d443d038805a4"><div class="ttname"><a href="classarmnn_1_1_runtime.xhtml#ae54a3b358f009aec340d443d038805a4">armnn::Runtime::UnloadNetwork</a></div><div class="ttdeci">virtual Status UnloadNetwork(NetworkId networkId) override</div><div class="ttdoc">Unloads a network from the Runtime. </div><div class="ttdef"><b>Definition:</b> <a href="_runtime_8cpp_source.xhtml#l00105">Runtime.cpp:105</a></div></div> |
| 237 | </div><!-- fragment --> |
| 238 | </div> |
| 239 | </div> |
| 240 | <h2 class="groupheader">Member Function Documentation</h2> |
| 241 | <a id="ad3be3cca4ac08a262383b96868f7123d"></a> |
| 242 | <h2 class="memtitle"><span class="permalink"><a href="#ad3be3cca4ac08a262383b96868f7123d">◆ </a></span>EnqueueWorkload()</h2> |
| 243 | |
| 244 | <div class="memitem"> |
| 245 | <div class="memproto"> |
| 246 | <table class="mlabels"> |
| 247 | <tr> |
| 248 | <td class="mlabels-left"> |
| 249 | <table class="memname"> |
| 250 | <tr> |
| 251 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> EnqueueWorkload </td> |
| 252 | <td>(</td> |
| 253 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 254 | <td class="paramname"><em>networkId</em>, </td> |
| 255 | </tr> |
| 256 | <tr> |
| 257 | <td class="paramkey"></td> |
| 258 | <td></td> |
| 259 | <td class="paramtype">const <a class="el" href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">InputTensors</a> & </td> |
| 260 | <td class="paramname"><em>inputTensors</em>, </td> |
| 261 | </tr> |
| 262 | <tr> |
| 263 | <td class="paramkey"></td> |
| 264 | <td></td> |
| 265 | <td class="paramtype">const <a class="el" href="namespacearmnn.xhtml#a8f091a512915d1cb29a4ebf13dfc53ea">OutputTensors</a> & </td> |
| 266 | <td class="paramname"><em>outputTensors</em> </td> |
| 267 | </tr> |
| 268 | <tr> |
| 269 | <td></td> |
| 270 | <td>)</td> |
| 271 | <td></td><td></td> |
| 272 | </tr> |
| 273 | </table> |
| 274 | </td> |
| 275 | <td class="mlabels-right"> |
| 276 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 277 | </tr> |
| 278 | </table> |
| 279 | </div><div class="memdoc"> |
| 280 | |
| 281 | <p>Evaluates a network using input in inputTensors and outputs filled into outputTensors. </p> |
| 282 | |
| 283 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#aec0dc8016a3b1e444dfc1ffb5f15195c">IRuntime</a>.</p> |
| 284 | |
| 285 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00279">279</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 286 | |
| 287 | <p class="reference">References <a class="el" href="_loaded_network_8cpp_source.xhtml#l00412">LoadedNetwork::EnqueueWorkload()</a>, and <a class="el" href="_loaded_network_8cpp_source.xhtml#l00660">LoadedNetwork::FreeWorkingMemory()</a>.</p> |
| 288 | <div class="fragment"><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> {</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <a class="code" href="classarmnn_1_1_loaded_network.xhtml">LoadedNetwork</a>* loadedNetwork = GetLoadedNetworkPtr(networkId);</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> </div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keyword">static</span> thread_local <a class="code" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> lastId = networkId;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">if</span> (lastId != networkId)</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  {</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  LoadedNetworkFuncSafe(lastId, [](<a class="code" href="classarmnn_1_1_loaded_network.xhtml">LoadedNetwork</a>* network)</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  {</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  network-><a class="code" href="classarmnn_1_1_loaded_network.xhtml#aaf8558a23ae9be6e7ea165989f1fa808">FreeWorkingMemory</a>();</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  });</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  }</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  lastId=networkId;</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> </div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="keywordflow">return</span> loadedNetwork-><a class="code" href="classarmnn_1_1_loaded_network.xhtml#a878c3febb600fd2ccf3b5cb1f9a61e27">EnqueueWorkload</a>(inputTensors, outputTensors);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a83015160d8c67d5d77735eb0d4033d9a"><div class="ttname"><a href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">armnn::NetworkId</a></div><div class="ttdeci">int NetworkId</div><div class="ttdef"><b>Definition:</b> <a href="_i_runtime_8hpp_source.xhtml#l00019">IRuntime.hpp:19</a></div></div> |
| 289 | <div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_aaf8558a23ae9be6e7ea165989f1fa808"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#aaf8558a23ae9be6e7ea165989f1fa808">armnn::LoadedNetwork::FreeWorkingMemory</a></div><div class="ttdeci">void FreeWorkingMemory()</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00660">LoadedNetwork.cpp:660</a></div></div> |
| 290 | <div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_a878c3febb600fd2ccf3b5cb1f9a61e27"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#a878c3febb600fd2ccf3b5cb1f9a61e27">armnn::LoadedNetwork::EnqueueWorkload</a></div><div class="ttdeci">Status EnqueueWorkload(const InputTensors &inputTensors, const OutputTensors &outputTensors)</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00412">LoadedNetwork.cpp:412</a></div></div> |
| 291 | <div class="ttc" id="classarmnn_1_1_loaded_network_xhtml"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml">armnn::LoadedNetwork</a></div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8hpp_source.xhtml#l00033">LoadedNetwork.hpp:33</a></div></div> |
| 292 | </div><!-- fragment --> |
| 293 | </div> |
| 294 | </div> |
| 295 | <a id="a25505c77f282c0295765d81c86514539"></a> |
| 296 | <h2 class="memtitle"><span class="permalink"><a href="#a25505c77f282c0295765d81c86514539">◆ </a></span>GetDeviceSpec()</h2> |
| 297 | |
| 298 | <div class="memitem"> |
| 299 | <div class="memproto"> |
| 300 | <table class="mlabels"> |
| 301 | <tr> |
| 302 | <td class="mlabels-left"> |
| 303 | <table class="memname"> |
| 304 | <tr> |
| 305 | <td class="memname">virtual const <a class="el" href="classarmnn_1_1_i_device_spec.xhtml">IDeviceSpec</a>& GetDeviceSpec </td> |
| 306 | <td>(</td> |
| 307 | <td class="paramname"></td><td>)</td> |
| 308 | <td> const</td> |
| 309 | </tr> |
| 310 | </table> |
| 311 | </td> |
| 312 | <td class="mlabels-right"> |
| 313 | <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 314 | </tr> |
| 315 | </table> |
| 316 | </div><div class="memdoc"> |
| 317 | |
| 318 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a6f2ccbdacfac6eb983c519976a5ece54">IRuntime</a>.</p> |
| 319 | |
| 320 | <p class="definition">Definition at line <a class="el" href="_runtime_8hpp_source.xhtml#l00063">63</a> of file <a class="el" href="_runtime_8hpp_source.xhtml">Runtime.hpp</a>.</p> |
| 321 | |
| 322 | <p class="reference">References <a class="el" href="_runtime_8cpp_source.xhtml#l00143">Runtime::GetProfiler()</a>, <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.xhtml#l00045">options</a>, <a class="el" href="_runtime_8cpp_source.xhtml#l00298">Runtime::RegisterDebugCallback()</a>, <a class="el" href="_runtime_8cpp_source.xhtml#l00155">Runtime::Runtime()</a>, <a class="el" href="_runtime_tests_8cpp_source.xhtml#l00028">Runtime::RuntimeLoadedNetworksReserve</a>, and <a class="el" href="_runtime_8cpp_source.xhtml#l00216">Runtime::~Runtime()</a>.</p> |
| 323 | |
| 324 | <p class="reference">Referenced by <a class="el" href="_runtime_tests_8cpp_source.xhtml#l00037">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 325 | <div class="fragment"><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> { <span class="keywordflow">return</span> m_DeviceSpec; }</div></div><!-- fragment --> |
| 326 | </div> |
| 327 | </div> |
| 328 | <a id="a7d0ddcd74d6f6438283e511480b64cc1"></a> |
| 329 | <h2 class="memtitle"><span class="permalink"><a href="#a7d0ddcd74d6f6438283e511480b64cc1">◆ </a></span>GetInputTensorInfo()</h2> |
| 330 | |
| 331 | <div class="memitem"> |
| 332 | <div class="memproto"> |
| 333 | <table class="mlabels"> |
| 334 | <tr> |
| 335 | <td class="mlabels-left"> |
| 336 | <table class="memname"> |
| 337 | <tr> |
| 338 | <td class="memname"><a class="el" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> GetInputTensorInfo </td> |
| 339 | <td>(</td> |
| 340 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 341 | <td class="paramname"><em>networkId</em>, </td> |
| 342 | </tr> |
| 343 | <tr> |
| 344 | <td class="paramkey"></td> |
| 345 | <td></td> |
| 346 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">LayerBindingId</a> </td> |
| 347 | <td class="paramname"><em>layerId</em> </td> |
| 348 | </tr> |
| 349 | <tr> |
| 350 | <td></td> |
| 351 | <td>)</td> |
| 352 | <td></td><td> const</td> |
| 353 | </tr> |
| 354 | </table> |
| 355 | </td> |
| 356 | <td class="mlabels-right"> |
| 357 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 358 | </tr> |
| 359 | </table> |
| 360 | </div><div class="memdoc"> |
| 361 | |
| 362 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a41ac6ca444d41e6147f48a71def60d61">IRuntime</a>.</p> |
| 363 | |
| 364 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00268">268</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 365 | |
| 366 | <p class="reference">References <a class="el" href="_loaded_network_8cpp_source.xhtml#l00263">LoadedNetwork::GetInputTensorInfo()</a>.</p> |
| 367 | <div class="fragment"><div class="line"><a name="l00269"></a><span class="lineno"> 269</span> {</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordflow">return</span> GetLoadedNetworkPtr(networkId)-><a class="code" href="classarmnn_1_1_loaded_network.xhtml#af616683424cb40d83b5a923db7f06f11">GetInputTensorInfo</a>(layerId);</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span> }</div><div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_af616683424cb40d83b5a923db7f06f11"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#af616683424cb40d83b5a923db7f06f11">armnn::LoadedNetwork::GetInputTensorInfo</a></div><div class="ttdeci">TensorInfo GetInputTensorInfo(LayerBindingId layerId) const</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00263">LoadedNetwork.cpp:263</a></div></div> |
| 368 | </div><!-- fragment --> |
| 369 | </div> |
| 370 | </div> |
| 371 | <a id="a1d5d285b79758564ee68f234e02dd2b2"></a> |
| 372 | <h2 class="memtitle"><span class="permalink"><a href="#a1d5d285b79758564ee68f234e02dd2b2">◆ </a></span>GetOutputTensorInfo()</h2> |
| 373 | |
| 374 | <div class="memitem"> |
| 375 | <div class="memproto"> |
| 376 | <table class="mlabels"> |
| 377 | <tr> |
| 378 | <td class="mlabels-left"> |
| 379 | <table class="memname"> |
| 380 | <tr> |
| 381 | <td class="memname"><a class="el" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> GetOutputTensorInfo </td> |
| 382 | <td>(</td> |
| 383 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 384 | <td class="paramname"><em>networkId</em>, </td> |
| 385 | </tr> |
| 386 | <tr> |
| 387 | <td class="paramkey"></td> |
| 388 | <td></td> |
| 389 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#ab8cf8f9fb6792e654c2d8d8382f6f01b">LayerBindingId</a> </td> |
| 390 | <td class="paramname"><em>layerId</em> </td> |
| 391 | </tr> |
| 392 | <tr> |
| 393 | <td></td> |
| 394 | <td>)</td> |
| 395 | <td></td><td> const</td> |
| 396 | </tr> |
| 397 | </table> |
| 398 | </td> |
| 399 | <td class="mlabels-right"> |
| 400 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 401 | </tr> |
| 402 | </table> |
| 403 | </div><div class="memdoc"> |
| 404 | |
| 405 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a52b521ba6b78d819895a7dbaae83ed86">IRuntime</a>.</p> |
| 406 | |
| 407 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00273">273</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 408 | |
| 409 | <p class="reference">References <a class="el" href="_loaded_network_8cpp_source.xhtml#l00277">LoadedNetwork::GetOutputTensorInfo()</a>.</p> |
| 410 | <div class="fragment"><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> {</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">return</span> GetLoadedNetworkPtr(networkId)-><a class="code" href="classarmnn_1_1_loaded_network.xhtml#a2b6b57945bc68f659e08d28c8a015e91">GetOutputTensorInfo</a>(layerId);</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span> }</div><div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_a2b6b57945bc68f659e08d28c8a015e91"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#a2b6b57945bc68f659e08d28c8a015e91">armnn::LoadedNetwork::GetOutputTensorInfo</a></div><div class="ttdeci">TensorInfo GetOutputTensorInfo(LayerBindingId layerId) const</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00277">LoadedNetwork.cpp:277</a></div></div> |
| 411 | </div><!-- fragment --> |
| 412 | </div> |
| 413 | </div> |
| 414 | <a id="a4bcf6ecfacedc0567e1c044f1b0823f0"></a> |
| 415 | <h2 class="memtitle"><span class="permalink"><a href="#a4bcf6ecfacedc0567e1c044f1b0823f0">◆ </a></span>GetProfiler()</h2> |
| 416 | |
| 417 | <div class="memitem"> |
| 418 | <div class="memproto"> |
| 419 | <table class="mlabels"> |
| 420 | <tr> |
| 421 | <td class="mlabels-left"> |
| 422 | <table class="memname"> |
| 423 | <tr> |
| 424 | <td class="memname">const std::shared_ptr< <a class="el" href="classarmnn_1_1_i_profiler.xhtml">IProfiler</a> > GetProfiler </td> |
| 425 | <td>(</td> |
| 426 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 427 | <td class="paramname"><em>networkId</em></td><td>)</td> |
| 428 | <td> const</td> |
| 429 | </tr> |
| 430 | </table> |
| 431 | </td> |
| 432 | <td class="mlabels-right"> |
| 433 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 434 | </tr> |
| 435 | </table> |
| 436 | </div><div class="memdoc"> |
| 437 | |
| 438 | <p>Gets the profiler corresponding to the given network id. </p> |
| 439 | <dl class="params"><dt>Parameters</dt><dd> |
| 440 | <table class="params"> |
| 441 | <tr><td class="paramname">networkId</td><td>The id of the network for which to get the profile. </td></tr> |
| 442 | </table> |
| 443 | </dd> |
| 444 | </dl> |
| 445 | <dl class="section return"><dt>Returns</dt><dd>A pointer to the requested profiler, or nullptr if not found. </dd></dl> |
| 446 | |
| 447 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a76eaa5bd91bd3958ddbe1fe6f082888a">IRuntime</a>.</p> |
| 448 | |
| 449 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00143">143</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 450 | |
| 451 | <p class="reference">Referenced by <a class="el" href="_runtime_8hpp_source.xhtml#l00063">Runtime::GetDeviceSpec()</a>.</p> |
| 452 | <div class="fragment"><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">auto</span> it = m_LoadedNetworks.find(networkId);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordflow">if</span> (it != m_LoadedNetworks.end())</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">auto</span>& loadedNetwork = it->second;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">return</span> loadedNetwork->GetProfiler();</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  }</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> }</div></div><!-- fragment --> |
| 453 | </div> |
| 454 | </div> |
| 455 | <a id="ae225e29e38b44860a32d766053a383dc"></a> |
| 456 | <h2 class="memtitle"><span class="permalink"><a href="#ae225e29e38b44860a32d766053a383dc">◆ </a></span>LoadNetwork() <span class="overload">[1/3]</span></h2> |
| 457 | |
| 458 | <div class="memitem"> |
| 459 | <div class="memproto"> |
| 460 | <table class="mlabels"> |
| 461 | <tr> |
| 462 | <td class="mlabels-left"> |
| 463 | <table class="memname"> |
| 464 | <tr> |
| 465 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> LoadNetwork </td> |
| 466 | <td>(</td> |
| 467 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> & </td> |
| 468 | <td class="paramname"><em>networkIdOut</em>, </td> |
| 469 | </tr> |
| 470 | <tr> |
| 471 | <td class="paramkey"></td> |
| 472 | <td></td> |
| 473 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> </td> |
| 474 | <td class="paramname"><em>network</em> </td> |
| 475 | </tr> |
| 476 | <tr> |
| 477 | <td></td> |
| 478 | <td>)</td> |
| 479 | <td></td><td></td> |
| 480 | </tr> |
| 481 | </table> |
| 482 | </td> |
| 483 | <td class="mlabels-right"> |
| 484 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 485 | </tr> |
| 486 | </table> |
| 487 | </div><div class="memdoc"> |
| 488 | |
| 489 | <p>Loads a complete network into the <a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a>. </p> |
| 490 | <dl class="params"><dt>Parameters</dt><dd> |
| 491 | <table class="params"> |
| 492 | <tr><td class="paramdir">[out]</td><td class="paramname">networkIdOut</td><td>- Unique identifier for the network is returned in this reference. </td></tr> |
| 493 | <tr><td class="paramdir">[in]</td><td class="paramname">network</td><td>- Complete network to load into the <a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a>. The runtime takes ownership of the network once passed in. </td></tr> |
| 494 | </table> |
| 495 | </dd> |
| 496 | </dl> |
| 497 | <dl class="section return"><dt>Returns</dt><dd><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b" title="enumeration ">armnn::Status</a> </dd></dl> |
| 498 | |
| 499 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#acf44b518011359b594bf20fe444d1165">IRuntime</a>.</p> |
| 500 | |
| 501 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00047">47</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 502 | |
| 503 | <p class="reference">Referenced by <a class="el" href="_runtime_tests_8cpp_source.xhtml#l00037">BOOST_AUTO_TEST_CASE()</a>.</p> |
| 504 | <div class="fragment"><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> {</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  std::string ignoredErrorMessage;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc">LoadNetwork</a>(networkIdOut, std::move(inNetwork), ignoredErrorMessage);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div><div class="ttc" id="classarmnn_1_1_runtime_xhtml_ae225e29e38b44860a32d766053a383dc"><div class="ttname"><a href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc">armnn::Runtime::LoadNetwork</a></div><div class="ttdeci">virtual Status LoadNetwork(NetworkId &networkIdOut, IOptimizedNetworkPtr network) override</div><div class="ttdoc">Loads a complete network into the Runtime. </div><div class="ttdef"><b>Definition:</b> <a href="_runtime_8cpp_source.xhtml#l00047">Runtime.cpp:47</a></div></div> |
| 505 | </div><!-- fragment --> |
| 506 | </div> |
| 507 | </div> |
| 508 | <a id="a115d6e9020c106d938a431e92141456e"></a> |
| 509 | <h2 class="memtitle"><span class="permalink"><a href="#a115d6e9020c106d938a431e92141456e">◆ </a></span>LoadNetwork() <span class="overload">[2/3]</span></h2> |
| 510 | |
| 511 | <div class="memitem"> |
| 512 | <div class="memproto"> |
| 513 | <table class="mlabels"> |
| 514 | <tr> |
| 515 | <td class="mlabels-left"> |
| 516 | <table class="memname"> |
| 517 | <tr> |
| 518 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> LoadNetwork </td> |
| 519 | <td>(</td> |
| 520 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> & </td> |
| 521 | <td class="paramname"><em>networkIdOut</em>, </td> |
| 522 | </tr> |
| 523 | <tr> |
| 524 | <td class="paramkey"></td> |
| 525 | <td></td> |
| 526 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> </td> |
| 527 | <td class="paramname"><em>network</em>, </td> |
| 528 | </tr> |
| 529 | <tr> |
| 530 | <td class="paramkey"></td> |
| 531 | <td></td> |
| 532 | <td class="paramtype">std::string & </td> |
| 533 | <td class="paramname"><em>errorMessage</em> </td> |
| 534 | </tr> |
| 535 | <tr> |
| 536 | <td></td> |
| 537 | <td>)</td> |
| 538 | <td></td><td></td> |
| 539 | </tr> |
| 540 | </table> |
| 541 | </td> |
| 542 | <td class="mlabels-right"> |
| 543 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 544 | </tr> |
| 545 | </table> |
| 546 | </div><div class="memdoc"> |
| 547 | |
| 548 | <p>Load a complete network into the <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a>. </p> |
| 549 | <dl class="params"><dt>Parameters</dt><dd> |
| 550 | <table class="params"> |
| 551 | <tr><td class="paramdir">[out]</td><td class="paramname">networkIdOut</td><td>Unique identifier for the network is returned in this reference. </td></tr> |
| 552 | <tr><td class="paramdir">[in]</td><td class="paramname">network</td><td>Complete network to load into the <a class="el" href="classarmnn_1_1_i_runtime.xhtml">IRuntime</a>. </td></tr> |
| 553 | <tr><td class="paramdir">[out]</td><td class="paramname">errorMessage</td><td>Error message if there were any errors. The runtime takes ownership of the network once passed in. </td></tr> |
| 554 | </table> |
| 555 | </dd> |
| 556 | </dl> |
| 557 | <dl class="section return"><dt>Returns</dt><dd><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b" title="enumeration ">armnn::Status</a> </dd></dl> |
| 558 | |
| 559 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a59c572133d8ff0136c8e13c98694fd30">IRuntime</a>.</p> |
| 560 | |
| 561 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00053">53</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 562 | <div class="fragment"><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="structarmnn_1_1_i_network_properties.xhtml">INetworkProperties</a> networkProperties;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc">LoadNetwork</a>(networkIdOut, std::move(inNetwork), errorMessage, networkProperties);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> }</div><div class="ttc" id="structarmnn_1_1_i_network_properties_xhtml"><div class="ttname"><a href="structarmnn_1_1_i_network_properties.xhtml">armnn::INetworkProperties</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_runtime_8hpp_source.xhtml#l00026">IRuntime.hpp:26</a></div></div> |
| 563 | <div class="ttc" id="classarmnn_1_1_runtime_xhtml_ae225e29e38b44860a32d766053a383dc"><div class="ttname"><a href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc">armnn::Runtime::LoadNetwork</a></div><div class="ttdeci">virtual Status LoadNetwork(NetworkId &networkIdOut, IOptimizedNetworkPtr network) override</div><div class="ttdoc">Loads a complete network into the Runtime. </div><div class="ttdef"><b>Definition:</b> <a href="_runtime_8cpp_source.xhtml#l00047">Runtime.cpp:47</a></div></div> |
| 564 | </div><!-- fragment --> |
| 565 | </div> |
| 566 | </div> |
| 567 | <a id="aa1ca93de061aac0fb5b59082f1b8984e"></a> |
| 568 | <h2 class="memtitle"><span class="permalink"><a href="#aa1ca93de061aac0fb5b59082f1b8984e">◆ </a></span>LoadNetwork() <span class="overload">[3/3]</span></h2> |
| 569 | |
| 570 | <div class="memitem"> |
| 571 | <div class="memproto"> |
| 572 | <table class="mlabels"> |
| 573 | <tr> |
| 574 | <td class="mlabels-left"> |
| 575 | <table class="memname"> |
| 576 | <tr> |
| 577 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> LoadNetwork </td> |
| 578 | <td>(</td> |
| 579 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> & </td> |
| 580 | <td class="paramname"><em>networkIdOut</em>, </td> |
| 581 | </tr> |
| 582 | <tr> |
| 583 | <td class="paramkey"></td> |
| 584 | <td></td> |
| 585 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">IOptimizedNetworkPtr</a> </td> |
| 586 | <td class="paramname"><em>network</em>, </td> |
| 587 | </tr> |
| 588 | <tr> |
| 589 | <td class="paramkey"></td> |
| 590 | <td></td> |
| 591 | <td class="paramtype">std::string & </td> |
| 592 | <td class="paramname"><em>errorMessage</em>, </td> |
| 593 | </tr> |
| 594 | <tr> |
| 595 | <td class="paramkey"></td> |
| 596 | <td></td> |
| 597 | <td class="paramtype">const <a class="el" href="structarmnn_1_1_i_network_properties.xhtml">INetworkProperties</a> & </td> |
| 598 | <td class="paramname"><em>networkProperties</em> </td> |
| 599 | </tr> |
| 600 | <tr> |
| 601 | <td></td> |
| 602 | <td>)</td> |
| 603 | <td></td><td></td> |
| 604 | </tr> |
| 605 | </table> |
| 606 | </td> |
| 607 | <td class="mlabels-right"> |
| 608 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 609 | </tr> |
| 610 | </table> |
| 611 | </div><div class="memdoc"> |
| 612 | |
| 613 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a7cc77101a5437bf82fb7891c5c4a7e69">IRuntime</a>.</p> |
| 614 | |
| 615 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00061">61</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 616 | |
| 617 | <p class="reference">References <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">armnn::Failure</a>, <a class="el" href="_profiling_service_8cpp_source.xhtml#l00278">ProfilingService::IncrementCounterValue()</a>, <a class="el" href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService::Instance()</a>, <a class="el" href="_loaded_network_8cpp_source.xhtml#l00085">LoadedNetwork::MakeLoadedNetwork()</a>, and <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">armnn::Success</a>.</p> |
| 618 | <div class="fragment"><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> {</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classarmnn_1_1_i_optimized_network.xhtml">IOptimizedNetwork</a>* rawNetwork = inNetwork.release();</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  networkIdOut = GenerateNetworkId();</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& context : m_BackendContexts)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  {</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  context.second->BeforeLoadNetwork(networkIdOut);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  unique_ptr<LoadedNetwork> loadedNetwork = <a class="code" href="classarmnn_1_1_loaded_network.xhtml#aaa7a9817a8c3c6595ea8255e2fe843c6">LoadedNetwork::MakeLoadedNetwork</a>(</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  std::unique_ptr<OptimizedNetwork>(boost::polymorphic_downcast<OptimizedNetwork*>(rawNetwork)),</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  errorMessage,</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  networkProperties);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keywordflow">if</span> (!loadedNetwork)</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">Status::Failure</a>;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  std::lock_guard<std::mutex> lockGuard(m_Mutex);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="comment">// Stores the network</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  m_LoadedNetworks[networkIdOut] = std::move(loadedNetwork);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  }</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& context : m_BackendContexts)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  {</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  context.second->AfterLoadNetwork(networkIdOut);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">if</span> (<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">profiling::ProfilingService::Instance</a>().IsProfilingEnabled())</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  {</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">profiling::ProfilingService::Instance</a>().<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6c2d955d387944f5b7ad37ebb435a37f">IncrementCounterValue</a>(armnn::profiling::NETWORK_LOADS);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">Status::Success</a>;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> }</div><div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a6d016886de3596fe67dbabf107168f97"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a></div><div class="ttdeci">static ProfilingService & Instance()</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService.hpp:52</a></div></div> |
| 619 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a6c2d955d387944f5b7ad37ebb435a37f"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6c2d955d387944f5b7ad37ebb435a37f">armnn::profiling::ProfilingService::IncrementCounterValue</a></div><div class="ttdeci">uint32_t IncrementCounterValue(uint16_t counterUid) override</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8cpp_source.xhtml#l00278">ProfilingService.cpp:278</a></div></div> |
| 620 | <div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_aaa7a9817a8c3c6595ea8255e2fe843c6"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#aaa7a9817a8c3c6595ea8255e2fe843c6">armnn::LoadedNetwork::MakeLoadedNetwork</a></div><div class="ttdeci">static std::unique_ptr< LoadedNetwork > MakeLoadedNetwork(std::unique_ptr< OptimizedNetwork > net, std::string &errorMessage, const INetworkProperties &networkProperties)</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00085">LoadedNetwork.cpp:85</a></div></div> |
| 621 | <div class="ttc" id="namespacearmnn_xhtml_a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38"><div class="ttname"><a href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">armnn::Status::Success</a></div></div> |
| 622 | <div class="ttc" id="classarmnn_1_1_i_optimized_network_xhtml"><div class="ttname"><a href="classarmnn_1_1_i_optimized_network.xhtml">armnn::IOptimizedNetwork</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.xhtml#l00568">INetwork.hpp:568</a></div></div> |
| 623 | <div class="ttc" id="namespacearmnn_xhtml_a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086"><div class="ttname"><a href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">armnn::Status::Failure</a></div></div> |
| 624 | </div><!-- fragment --> |
| 625 | </div> |
| 626 | </div> |
| 627 | <a id="abb2506e9166cd0467deaa9651fdade77"></a> |
| 628 | <h2 class="memtitle"><span class="permalink"><a href="#abb2506e9166cd0467deaa9651fdade77">◆ </a></span>RegisterDebugCallback()</h2> |
| 629 | |
| 630 | <div class="memitem"> |
| 631 | <div class="memproto"> |
| 632 | <table class="mlabels"> |
| 633 | <tr> |
| 634 | <td class="mlabels-left"> |
| 635 | <table class="memname"> |
| 636 | <tr> |
| 637 | <td class="memname">void RegisterDebugCallback </td> |
| 638 | <td>(</td> |
| 639 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 640 | <td class="paramname"><em>networkId</em>, </td> |
| 641 | </tr> |
| 642 | <tr> |
| 643 | <td class="paramkey"></td> |
| 644 | <td></td> |
| 645 | <td class="paramtype">const <a class="el" href="namespacearmnn.xhtml#a15f3ad9b5e4e3d46b0a6dda246a7bc28">DebugCallbackFunction</a> & </td> |
| 646 | <td class="paramname"><em>func</em> </td> |
| 647 | </tr> |
| 648 | <tr> |
| 649 | <td></td> |
| 650 | <td>)</td> |
| 651 | <td></td><td></td> |
| 652 | </tr> |
| 653 | </table> |
| 654 | </td> |
| 655 | <td class="mlabels-right"> |
| 656 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 657 | </tr> |
| 658 | </table> |
| 659 | </div><div class="memdoc"> |
| 660 | |
| 661 | <p>Registers a callback function to debug layers performing custom computations on intermediate tensors. </p> |
| 662 | <dl class="params"><dt>Parameters</dt><dd> |
| 663 | <table class="params"> |
| 664 | <tr><td class="paramname">networkId</td><td>The id of the network to register the callback. </td></tr> |
| 665 | <tr><td class="paramname">func</td><td>callback function to pass to the debug layer. </td></tr> |
| 666 | </table> |
| 667 | </dd> |
| 668 | </dl> |
| 669 | |
| 670 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a70a22690ce44dfc49511b30456764169">IRuntime</a>.</p> |
| 671 | |
| 672 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00298">298</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 673 | |
| 674 | <p class="reference">References <a class="el" href="_device_spec_8hpp_source.xhtml#l00030">DeviceSpec::AddSupportedBackends()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00263">DynamicBackendUtils::CreateDynamicBackends()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00080">DynamicBackendUtils::GetBackendPaths()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00176">DynamicBackendUtils::GetSharedObjects()</a>, <a class="el" href="_loaded_network_8cpp_source.xhtml#l00750">LoadedNetwork::RegisterDebugCallback()</a>, and <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00326">DynamicBackendUtils::RegisterDynamicBackends()</a>.</p> |
| 675 | |
| 676 | <p class="reference">Referenced by <a class="el" href="_runtime_8hpp_source.xhtml#l00063">Runtime::GetDeviceSpec()</a>.</p> |
| 677 | <div class="fragment"><div class="line"><a name="l00299"></a><span class="lineno"> 299</span> {</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <a class="code" href="classarmnn_1_1_loaded_network.xhtml">LoadedNetwork</a>* loadedNetwork = GetLoadedNetworkPtr(networkId);</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  loadedNetwork-><a class="code" href="classarmnn_1_1_loaded_network.xhtml#a091ea8d2d804c8902f3120fdf2a36512">RegisterDebugCallback</a>(func);</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> }</div><div class="ttc" id="classarmnn_1_1_loaded_network_xhtml"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml">armnn::LoadedNetwork</a></div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8hpp_source.xhtml#l00033">LoadedNetwork.hpp:33</a></div></div> |
| 678 | <div class="ttc" id="classarmnn_1_1_loaded_network_xhtml_a091ea8d2d804c8902f3120fdf2a36512"><div class="ttname"><a href="classarmnn_1_1_loaded_network.xhtml#a091ea8d2d804c8902f3120fdf2a36512">armnn::LoadedNetwork::RegisterDebugCallback</a></div><div class="ttdeci">void RegisterDebugCallback(const DebugCallbackFunction &func)</div><div class="ttdef"><b>Definition:</b> <a href="_loaded_network_8cpp_source.xhtml#l00750">LoadedNetwork.cpp:750</a></div></div> |
| 679 | </div><!-- fragment --> |
| 680 | </div> |
| 681 | </div> |
| 682 | <a id="ae54a3b358f009aec340d443d038805a4"></a> |
| 683 | <h2 class="memtitle"><span class="permalink"><a href="#ae54a3b358f009aec340d443d038805a4">◆ </a></span>UnloadNetwork()</h2> |
| 684 | |
| 685 | <div class="memitem"> |
| 686 | <div class="memproto"> |
| 687 | <table class="mlabels"> |
| 688 | <tr> |
| 689 | <td class="mlabels-left"> |
| 690 | <table class="memname"> |
| 691 | <tr> |
| 692 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b">Status</a> UnloadNetwork </td> |
| 693 | <td>(</td> |
| 694 | <td class="paramtype"><a class="el" href="namespacearmnn.xhtml#a83015160d8c67d5d77735eb0d4033d9a">NetworkId</a> </td> |
| 695 | <td class="paramname"><em>networkId</em></td><td>)</td> |
| 696 | <td></td> |
| 697 | </tr> |
| 698 | </table> |
| 699 | </td> |
| 700 | <td class="mlabels-right"> |
| 701 | <span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td> |
| 702 | </tr> |
| 703 | </table> |
| 704 | </div><div class="memdoc"> |
| 705 | |
| 706 | <p>Unloads a network from the <a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a>. </p> |
| 707 | <p>At the moment this only removes the network from the m_Impl->m_Network. This might need more work in the future to be AndroidNN compliant. </p><dl class="params"><dt>Parameters</dt><dd> |
| 708 | <table class="params"> |
| 709 | <tr><td class="paramdir">[in]</td><td class="paramname">networkId</td><td>Unique identifier for the network to be unloaded. Generated in <a class="el" href="classarmnn_1_1_runtime.xhtml#ae225e29e38b44860a32d766053a383dc" title="Loads a complete network into the Runtime. ">LoadNetwork()</a>. </td></tr> |
| 710 | </table> |
| 711 | </dd> |
| 712 | </dl> |
| 713 | <dl class="section return"><dt>Returns</dt><dd><a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70b" title="enumeration ">armnn::Status</a> </dd></dl> |
| 714 | |
| 715 | <p>Implements <a class="el" href="classarmnn_1_1_i_runtime.xhtml#a43a7ee9625c9c3f4140fa02c92199fd1">IRuntime</a>.</p> |
| 716 | |
| 717 | <p class="definition">Definition at line <a class="el" href="_runtime_8cpp_source.xhtml#l00105">105</a> of file <a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a>.</p> |
| 718 | |
| 719 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407aad42f6697b035b7580e4fef93be20b4d">armnn::debug</a>, <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">armnn::Failure</a>, <a class="el" href="_profiling_service_8cpp_source.xhtml#l00278">ProfilingService::IncrementCounterValue()</a>, <a class="el" href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService::Instance()</a>, <a class="el" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">armnn::Success</a>, and <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 720 | |
| 721 | <p class="reference">Referenced by <a class="el" href="_runtime_tests_8cpp_source.xhtml#l00037">BOOST_AUTO_TEST_CASE()</a>, and <a class="el" href="_runtime_8cpp_source.xhtml#l00216">Runtime::~Runtime()</a>.</p> |
| 722 | <div class="fragment"><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> {</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordtype">bool</span> unloadOk = <span class="keyword">true</span>;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& context : m_BackendContexts)</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  unloadOk &= context.second->BeforeUnloadNetwork(networkId);</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">if</span> (!unloadOk)</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  {</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Runtime::UnloadNetwork(): failed to unload "</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="stringliteral">"network with ID:"</span> << networkId << <span class="stringliteral">" because BeforeUnloadNetwork failed"</span>;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">Status::Failure</a>;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  std::lock_guard<std::mutex> lockGuard(m_Mutex);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">if</span> (m_LoadedNetworks.erase(networkId) == 0)</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"WARNING: Runtime::UnloadNetwork(): "</span> << networkId << <span class="stringliteral">" not found!"</span>;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">Status::Failure</a>;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">if</span> (<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">profiling::ProfilingService::Instance</a>().IsProfilingEnabled())</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  {</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">profiling::ProfilingService::Instance</a>().<a class="code" href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6c2d955d387944f5b7ad37ebb435a37f">IncrementCounterValue</a>(armnn::profiling::NETWORK_UNLOADS);</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  }</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& context : m_BackendContexts)</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  {</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  context.second->AfterUnloadNetwork(networkId);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407aad42f6697b035b7580e4fef93be20b4d">debug</a>) << <span class="stringliteral">"Runtime::UnloadNetwork(): Unloaded network with ID: "</span> << networkId;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">Status::Success</a>;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407aad42f6697b035b7580e4fef93be20b4d"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407aad42f6697b035b7580e4fef93be20b4d">armnn::BoostLogSeverityMapping::debug</a></div></div> |
| 723 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a6d016886de3596fe67dbabf107168f97"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6d016886de3596fe67dbabf107168f97">armnn::profiling::ProfilingService::Instance</a></div><div class="ttdeci">static ProfilingService & Instance()</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8hpp_source.xhtml#l00052">ProfilingService.hpp:52</a></div></div> |
| 724 | <div class="ttc" id="_logging_8hpp_xhtml_a7b6ad073975f437ec38ca7d20154727f"><div class="ttname"><a href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a></div><div class="ttdeci">#define ARMNN_LOG(severity)</div><div class="ttdef"><b>Definition:</b> <a href="_logging_8hpp_source.xhtml#l00163">Logging.hpp:163</a></div></div> |
| 725 | <div class="ttc" id="classarmnn_1_1profiling_1_1_profiling_service_xhtml_a6c2d955d387944f5b7ad37ebb435a37f"><div class="ttname"><a href="classarmnn_1_1profiling_1_1_profiling_service.xhtml#a6c2d955d387944f5b7ad37ebb435a37f">armnn::profiling::ProfilingService::IncrementCounterValue</a></div><div class="ttdeci">uint32_t IncrementCounterValue(uint16_t counterUid) override</div><div class="ttdef"><b>Definition:</b> <a href="_profiling_service_8cpp_source.xhtml#l00278">ProfilingService.cpp:278</a></div></div> |
| 726 | <div class="ttc" id="namespacearmnn_xhtml_a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38"><div class="ttname"><a href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70ba505a83f220c02df2f85c3810cd9ceb38">armnn::Status::Success</a></div></div> |
| 727 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 728 | <div class="ttc" id="namespacearmnn_xhtml_a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086"><div class="ttname"><a href="namespacearmnn.xhtml#a67a0db04d321a74b7e7fcfd3f1a3f70bae139a585510a502bbf1841cf589f5086">armnn::Status::Failure</a></div></div> |
| 729 | </div><!-- fragment --> |
| 730 | </div> |
| 731 | </div> |
| 732 | <h2 class="groupheader">Friends And Related Function Documentation</h2> |
| 733 | <a id="a01fa2d4db2c1b4ee5269a31e514f37ec"></a> |
| 734 | <h2 class="memtitle"><span class="permalink"><a href="#a01fa2d4db2c1b4ee5269a31e514f37ec">◆ </a></span>RuntimeLoadedNetworksReserve</h2> |
| 735 | |
| 736 | <div class="memitem"> |
| 737 | <div class="memproto"> |
| 738 | <table class="mlabels"> |
| 739 | <tr> |
| 740 | <td class="mlabels-left"> |
| 741 | <table class="memname"> |
| 742 | <tr> |
| 743 | <td class="memname">void RuntimeLoadedNetworksReserve </td> |
| 744 | <td>(</td> |
| 745 | <td class="paramtype"><a class="el" href="classarmnn_1_1_runtime.xhtml">armnn::Runtime</a> * </td> |
| 746 | <td class="paramname"><em>runtime</em></td><td>)</td> |
| 747 | <td></td> |
| 748 | </tr> |
| 749 | </table> |
| 750 | </td> |
| 751 | <td class="mlabels-right"> |
| 752 | <span class="mlabels"><span class="mlabel">friend</span></span> </td> |
| 753 | </tr> |
| 754 | </table> |
| 755 | </div><div class="memdoc"> |
| 756 | |
| 757 | <p class="definition">Definition at line <a class="el" href="_runtime_tests_8cpp_source.xhtml#l00028">28</a> of file <a class="el" href="_runtime_tests_8cpp_source.xhtml">RuntimeTests.cpp</a>.</p> |
| 758 | |
| 759 | <p class="reference">Referenced by <a class="el" href="_runtime_8hpp_source.xhtml#l00063">Runtime::GetDeviceSpec()</a>.</p> |
| 760 | <div class="fragment"><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  runtime->m_LoadedNetworks.reserve(1);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> }</div></div><!-- fragment --> |
| 761 | </div> |
| 762 | </div> |
| 763 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 764 | <li>src/armnn/<a class="el" href="_runtime_8hpp_source.xhtml">Runtime.hpp</a></li> |
| 765 | <li>src/armnn/<a class="el" href="_runtime_8cpp_source.xhtml">Runtime.cpp</a></li> |
| 766 | </ul> |
| 767 | </div><!-- contents --> |
| 768 | </div><!-- doc-content --> |
| 769 | <!-- start footer part --> |
| 770 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 771 | <ul> |
| 772 | <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_runtime.xhtml">Runtime</a></li> |
| 773 | <li class="footer">Generated on Fri Mar 13 2020 16:09:20 for ArmNN by |
| 774 | <a href="http://www.doxygen.org/index.html"> |
| 775 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 776 | </ul> |
| 777 | </div> |
| 778 | </body> |
| 779 | </html> |