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: DynamicBackendUtils 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_dynamic_backend_utils.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-static-methods">Static Public Member Functions</a> | |
| 99 | <a href="#pro-static-methods">Static Protected Member Functions</a> | |
| 100 | <a href="classarmnn_1_1_dynamic_backend_utils-members.xhtml">List of all members</a> </div> |
| 101 | <div class="headertitle"> |
| 102 | <div class="title">DynamicBackendUtils Class Reference</div> </div> |
| 103 | </div><!--header--> |
| 104 | <div class="contents"> |
| 105 | |
| 106 | <p><code>#include <<a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml">DynamicBackendUtils.hpp</a>></code></p> |
| 107 | <div class="dynheader"> |
| 108 | Inheritance diagram for DynamicBackendUtils:</div> |
| 109 | <div class="dyncontent"> |
| 110 | <div class="center"> |
| 111 | <img src="classarmnn_1_1_dynamic_backend_utils.png" usemap="#DynamicBackendUtils_map" alt=""/> |
| 112 | <map id="DynamicBackendUtils_map" name="DynamicBackendUtils_map"> |
| 113 | <area href="class_test_dynamic_backend_utils.xhtml" alt="TestDynamicBackendUtils" shape="rect" coords="0,56,156,80"/> |
| 114 | </map> |
| 115 | </div></div> |
| 116 | <table class="memberdecls"> |
| 117 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> |
| 118 | Static Public Member Functions</h2></td></tr> |
| 119 | <tr class="memitem:aed6d54e3299851dea74d4175d28ddb87"><td class="memItemLeft" align="right" valign="top">static void * </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aed6d54e3299851dea74d4175d28ddb87">OpenHandle</a> (const std::string &sharedObjectPath)</td></tr> |
| 120 | <tr class="separator:aed6d54e3299851dea74d4175d28ddb87"><td class="memSeparator" colspan="2"> </td></tr> |
| 121 | <tr class="memitem:aebd30d283660a07b4123fdb0245e8426"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aebd30d283660a07b4123fdb0245e8426">CloseHandle</a> (const void *sharedObjectHandle)</td></tr> |
| 122 | <tr class="separator:aebd30d283660a07b4123fdb0245e8426"><td class="memSeparator" colspan="2"> </td></tr> |
| 123 | <tr class="memitem:a3964c90252556ffae5242cc6a69d8b3c"><td class="memTemplParams" colspan="2">template<typename EntryPointType > </td></tr> |
| 124 | <tr class="memitem:a3964c90252556ffae5242cc6a69d8b3c"><td class="memTemplItemLeft" align="right" valign="top">static EntryPointType </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a3964c90252556ffae5242cc6a69d8b3c">GetEntryPoint</a> (const void *sharedObjectHandle, const char *symbolName)</td></tr> |
| 125 | <tr class="separator:a3964c90252556ffae5242cc6a69d8b3c"><td class="memSeparator" colspan="2"> </td></tr> |
| 126 | <tr class="memitem:a6789076aa25c6a10faeff1043359bda8"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6789076aa25c6a10faeff1043359bda8">IsBackendCompatible</a> (const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendVersion)</td></tr> |
| 127 | <tr class="separator:a6789076aa25c6a10faeff1043359bda8"><td class="memSeparator" colspan="2"> </td></tr> |
| 128 | <tr class="memitem:a6d47980f97dd4d3aab24d818f8474dce"><td class="memItemLeft" align="right" valign="top">static std::vector< std::string > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6d47980f97dd4d3aab24d818f8474dce">GetBackendPaths</a> (const std::string &overrideBackendPath="")</td></tr> |
| 129 | <tr class="separator:a6d47980f97dd4d3aab24d818f8474dce"><td class="memSeparator" colspan="2"> </td></tr> |
| 130 | <tr class="memitem:a30619dd4b86da204cb47530f40e175db"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">IsPathValid</a> (const std::string &path)</td></tr> |
| 131 | <tr class="separator:a30619dd4b86da204cb47530f40e175db"><td class="memSeparator" colspan="2"> </td></tr> |
| 132 | <tr class="memitem:a48e1fb944c3ef4086365aedcadb4c311"><td class="memItemLeft" align="right" valign="top">static std::vector< std::string > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a48e1fb944c3ef4086365aedcadb4c311">GetSharedObjects</a> (const std::vector< std::string > &backendPaths)</td></tr> |
| 133 | <tr class="separator:a48e1fb944c3ef4086365aedcadb4c311"><td class="memSeparator" colspan="2"> </td></tr> |
| 134 | <tr class="memitem:a42e250dfa19b9df3abdb273e1d35fa5b"><td class="memItemLeft" align="right" valign="top">static std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a42e250dfa19b9df3abdb273e1d35fa5b">CreateDynamicBackends</a> (const std::vector< std::string > &sharedObjects)</td></tr> |
| 135 | <tr class="separator:a42e250dfa19b9df3abdb273e1d35fa5b"><td class="memSeparator" colspan="2"> </td></tr> |
| 136 | <tr class="memitem:a55415a62bbb0a72c1a2f333501989401"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a55415a62bbb0a72c1a2f333501989401">RegisterDynamicBackends</a> (const std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > &dynamicBackends)</td></tr> |
| 137 | <tr class="separator:a55415a62bbb0a72c1a2f333501989401"><td class="memSeparator" colspan="2"> </td></tr> |
| 138 | <tr class="memitem:a7e786263f454b19c40b78c4092a4af5b"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b">DeregisterDynamicBackends</a> (const <a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> &dynamicBackends)</td></tr> |
| 139 | <tr class="separator:a7e786263f454b19c40b78c4092a4af5b"><td class="memSeparator" colspan="2"> </td></tr> |
| 140 | </table><table class="memberdecls"> |
| 141 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-methods"></a> |
| 142 | Static Protected Member Functions</h2></td></tr> |
| 143 | <tr class="memitem:aafeb709b667b8554e43d2212b7d46e48"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aafeb709b667b8554e43d2212b7d46e48">IsBackendCompatibleImpl</a> (const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendApiVersion, const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendVersion)</td></tr> |
| 144 | <tr class="memdesc:aafeb709b667b8554e43d2212b7d46e48"><td class="mdescLeft"> </td><td class="mdescRight">Protected methods for testing purposes. <a href="#aafeb709b667b8554e43d2212b7d46e48">More...</a><br /></td></tr> |
| 145 | <tr class="separator:aafeb709b667b8554e43d2212b7d46e48"><td class="memSeparator" colspan="2"> </td></tr> |
| 146 | <tr class="memitem:a5d8cade961d9ea50a19a382c974d1ce5"><td class="memItemLeft" align="right" valign="top">static std::vector< std::string > </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a5d8cade961d9ea50a19a382c974d1ce5">GetBackendPathsImpl</a> (const std::string &backendPaths)</td></tr> |
| 147 | <tr class="separator:a5d8cade961d9ea50a19a382c974d1ce5"><td class="memSeparator" colspan="2"> </td></tr> |
| 148 | <tr class="memitem:adb6f50f10cdce40bd5493d42930b58cb"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml#adb6f50f10cdce40bd5493d42930b58cb">RegisterDynamicBackendsImpl</a> (<a class="el" href="classarmnn_1_1_backend_registry.xhtml">BackendRegistry</a> &backendRegistry, const std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > &dynamicBackends)</td></tr> |
| 149 | <tr class="separator:adb6f50f10cdce40bd5493d42930b58cb"><td class="memSeparator" colspan="2"> </td></tr> |
| 150 | </table> |
| 151 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 152 | <div class="textblock"> |
| 153 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml#l00028">28</a> of file <a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml">DynamicBackendUtils.hpp</a>.</p> |
| 154 | </div><h2 class="groupheader">Member Function Documentation</h2> |
| 155 | <a id="aebd30d283660a07b4123fdb0245e8426"></a> |
| 156 | <h2 class="memtitle"><span class="permalink"><a href="#aebd30d283660a07b4123fdb0245e8426">◆ </a></span>CloseHandle()</h2> |
| 157 | |
| 158 | <div class="memitem"> |
| 159 | <div class="memproto"> |
| 160 | <table class="mlabels"> |
| 161 | <tr> |
| 162 | <td class="mlabels-left"> |
| 163 | <table class="memname"> |
| 164 | <tr> |
| 165 | <td class="memname">void CloseHandle </td> |
| 166 | <td>(</td> |
| 167 | <td class="paramtype">const void * </td> |
| 168 | <td class="paramname"><em>sharedObjectHandle</em></td><td>)</td> |
| 169 | <td></td> |
| 170 | </tr> |
| 171 | </table> |
| 172 | </td> |
| 173 | <td class="mlabels-right"> |
| 174 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 175 | </tr> |
| 176 | </table> |
| 177 | </div><div class="memdoc"> |
| 178 | |
| 179 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00037">37</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 180 | <div class="fragment"><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#if defined(__unix__)</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (!sharedObjectHandle)</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">return</span>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  dlclose(const_cast<void*>(sharedObjectHandle));</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"Dynamic backends not supported on this platform"</span>);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div></div><!-- fragment --> |
| 181 | </div> |
| 182 | </div> |
| 183 | <a id="a42e250dfa19b9df3abdb273e1d35fa5b"></a> |
| 184 | <h2 class="memtitle"><span class="permalink"><a href="#a42e250dfa19b9df3abdb273e1d35fa5b">◆ </a></span>CreateDynamicBackends()</h2> |
| 185 | |
| 186 | <div class="memitem"> |
| 187 | <div class="memproto"> |
| 188 | <table class="mlabels"> |
| 189 | <tr> |
| 190 | <td class="mlabels-left"> |
| 191 | <table class="memname"> |
| 192 | <tr> |
| 193 | <td class="memname">std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > CreateDynamicBackends </td> |
| 194 | <td>(</td> |
| 195 | <td class="paramtype">const std::vector< std::string > & </td> |
| 196 | <td class="paramname"><em>sharedObjects</em></td><td>)</td> |
| 197 | <td></td> |
| 198 | </tr> |
| 199 | </table> |
| 200 | </td> |
| 201 | <td class="mlabels-right"> |
| 202 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 203 | </tr> |
| 204 | </table> |
| 205 | </div><div class="memdoc"> |
| 206 | |
| 207 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00263">263</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 208 | |
| 209 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00017">DynamicBackendUtils::OpenHandle()</a>, <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>, and <a class="el" href="_exceptions_8cpp_source.xhtml#l00032">Exception::what()</a>.</p> |
| 210 | |
| 211 | <p class="reference">Referenced by <a class="el" href="_runtime_8cpp_source.xhtml#l00298">Runtime::RegisterDebugCallback()</a>.</p> |
| 212 | <div class="fragment"><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> {</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <span class="comment">// Create a list of dynamic backends</span></div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  std::vector<DynamicBackendPtr> dynamicBackends;</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string& sharedObject : sharedObjects)</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  {</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="comment">// Create a handle to the shared object</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordtype">void</span>* sharedObjectHandle = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  {</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  sharedObjectHandle = <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aed6d54e3299851dea74d4175d28ddb87">DynamicBackendUtils::OpenHandle</a>(sharedObject);</div><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">catch</span> (<span class="keyword">const</span> RuntimeException& e)</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  {</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot create a handle to the shared object file \""</span></div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  << sharedObject << <span class="stringliteral">"\": "</span> << e.what();</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  }</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">if</span> (!sharedObjectHandle)</div><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="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Invalid handle to the shared object file \""</span> << sharedObject << <span class="stringliteral">"\""</span>;</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="keywordflow">continue</span>;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  }</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>  <span class="comment">// Create a dynamic backend object</span></div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <a class="code" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> dynamicBackend;</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keywordflow">try</span></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>  dynamicBackend.reset(<span class="keyword">new</span> DynamicBackend(sharedObjectHandle));</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  }</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> Exception& e)</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  {</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot create a valid dynamic backend from the shared object file \""</span></div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  << sharedObject << <span class="stringliteral">"\": "</span> << e.what();</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keywordflow">continue</span>;</div><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>  <span class="keywordflow">if</span> (!dynamicBackend)</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  {</div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Invalid dynamic backend object for the shared object file \""</span></div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  << sharedObject << <span class="stringliteral">"\""</span>;</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  }</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span> </div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="comment">// Append the newly created dynamic backend to the list</span></div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  dynamicBackends.push_back(std::move(dynamicBackend));</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  }</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">return</span> dynamicBackends;</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> }</div><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> |
| 213 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_aed6d54e3299851dea74d4175d28ddb87"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#aed6d54e3299851dea74d4175d28ddb87">armnn::DynamicBackendUtils::OpenHandle</a></div><div class="ttdeci">static void * OpenHandle(const std::string &sharedObjectPath)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00017">DynamicBackendUtils.cpp:17</a></div></div> |
| 214 | <div class="ttc" id="namespacearmnn_xhtml_a754d43dc24a0fe36ecb3044d8f13a413"><div class="ttname"><a href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">armnn::DynamicBackendPtr</a></div><div class="ttdeci">std::unique_ptr< DynamicBackend > DynamicBackendPtr</div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_dynamic_backend_8hpp_source.xhtml#l00052">DynamicBackend.hpp:52</a></div></div> |
| 215 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 216 | </div><!-- fragment --> |
| 217 | </div> |
| 218 | </div> |
| 219 | <a id="a7e786263f454b19c40b78c4092a4af5b"></a> |
| 220 | <h2 class="memtitle"><span class="permalink"><a href="#a7e786263f454b19c40b78c4092a4af5b">◆ </a></span>DeregisterDynamicBackends()</h2> |
| 221 | |
| 222 | <div class="memitem"> |
| 223 | <div class="memproto"> |
| 224 | <table class="mlabels"> |
| 225 | <tr> |
| 226 | <td class="mlabels-left"> |
| 227 | <table class="memname"> |
| 228 | <tr> |
| 229 | <td class="memname">void DeregisterDynamicBackends </td> |
| 230 | <td>(</td> |
| 231 | <td class="paramtype">const <a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> & </td> |
| 232 | <td class="paramname"><em>dynamicBackends</em></td><td>)</td> |
| 233 | <td></td> |
| 234 | </tr> |
| 235 | </table> |
| 236 | </td> |
| 237 | <td class="mlabels-right"> |
| 238 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 239 | </tr> |
| 240 | </table> |
| 241 | </div><div class="memdoc"> |
| 242 | |
| 243 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00314">314</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 244 | |
| 245 | <p class="reference">References <a class="el" href="_backend_registry_8cpp_source.xhtml#l00013">armnn::BackendRegistryInstance()</a>, and <a class="el" href="_backend_registry_8cpp_source.xhtml#l00034">BackendRegistry::Deregister()</a>.</p> |
| 246 | |
| 247 | <p class="reference">Referenced by <a class="el" href="_runtime_8cpp_source.xhtml#l00216">Runtime::~Runtime()</a>.</p> |
| 248 | <div class="fragment"><div class="line"><a name="l00315"></a><span class="lineno"> 315</span> {</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="comment">// Get a reference of the backend registry</span></div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  BackendRegistry& backendRegistry = <a class="code" href="namespacearmnn.xhtml#ac2807505b850738bc8a1991ce669dd47">BackendRegistryInstance</a>();</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span> </div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>& <span class="keywordtype">id</span> : dynamicBackends)</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  {</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  backendRegistry.Deregister(<span class="keywordtype">id</span>);</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  }</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span> }</div><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> |
| 249 | </div><!-- fragment --> |
| 250 | </div> |
| 251 | </div> |
| 252 | <a id="a6d47980f97dd4d3aab24d818f8474dce"></a> |
| 253 | <h2 class="memtitle"><span class="permalink"><a href="#a6d47980f97dd4d3aab24d818f8474dce">◆ </a></span>GetBackendPaths()</h2> |
| 254 | |
| 255 | <div class="memitem"> |
| 256 | <div class="memproto"> |
| 257 | <table class="mlabels"> |
| 258 | <tr> |
| 259 | <td class="mlabels-left"> |
| 260 | <table class="memname"> |
| 261 | <tr> |
| 262 | <td class="memname">std::vector< std::string > GetBackendPaths </td> |
| 263 | <td>(</td> |
| 264 | <td class="paramtype">const std::string & </td> |
| 265 | <td class="paramname"><em>overrideBackendPath</em> = <code>""</code></td><td>)</td> |
| 266 | <td></td> |
| 267 | </tr> |
| 268 | </table> |
| 269 | </td> |
| 270 | <td class="mlabels-right"> |
| 271 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 272 | </tr> |
| 273 | </table> |
| 274 | </div><div class="memdoc"> |
| 275 | |
| 276 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00080">80</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 277 | |
| 278 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml#l00022">DYNAMIC_BACKEND_PATHS</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00102">DynamicBackendUtils::GetBackendPathsImpl()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils::IsPathValid()</a>, and <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 279 | |
| 280 | <p class="reference">Referenced by <a class="el" href="_runtime_8cpp_source.xhtml#l00298">Runtime::RegisterDebugCallback()</a>.</p> |
| 281 | <div class="fragment"><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="comment">// Check if a path where to dynamically load the backends from is given</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> (!overrideBackendPath.empty())</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>  <span class="keywordflow">if</span> (!<a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">IsPathValid</a>(overrideBackendPath))</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  {</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</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: The given override path for dynamic backends \""</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  << overrideBackendPath << <span class="stringliteral">"\" is not valid"</span>;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">return</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> </div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordflow">return</span> std::vector<std::string>{ overrideBackendPath };</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  }</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>  <span class="comment">// Expects a colon-separated list: DYNAMIC_BACKEND_PATHS="PATH_1:PATH_2:...:PATH_N"</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">const</span> std::string backendPaths = <a class="code" href="_dynamic_backend_utils_8hpp.xhtml#a6100170f71dc5f7f2558234843db82b3">DYNAMIC_BACKEND_PATHS</a>;</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>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a5d8cade961d9ea50a19a382c974d1ce5">GetBackendPathsImpl</a>(backendPaths);</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> }</div><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> |
| 282 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 283 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a30619dd4b86da204cb47530f40e175db"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">armnn::DynamicBackendUtils::IsPathValid</a></div><div class="ttdeci">static bool IsPathValid(const std::string &path)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils.cpp:145</a></div></div> |
| 284 | <div class="ttc" id="_dynamic_backend_utils_8hpp_xhtml_a6100170f71dc5f7f2558234843db82b3"><div class="ttname"><a href="_dynamic_backend_utils_8hpp.xhtml#a6100170f71dc5f7f2558234843db82b3">DYNAMIC_BACKEND_PATHS</a></div><div class="ttdeci">#define DYNAMIC_BACKEND_PATHS</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8hpp_source.xhtml#l00022">DynamicBackendUtils.hpp:22</a></div></div> |
| 285 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a5d8cade961d9ea50a19a382c974d1ce5"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a5d8cade961d9ea50a19a382c974d1ce5">armnn::DynamicBackendUtils::GetBackendPathsImpl</a></div><div class="ttdeci">static std::vector< std::string > GetBackendPathsImpl(const std::string &backendPaths)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00102">DynamicBackendUtils.cpp:102</a></div></div> |
| 286 | </div><!-- fragment --> |
| 287 | </div> |
| 288 | </div> |
| 289 | <a id="a5d8cade961d9ea50a19a382c974d1ce5"></a> |
| 290 | <h2 class="memtitle"><span class="permalink"><a href="#a5d8cade961d9ea50a19a382c974d1ce5">◆ </a></span>GetBackendPathsImpl()</h2> |
| 291 | |
| 292 | <div class="memitem"> |
| 293 | <div class="memproto"> |
| 294 | <table class="mlabels"> |
| 295 | <tr> |
| 296 | <td class="mlabels-left"> |
| 297 | <table class="memname"> |
| 298 | <tr> |
| 299 | <td class="memname">std::vector< std::string > GetBackendPathsImpl </td> |
| 300 | <td>(</td> |
| 301 | <td class="paramtype">const std::string & </td> |
| 302 | <td class="paramname"><em>backendPaths</em></td><td>)</td> |
| 303 | <td></td> |
| 304 | </tr> |
| 305 | </table> |
| 306 | </td> |
| 307 | <td class="mlabels-right"> |
| 308 | <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td> |
| 309 | </tr> |
| 310 | </table> |
| 311 | </div><div class="memdoc"> |
| 312 | |
| 313 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00102">102</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 314 | |
| 315 | <p class="reference">References <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils::IsPathValid()</a>.</p> |
| 316 | |
| 317 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00080">DynamicBackendUtils::GetBackendPaths()</a>, and <a class="el" href="_dynamic_backend_tests_8hpp_source.xhtml#l00077">TestDynamicBackendUtils::GetBackendPathsImplTest()</a>.</p> |
| 318 | <div class="fragment"><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="comment">// Check if there's any path to process at all</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">if</span> (backendPaths.empty())</div><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="comment">// Silently return without issuing a warning as no paths have been passed, so</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment">// the whole dynamic backend loading feature can be considered as disabled</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">return</span> {};</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</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>  std::unordered_set<std::string> uniqueBackendPaths;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  std::vector<std::string> tempBackendPaths;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  std::vector<std::string> validBackendPaths;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="comment">// Split the given list of paths</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  boost::split(tempBackendPaths, backendPaths, boost::is_any_of(<span class="stringliteral">":"</span>));</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>  <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string& path : tempBackendPaths)</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>  <span class="comment">// Check whether the path is valid</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">if</span> (!<a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">IsPathValid</a>(path))</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  {</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="comment">// Check whether the path is a duplicate</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keyword">auto</span> it = uniqueBackendPaths.find(path);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">if</span> (it != uniqueBackendPaths.end())</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="comment">// The path is a duplicate</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">continue</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> </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// Add the path to the set of unique paths</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  uniqueBackendPaths.insert(path);</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>  <span class="comment">// Add the path to the list of valid paths</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  validBackendPaths.push_back(path);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">return</span> validBackendPaths;</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> }</div><div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a30619dd4b86da204cb47530f40e175db"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">armnn::DynamicBackendUtils::IsPathValid</a></div><div class="ttdeci">static bool IsPathValid(const std::string &path)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils.cpp:145</a></div></div> |
| 319 | </div><!-- fragment --> |
| 320 | </div> |
| 321 | </div> |
| 322 | <a id="a3964c90252556ffae5242cc6a69d8b3c"></a> |
| 323 | <h2 class="memtitle"><span class="permalink"><a href="#a3964c90252556ffae5242cc6a69d8b3c">◆ </a></span>GetEntryPoint()</h2> |
| 324 | |
| 325 | <div class="memitem"> |
| 326 | <div class="memproto"> |
| 327 | <table class="mlabels"> |
| 328 | <tr> |
| 329 | <td class="mlabels-left"> |
| 330 | <table class="memname"> |
| 331 | <tr> |
| 332 | <td class="memname">EntryPointType GetEntryPoint </td> |
| 333 | <td>(</td> |
| 334 | <td class="paramtype">const void * </td> |
| 335 | <td class="paramname"><em>sharedObjectHandle</em>, </td> |
| 336 | </tr> |
| 337 | <tr> |
| 338 | <td class="paramkey"></td> |
| 339 | <td></td> |
| 340 | <td class="paramtype">const char * </td> |
| 341 | <td class="paramname"><em>symbolName</em> </td> |
| 342 | </tr> |
| 343 | <tr> |
| 344 | <td></td> |
| 345 | <td>)</td> |
| 346 | <td></td><td></td> |
| 347 | </tr> |
| 348 | </table> |
| 349 | </td> |
| 350 | <td class="mlabels-right"> |
| 351 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 352 | </tr> |
| 353 | </table> |
| 354 | </div><div class="memdoc"> |
| 355 | |
| 356 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml#l00062">62</a> of file <a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml">DynamicBackendUtils.hpp</a>.</p> |
| 357 | <div class="fragment"><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor">#if defined(__unix__)</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">if</span> (sharedObjectHandle == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  {</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"GetEntryPoint error: invalid handle"</span>);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  }</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">if</span> (symbolName == <span class="keyword">nullptr</span>)</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>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"GetEntryPoint error: invalid symbol"</span>);</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>  <span class="keyword">auto</span> entryPoint = <span class="keyword">reinterpret_cast<</span>EntryPointType<span class="keyword">></span>(dlsym(const_cast<void*>(sharedObjectHandle), symbolName));</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">if</span> (!entryPoint)</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keywordflow">throw</span> RuntimeException(boost::str(boost::format(<span class="stringliteral">"GetEntryPoint error: %1%"</span>) % GetDlError()));</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> </div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">return</span> entryPoint;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"Dynamic backends not supported on this platform"</span>);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> }</div></div><!-- fragment --> |
| 358 | </div> |
| 359 | </div> |
| 360 | <a id="a48e1fb944c3ef4086365aedcadb4c311"></a> |
| 361 | <h2 class="memtitle"><span class="permalink"><a href="#a48e1fb944c3ef4086365aedcadb4c311">◆ </a></span>GetSharedObjects()</h2> |
| 362 | |
| 363 | <div class="memitem"> |
| 364 | <div class="memproto"> |
| 365 | <table class="mlabels"> |
| 366 | <tr> |
| 367 | <td class="mlabels-left"> |
| 368 | <table class="memname"> |
| 369 | <tr> |
| 370 | <td class="memname">std::vector< std::string > GetSharedObjects </td> |
| 371 | <td>(</td> |
| 372 | <td class="paramtype">const std::vector< std::string > & </td> |
| 373 | <td class="paramname"><em>backendPaths</em></td><td>)</td> |
| 374 | <td></td> |
| 375 | </tr> |
| 376 | </table> |
| 377 | </td> |
| 378 | <td class="mlabels-right"> |
| 379 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 380 | </tr> |
| 381 | </table> |
| 382 | </div><div class="memdoc"> |
| 383 | |
| 384 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00176">176</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 385 | |
| 386 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils::IsPathValid()</a>, and <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 387 | |
| 388 | <p class="reference">Referenced by <a class="el" href="_runtime_8cpp_source.xhtml#l00298">Runtime::RegisterDebugCallback()</a>.</p> |
| 389 | <div class="fragment"><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>  std::unordered_set<std::string> uniqueSharedObjects;</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  std::vector<std::string> sharedObjects;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> </div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string& backendPath : backendPaths)</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keyword">using namespace </span>boost::filesystem;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> </div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="comment">// Check if the path is valid. In case of error, IsValidPath will log an error message</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">if</span> (!<a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">IsPathValid</a>(backendPath))</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  {</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">continue</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> </div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="comment">// Get all the files in the current path in alphabetical order</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  std::vector<path> backendPathFiles;</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  std::copy(directory_iterator(backendPath), directory_iterator(), std::back_inserter(backendPathFiles));</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  std::sort(backendPathFiles.begin(), backendPathFiles.end());</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="comment">// Go through all the files in the current backend path</span></div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> path& backendPathFile : backendPathFiles)</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  {</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">// Get only the name of the file (without the full path)</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  std::string filename = backendPathFile.filename().string();</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> </div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keywordflow">if</span> (filename.empty())</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  {</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="comment">// Empty filename</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  <span class="keywordflow">continue</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> </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  path canonicalPath;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">try</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>  <span class="comment">// Get the canonical path for the current file, it will throw if for example the file is a</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="comment">// symlink that cannot be resolved</span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  canonicalPath = canonical(backendPathFile);</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  }</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> filesystem_error& e)</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  {</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"GetSharedObjects warning: "</span> << e.what();</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  }</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">if</span> (canonicalPath.empty())</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">// No such file or perhaps a symlink that couldn't be resolved</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  }</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="comment">// Check if the current filename matches the expected naming convention</span></div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="comment">// The expected format is: <vendor>_<name>_backend.so[<version>]</span></div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="comment">// e.g. "Arm_GpuAcc_backend.so" or "Arm_GpuAcc_backend.so.1.2"</span></div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keyword">const</span> std::regex dynamicBackendRegex(<span class="stringliteral">"^[a-zA-Z0-9]+_[a-zA-Z0-9]+_backend.so(\\.[0-9]+)*$"</span>);</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> </div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordtype">bool</span> filenameMatch = <span class="keyword">false</span>;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  {</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="comment">// Match the filename to the expected naming scheme</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  filenameMatch = std::regex_match(filename, dynamicBackendRegex);</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> std::exception& e)</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  {</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"GetSharedObjects warning: "</span> << e.what();</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  }</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="keywordflow">if</span> (!filenameMatch)</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  {</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="comment">// Filename does not match the expected naming scheme (or an error has occurred)</span></div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="keywordflow">continue</span>;</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> </div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="comment">// Append the valid canonical path to the output list only if it's not a duplicate</span></div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  std::string validCanonicalPath = canonicalPath.string();</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keyword">auto</span> it = uniqueSharedObjects.find(validCanonicalPath);</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">if</span> (it == uniqueSharedObjects.end())</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">// Not a duplicate, append the canonical path to the output list</span></div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  sharedObjects.push_back(validCanonicalPath);</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>  <span class="comment">// Add the canonical path to the collection of unique shared objects</span></div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  uniqueSharedObjects.insert(validCanonicalPath);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  }</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  }</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span> </div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordflow">return</span> sharedObjects;</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> }</div><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> |
| 390 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 391 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a30619dd4b86da204cb47530f40e175db"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">armnn::DynamicBackendUtils::IsPathValid</a></div><div class="ttdeci">static bool IsPathValid(const std::string &path)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">DynamicBackendUtils.cpp:145</a></div></div> |
| 392 | </div><!-- fragment --> |
| 393 | </div> |
| 394 | </div> |
| 395 | <a id="a6789076aa25c6a10faeff1043359bda8"></a> |
| 396 | <h2 class="memtitle"><span class="permalink"><a href="#a6789076aa25c6a10faeff1043359bda8">◆ </a></span>IsBackendCompatible()</h2> |
| 397 | |
| 398 | <div class="memitem"> |
| 399 | <div class="memproto"> |
| 400 | <table class="mlabels"> |
| 401 | <tr> |
| 402 | <td class="mlabels-left"> |
| 403 | <table class="memname"> |
| 404 | <tr> |
| 405 | <td class="memname">bool IsBackendCompatible </td> |
| 406 | <td>(</td> |
| 407 | <td class="paramtype">const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> & </td> |
| 408 | <td class="paramname"><em>backendVersion</em></td><td>)</td> |
| 409 | <td></td> |
| 410 | </tr> |
| 411 | </table> |
| 412 | </td> |
| 413 | <td class="mlabels-right"> |
| 414 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 415 | </tr> |
| 416 | </table> |
| 417 | </div><div class="memdoc"> |
| 418 | |
| 419 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00051">51</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 420 | |
| 421 | <p class="reference">References <a class="el" href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00149">IBackendInternal::GetApiVersion()</a>, and <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00058">DynamicBackendUtils::IsBackendCompatibleImpl()</a>.</p> |
| 422 | |
| 423 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_8cpp_source.xhtml#l00012">DynamicBackend::DynamicBackend()</a>.</p> |
| 424 | <div class="fragment"><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> {</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  BackendVersion backendApiVersion = <a class="code" href="classarmnn_1_1_i_backend_internal.xhtml#a878b8f50d8a2f92ed624803e9f6968ae">IBackendInternal::GetApiVersion</a>();</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aafeb709b667b8554e43d2212b7d46e48">IsBackendCompatibleImpl</a>(backendApiVersion, backendVersion);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="ttc" id="classarmnn_1_1_i_backend_internal_xhtml_a878b8f50d8a2f92ed624803e9f6968ae"><div class="ttname"><a href="classarmnn_1_1_i_backend_internal.xhtml#a878b8f50d8a2f92ed624803e9f6968ae">armnn::IBackendInternal::GetApiVersion</a></div><div class="ttdeci">static constexpr BackendVersion GetApiVersion()</div><div class="ttdoc">Returns the version of the Backend API. </div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00149">IBackendInternal.hpp:149</a></div></div> |
| 425 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_aafeb709b667b8554e43d2212b7d46e48"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#aafeb709b667b8554e43d2212b7d46e48">armnn::DynamicBackendUtils::IsBackendCompatibleImpl</a></div><div class="ttdeci">static bool IsBackendCompatibleImpl(const BackendVersion &backendApiVersion, const BackendVersion &backendVersion)</div><div class="ttdoc">Protected methods for testing purposes. </div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00058">DynamicBackendUtils.cpp:58</a></div></div> |
| 426 | </div><!-- fragment --> |
| 427 | </div> |
| 428 | </div> |
| 429 | <a id="aafeb709b667b8554e43d2212b7d46e48"></a> |
| 430 | <h2 class="memtitle"><span class="permalink"><a href="#aafeb709b667b8554e43d2212b7d46e48">◆ </a></span>IsBackendCompatibleImpl()</h2> |
| 431 | |
| 432 | <div class="memitem"> |
| 433 | <div class="memproto"> |
| 434 | <table class="mlabels"> |
| 435 | <tr> |
| 436 | <td class="mlabels-left"> |
| 437 | <table class="memname"> |
| 438 | <tr> |
| 439 | <td class="memname">bool IsBackendCompatibleImpl </td> |
| 440 | <td>(</td> |
| 441 | <td class="paramtype">const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> & </td> |
| 442 | <td class="paramname"><em>backendApiVersion</em>, </td> |
| 443 | </tr> |
| 444 | <tr> |
| 445 | <td class="paramkey"></td> |
| 446 | <td></td> |
| 447 | <td class="paramtype">const <a class="el" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> & </td> |
| 448 | <td class="paramname"><em>backendVersion</em> </td> |
| 449 | </tr> |
| 450 | <tr> |
| 451 | <td></td> |
| 452 | <td>)</td> |
| 453 | <td></td><td></td> |
| 454 | </tr> |
| 455 | </table> |
| 456 | </td> |
| 457 | <td class="mlabels-right"> |
| 458 | <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td> |
| 459 | </tr> |
| 460 | </table> |
| 461 | </div><div class="memdoc"> |
| 462 | |
| 463 | <p>Protected methods for testing purposes. </p> |
| 464 | |
| 465 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00058">58</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 466 | |
| 467 | <p class="reference">References <a class="el" href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00034">BackendVersion::m_Major</a>, and <a class="el" href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00035">BackendVersion::m_Minor</a>.</p> |
| 468 | |
| 469 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00051">DynamicBackendUtils::IsBackendCompatible()</a>, and <a class="el" href="_dynamic_backend_tests_8hpp_source.xhtml#l00071">TestDynamicBackendUtils::IsBackendCompatibleTest()</a>.</p> |
| 470 | <div class="fragment"><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> {</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">return</span> backendVersion.m_Major == backendApiVersion.m_Major &&</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  backendVersion.m_Minor <= backendApiVersion.m_Minor;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> }</div></div><!-- fragment --> |
| 471 | </div> |
| 472 | </div> |
| 473 | <a id="a30619dd4b86da204cb47530f40e175db"></a> |
| 474 | <h2 class="memtitle"><span class="permalink"><a href="#a30619dd4b86da204cb47530f40e175db">◆ </a></span>IsPathValid()</h2> |
| 475 | |
| 476 | <div class="memitem"> |
| 477 | <div class="memproto"> |
| 478 | <table class="mlabels"> |
| 479 | <tr> |
| 480 | <td class="mlabels-left"> |
| 481 | <table class="memname"> |
| 482 | <tr> |
| 483 | <td class="memname">bool IsPathValid </td> |
| 484 | <td>(</td> |
| 485 | <td class="paramtype">const std::string & </td> |
| 486 | <td class="paramname"><em>path</em></td><td>)</td> |
| 487 | <td></td> |
| 488 | </tr> |
| 489 | </table> |
| 490 | </td> |
| 491 | <td class="mlabels-right"> |
| 492 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 493 | </tr> |
| 494 | </table> |
| 495 | </div><div class="memdoc"> |
| 496 | |
| 497 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00145">145</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 498 | |
| 499 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, and <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>.</p> |
| 500 | |
| 501 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00080">DynamicBackendUtils::GetBackendPaths()</a>, <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00102">DynamicBackendUtils::GetBackendPathsImpl()</a>, and <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00176">DynamicBackendUtils::GetSharedObjects()</a>.</p> |
| 502 | <div class="fragment"><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">if</span> (path.empty())</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  {</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</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: The given backend path is empty"</span>;</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">return</span> <span class="keyword">false</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> </div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  boost::filesystem::path boostPath(path);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> </div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">if</span> (!boost::filesystem::exists(boostPath))</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  {</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</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: The given backend path \""</span> << path << <span class="stringliteral">"\" does not exist"</span>;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">return</span> <span class="keyword">false</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> </div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">if</span> (!boost::filesystem::is_directory(boostPath))</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>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"WARNING: The given backend path \""</span> << path << <span class="stringliteral">"\" is not a directory"</span>;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  }</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>  <span class="keywordflow">if</span> (!boostPath.is_absolute())</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</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: The given backend path \""</span> << path << <span class="stringliteral">"\" is not absolute"</span>;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  }</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> </div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> }</div><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> |
| 503 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 504 | </div><!-- fragment --> |
| 505 | </div> |
| 506 | </div> |
| 507 | <a id="aed6d54e3299851dea74d4175d28ddb87"></a> |
| 508 | <h2 class="memtitle"><span class="permalink"><a href="#aed6d54e3299851dea74d4175d28ddb87">◆ </a></span>OpenHandle()</h2> |
| 509 | |
| 510 | <div class="memitem"> |
| 511 | <div class="memproto"> |
| 512 | <table class="mlabels"> |
| 513 | <tr> |
| 514 | <td class="mlabels-left"> |
| 515 | <table class="memname"> |
| 516 | <tr> |
| 517 | <td class="memname">void * OpenHandle </td> |
| 518 | <td>(</td> |
| 519 | <td class="paramtype">const std::string & </td> |
| 520 | <td class="paramname"><em>sharedObjectPath</em></td><td>)</td> |
| 521 | <td></td> |
| 522 | </tr> |
| 523 | </table> |
| 524 | </td> |
| 525 | <td class="mlabels-right"> |
| 526 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 527 | </tr> |
| 528 | </table> |
| 529 | </div><div class="memdoc"> |
| 530 | |
| 531 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00017">17</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 532 | |
| 533 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00263">DynamicBackendUtils::CreateDynamicBackends()</a>.</p> |
| 534 | <div class="fragment"><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#if defined(__unix__)</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="keywordflow">if</span> (sharedObjectPath.empty())</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  {</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"OpenHandle error: shared object path must not be empty"</span>);</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  }</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keywordtype">void</span>* sharedObjectHandle = dlopen(sharedObjectPath.c_str(), RTLD_LAZY);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keywordflow">if</span> (!sharedObjectHandle)</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="keywordflow">throw</span> RuntimeException(boost::str(boost::format(<span class="stringliteral">"OpenHandle error: %1%"</span>) % GetDlError()));</div><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> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordflow">return</span> sharedObjectHandle;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordflow">throw</span> RuntimeException(<span class="stringliteral">"Dynamic backends not supported on this platform"</span>);</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> }</div></div><!-- fragment --> |
| 535 | </div> |
| 536 | </div> |
| 537 | <a id="a55415a62bbb0a72c1a2f333501989401"></a> |
| 538 | <h2 class="memtitle"><span class="permalink"><a href="#a55415a62bbb0a72c1a2f333501989401">◆ </a></span>RegisterDynamicBackends()</h2> |
| 539 | |
| 540 | <div class="memitem"> |
| 541 | <div class="memproto"> |
| 542 | <table class="mlabels"> |
| 543 | <tr> |
| 544 | <td class="mlabels-left"> |
| 545 | <table class="memname"> |
| 546 | <tr> |
| 547 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> RegisterDynamicBackends </td> |
| 548 | <td>(</td> |
| 549 | <td class="paramtype">const std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > & </td> |
| 550 | <td class="paramname"><em>dynamicBackends</em></td><td>)</td> |
| 551 | <td></td> |
| 552 | </tr> |
| 553 | </table> |
| 554 | </td> |
| 555 | <td class="mlabels-right"> |
| 556 | <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| 557 | </tr> |
| 558 | </table> |
| 559 | </div><div class="memdoc"> |
| 560 | |
| 561 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00326">326</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 562 | |
| 563 | <p class="reference">References <a class="el" href="_backend_registry_8cpp_source.xhtml#l00013">armnn::BackendRegistryInstance()</a>, and <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00335">DynamicBackendUtils::RegisterDynamicBackendsImpl()</a>.</p> |
| 564 | |
| 565 | <p class="reference">Referenced by <a class="el" href="_runtime_8cpp_source.xhtml#l00298">Runtime::RegisterDebugCallback()</a>.</p> |
| 566 | <div class="fragment"><div class="line"><a name="l00327"></a><span class="lineno"> 327</span> {</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="comment">// Get a reference of the backend registry</span></div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  BackendRegistry& backendRegistry = <a class="code" href="namespacearmnn.xhtml#ac2807505b850738bc8a1991ce669dd47">BackendRegistryInstance</a>();</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span> </div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="comment">// Register the dynamic backends in the backend registry, and return a list of registered backend ids</span></div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#adb6f50f10cdce40bd5493d42930b58cb">RegisterDynamicBackendsImpl</a>(backendRegistry, dynamicBackends);</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span> }</div><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> |
| 567 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_adb6f50f10cdce40bd5493d42930b58cb"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#adb6f50f10cdce40bd5493d42930b58cb">armnn::DynamicBackendUtils::RegisterDynamicBackendsImpl</a></div><div class="ttdeci">static BackendIdSet RegisterDynamicBackendsImpl(BackendRegistry &backendRegistry, const std::vector< DynamicBackendPtr > &dynamicBackends)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00335">DynamicBackendUtils.cpp:335</a></div></div> |
| 568 | </div><!-- fragment --> |
| 569 | </div> |
| 570 | </div> |
| 571 | <a id="adb6f50f10cdce40bd5493d42930b58cb"></a> |
| 572 | <h2 class="memtitle"><span class="permalink"><a href="#adb6f50f10cdce40bd5493d42930b58cb">◆ </a></span>RegisterDynamicBackendsImpl()</h2> |
| 573 | |
| 574 | <div class="memitem"> |
| 575 | <div class="memproto"> |
| 576 | <table class="mlabels"> |
| 577 | <tr> |
| 578 | <td class="mlabels-left"> |
| 579 | <table class="memname"> |
| 580 | <tr> |
| 581 | <td class="memname"><a class="el" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> RegisterDynamicBackendsImpl </td> |
| 582 | <td>(</td> |
| 583 | <td class="paramtype"><a class="el" href="classarmnn_1_1_backend_registry.xhtml">BackendRegistry</a> & </td> |
| 584 | <td class="paramname"><em>backendRegistry</em>, </td> |
| 585 | </tr> |
| 586 | <tr> |
| 587 | <td class="paramkey"></td> |
| 588 | <td></td> |
| 589 | <td class="paramtype">const std::vector< <a class="el" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a> > & </td> |
| 590 | <td class="paramname"><em>dynamicBackends</em> </td> |
| 591 | </tr> |
| 592 | <tr> |
| 593 | <td></td> |
| 594 | <td>)</td> |
| 595 | <td></td><td></td> |
| 596 | </tr> |
| 597 | </table> |
| 598 | </td> |
| 599 | <td class="mlabels-right"> |
| 600 | <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">protected</span></span> </td> |
| 601 | </tr> |
| 602 | </table> |
| 603 | </div><div class="memdoc"> |
| 604 | |
| 605 | <p class="definition">Definition at line <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00335">335</a> of file <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a>.</p> |
| 606 | |
| 607 | <p class="reference">References <a class="el" href="_logging_8hpp_source.xhtml#l00163">ARMNN_LOG</a>, <a class="el" href="_backend_registry_8cpp_source.xhtml#l00043">BackendRegistry::IsBackendRegistered()</a>, <a class="el" href="_backend_id_8hpp_source.xhtml#l00138">BackendId::IsEmpty()</a>, <a class="el" href="_backend_id_8hpp_source.xhtml#l00139">BackendId::IsUndefined()</a>, <a class="el" href="_backend_registry_8cpp_source.xhtml#l00019">BackendRegistry::Register()</a>, <a class="el" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::warning</a>, and <a class="el" href="_exceptions_8cpp_source.xhtml#l00032">Exception::what()</a>.</p> |
| 608 | |
| 609 | <p class="reference">Referenced by <a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml#l00326">DynamicBackendUtils::RegisterDynamicBackends()</a>, and <a class="el" href="_dynamic_backend_tests_8hpp_source.xhtml#l00082">TestDynamicBackendUtils::RegisterDynamicBackendsImplTest()</a>.</p> |
| 610 | <div class="fragment"><div class="line"><a name="l00337"></a><span class="lineno"> 337</span> {</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  <span class="comment">// Initialize the list of registered backend ids</span></div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <a class="code" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> registeredBackendIds;</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="comment">// Register the dynamic backends in the backend registry</span></div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">DynamicBackendPtr</a>& dynamicBackend : dynamicBackends)</div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  {</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="comment">// Get the id of the dynamic backend</span></div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  BackendId dynamicBackendId;</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  {</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  dynamicBackendId = dynamicBackend->GetBackendId();</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  }</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> RuntimeException& e)</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  {</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot register dynamic backend, "</span></div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  << <span class="stringliteral">"an error has occurred when getting the backend id: "</span> << e.what();</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  }</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="keywordflow">if</span> (dynamicBackendId.IsEmpty() ||</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  dynamicBackendId.IsUndefined())</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  {</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot register dynamic backend, invalid backend id: "</span> << dynamicBackendId;</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  }</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span> </div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="comment">// Check whether the dynamic backend is already registered</span></div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keywordtype">bool</span> backendAlreadyRegistered = backendRegistry.IsBackendRegistered(dynamicBackendId);</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keywordflow">if</span> (backendAlreadyRegistered)</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  {</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot register dynamic backend \""</span> << dynamicBackendId</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  << <span class="stringliteral">"\": backend already registered"</span>;</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  }</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span> </div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="comment">// Get the dynamic backend factory function</span></div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <a class="code" href="classarmnn_1_1_backend_registry.xhtml#aa33ac375677ee8436456a585dd6f68d9">BackendRegistry::FactoryFunction</a> dynamicBackendFactoryFunction = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  {</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  dynamicBackendFactoryFunction = dynamicBackend->GetFactoryFunction();</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  }</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> RuntimeException& e)</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  {</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot register dynamic backend \""</span> << dynamicBackendId</div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  << <span class="stringliteral">"\": an error has occurred when getting the backend factory function: "</span></div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  << e.what();</div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  }</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="keywordflow">if</span> (dynamicBackendFactoryFunction == <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  {</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"Cannot register dynamic backend \""</span> << dynamicBackendId</div><div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  << <span class="stringliteral">"\": invalid backend factory function"</span>;</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  }</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span> </div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="comment">// Register the dynamic backend</span></div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="keywordflow">try</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  {</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  backendRegistry.Register(dynamicBackendId, dynamicBackendFactoryFunction);</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  }</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="keywordflow">catch</span> (<span class="keyword">const</span> InvalidArgumentException& e)</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  {</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <a class="code" href="_logging_8hpp.xhtml#a7b6ad073975f437ec38ca7d20154727f">ARMNN_LOG</a>(<a class="code" href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">warning</a>) << <span class="stringliteral">"An error has occurred when registering the dynamic backend \""</span></div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  << dynamicBackendId << <span class="stringliteral">"\": "</span> << e.what();</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keywordflow">continue</span>;</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  }</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span> </div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="comment">// Add the id of the dynamic backend just registered to the list of registered backend ids</span></div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  registeredBackendIds.insert(dynamicBackendId);</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  }</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span> </div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="keywordflow">return</span> registeredBackendIds;</div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span> }</div><div class="ttc" id="classarmnn_1_1_backend_registry_xhtml_aa33ac375677ee8436456a585dd6f68d9"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml#aa33ac375677ee8436456a585dd6f68d9">armnn::BackendRegistry::FactoryFunction</a></div><div class="ttdeci">std::function< PointerType()> FactoryFunction</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8hpp_source.xhtml#l00024">BackendRegistry.hpp:24</a></div></div> |
| 611 | <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> |
| 612 | <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> |
| 613 | <div class="ttc" id="namespacearmnn_xhtml_a754d43dc24a0fe36ecb3044d8f13a413"><div class="ttname"><a href="namespacearmnn.xhtml#a754d43dc24a0fe36ecb3044d8f13a413">armnn::DynamicBackendPtr</a></div><div class="ttdeci">std::unique_ptr< DynamicBackend > DynamicBackendPtr</div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_dynamic_backend_8hpp_source.xhtml#l00052">DynamicBackend.hpp:52</a></div></div> |
| 614 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 615 | </div><!-- fragment --> |
| 616 | </div> |
| 617 | </div> |
| 618 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 619 | <li>src/backends/backendsCommon/<a class="el" href="_dynamic_backend_utils_8hpp_source.xhtml">DynamicBackendUtils.hpp</a></li> |
| 620 | <li>src/backends/backendsCommon/<a class="el" href="_dynamic_backend_utils_8cpp_source.xhtml">DynamicBackendUtils.cpp</a></li> |
| 621 | </ul> |
| 622 | </div><!-- contents --> |
| 623 | </div><!-- doc-content --> |
| 624 | <!-- start footer part --> |
| 625 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 626 | <ul> |
| 627 | <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_dynamic_backend_utils.xhtml">DynamicBackendUtils</a></li> |
| 628 | <li class="footer">Generated on Fri Mar 13 2020 16:09:17 for ArmNN by |
| 629 | <a href="http://www.doxygen.org/index.html"> |
| 630 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 631 | </ul> |
| 632 | </div> |
| 633 | </body> |
| 634 | </html> |