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: src/backends/backendsCommon/DynamicBackendUtils.cpp Source File</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('_dynamic_backend_utils_8cpp_source.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="headertitle"> |
| 98 | <div class="title">DynamicBackendUtils.cpp</div> </div> |
| 99 | </div><!--header--> |
| 100 | <div class="contents"> |
| 101 | <a href="_dynamic_backend_utils_8cpp.xhtml">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Copyright © 2017 Arm Ltd. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <<a class="code" href="_logging_8hpp.xhtml">armnn/Logging.hpp</a>></span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <<a class="code" href="_dynamic_backend_utils_8hpp.xhtml">backendsCommon/DynamicBackendUtils.hpp</a>></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include <boost/filesystem.hpp></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <boost/algorithm/string.hpp></span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <regex></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">namespace </span><a class="code" href="namespacearmnn.xhtml">armnn</a></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> {</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aed6d54e3299851dea74d4175d28ddb87"> 17</a></span> <span class="keywordtype">void</span>* <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aed6d54e3299851dea74d4175d28ddb87">DynamicBackendUtils::OpenHandle</a>(<span class="keyword">const</span> std::string& sharedObjectPath)</div><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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>(<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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>(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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>(<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 class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aebd30d283660a07b4123fdb0245e8426"> 37</a></span> <span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aebd30d283660a07b4123fdb0245e8426">DynamicBackendUtils::CloseHandle</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* sharedObjectHandle)</div><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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>(<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 class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6789076aa25c6a10faeff1043359bda8"> 51</a></span> <span class="keywordtype">bool</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6789076aa25c6a10faeff1043359bda8">DynamicBackendUtils::IsBackendCompatible</a>(<span class="keyword">const</span> <a class="code" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendVersion)</div><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>  <a class="code" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> 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="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aafeb709b667b8554e43d2212b7d46e48"> 58</a></span> <span class="keywordtype">bool</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#aafeb709b667b8554e43d2212b7d46e48">DynamicBackendUtils::IsBackendCompatibleImpl</a>(<span class="keyword">const</span> <a class="code" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendApiVersion,</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">const</span> <a class="code" href="structarmnn_1_1_backend_version.xhtml">BackendVersion</a> &backendVersion)</div><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.<a class="code" href="structarmnn_1_1_backend_version.xhtml#aa98a6e78930567c2d9cdcf320eaddb7a">m_Major</a> == backendApiVersion.<a class="code" href="structarmnn_1_1_backend_version.xhtml#aa98a6e78930567c2d9cdcf320eaddb7a">m_Major</a> &&</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  backendVersion.<a class="code" href="structarmnn_1_1_backend_version.xhtml#a421dbc9bee3ebd2721de5c82e6cd7d20">m_Minor</a> <= backendApiVersion.<a class="code" href="structarmnn_1_1_backend_version.xhtml#a421dbc9bee3ebd2721de5c82e6cd7d20">m_Minor</a>;</div><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> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> std::string DynamicBackendUtils::GetDlError()</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="preprocessor">#if defined(__unix__)</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* errorMessage = dlerror();</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="keywordflow">if</span> (!errorMessage)</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  {</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordflow">return</span> <span class="stringliteral">""</span>;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</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>  <span class="keywordflow">return</span> std::string(errorMessage);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>(<span class="stringliteral">"Dynamic backends not supported on this platform"</span>);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6d47980f97dd4d3aab24d818f8474dce"> 80</a></span> std::vector<std::string> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6d47980f97dd4d3aab24d818f8474dce">DynamicBackendUtils::GetBackendPaths</a>(<span class="keyword">const</span> std::string& overrideBackendPath)</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <span class="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="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a5d8cade961d9ea50a19a382c974d1ce5"> 102</a></span> std::vector<std::string> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a5d8cade961d9ea50a19a382c974d1ce5">DynamicBackendUtils::GetBackendPathsImpl</a>(<span class="keyword">const</span> std::string& backendPaths)</div><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="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db"> 145</a></span> <span class="keywordtype">bool</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a30619dd4b86da204cb47530f40e175db">DynamicBackendUtils::IsPathValid</a>(<span class="keyword">const</span> std::string& path)</div><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="line"><a name="l00175"></a><span class="lineno"> 175</span> </div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a48e1fb944c3ef4086365aedcadb4c311"> 176</a></span> std::vector<std::string> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a48e1fb944c3ef4086365aedcadb4c311">DynamicBackendUtils::GetSharedObjects</a>(<span class="keyword">const</span> std::vector<std::string>& backendPaths)</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> {</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  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="line"><a name="l00262"></a><span class="lineno"> 262</span> </div><div class="line"><a name="l00263"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a42e250dfa19b9df3abdb273e1d35fa5b"> 263</a></span> std::vector<DynamicBackendPtr> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a42e250dfa19b9df3abdb273e1d35fa5b">DynamicBackendUtils::CreateDynamicBackends</a>(<span class="keyword">const</span> std::vector<std::string>& sharedObjects)</div><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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>& 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.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</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> <a class="code" href="classarmnn_1_1_dynamic_backend.xhtml">DynamicBackend</a>(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> <a class="code" href="classarmnn_1_1_exception.xhtml">Exception</a>& 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.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</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="line"><a name="l00313"></a><span class="lineno"> 313</span> </div><div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b"> 314</a></span> <span class="keywordtype">void</span> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b">DynamicBackendUtils::DeregisterDynamicBackends</a>(<span class="keyword">const</span> <a class="code" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a>& dynamicBackends)</div><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>  <a class="code" href="classarmnn_1_1_backend_registry.xhtml">BackendRegistry</a>& 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.<a class="code" href="classarmnn_1_1_backend_registry.xhtml#a41895cd60f4b1bfd0b88571a8773ff1c">Deregister</a>(<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="line"><a name="l00325"></a><span class="lineno"> 325</span> </div><div class="line"><a name="l00326"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a55415a62bbb0a72c1a2f333501989401"> 326</a></span> <a class="code" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#a55415a62bbb0a72c1a2f333501989401">DynamicBackendUtils::RegisterDynamicBackends</a>(<span class="keyword">const</span> std::vector<DynamicBackendPtr>& dynamicBackends)</div><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>  <a class="code" href="classarmnn_1_1_backend_registry.xhtml">BackendRegistry</a>& 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="line"><a name="l00334"></a><span class="lineno"> 334</span> </div><div class="line"><a name="l00335"></a><span class="lineno"><a class="line" href="classarmnn_1_1_dynamic_backend_utils.xhtml#adb6f50f10cdce40bd5493d42930b58cb"> 335</a></span> <a class="code" href="namespacearmnn.xhtml#a1854d9cda81304325664363c1fd0fb27">BackendIdSet</a> <a class="code" href="classarmnn_1_1_dynamic_backend_utils.xhtml#adb6f50f10cdce40bd5493d42930b58cb">DynamicBackendUtils::RegisterDynamicBackendsImpl</a>(<a class="code" href="classarmnn_1_1_backend_registry.xhtml">BackendRegistry</a>& backendRegistry,</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keyword">const</span> std::vector<DynamicBackendPtr>& dynamicBackends)</div><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>  <a class="code" href="classarmnn_1_1_backend_id.xhtml">BackendId</a> 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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>& 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.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</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.<a class="code" href="classarmnn_1_1_backend_id.xhtml#a8e12342fc420701fbffd97025421575a">IsEmpty</a>() ||</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  dynamicBackendId.<a class="code" href="classarmnn_1_1_backend_id.xhtml#ae36f5197d26d2e429d9c5fc100c2d500">IsUndefined</a>())</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.<a class="code" href="classarmnn_1_1_backend_registry.xhtml#a34fad4b6d0db8ebfad2f9178f0a90816">IsBackendRegistered</a>(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> <a class="code" href="classarmnn_1_1_runtime_exception.xhtml">RuntimeException</a>& 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.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</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.<a class="code" href="classarmnn_1_1_backend_registry.xhtml#a0318ffa738b798986c4347ea9fe5ab37">Register</a>(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> <a class="code" href="classarmnn_1_1_invalid_argument_exception.xhtml">InvalidArgumentException</a>& 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.<a class="code" href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">what</a>();</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="line"><a name="l00410"></a><span class="lineno"> 410</span> </div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> } <span class="comment">// namespace armnn</span></div><div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a7e786263f454b19c40b78c4092a4af5b"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a7e786263f454b19c40b78c4092a4af5b">armnn::DynamicBackendUtils::DeregisterDynamicBackends</a></div><div class="ttdeci">static void DeregisterDynamicBackends(const BackendIdSet &dynamicBackends)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00314">DynamicBackendUtils.cpp:314</a></div></div> |
| 102 | <div class="ttc" id="classarmnn_1_1_backend_registry_xhtml_a34fad4b6d0db8ebfad2f9178f0a90816"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml#a34fad4b6d0db8ebfad2f9178f0a90816">armnn::BackendRegistry::IsBackendRegistered</a></div><div class="ttdeci">bool IsBackendRegistered(const BackendId &id) const</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.xhtml#l00043">BackendRegistry.cpp:43</a></div></div> |
| 103 | <div class="ttc" id="structarmnn_1_1_backend_version_xhtml_a421dbc9bee3ebd2721de5c82e6cd7d20"><div class="ttname"><a href="structarmnn_1_1_backend_version.xhtml#a421dbc9bee3ebd2721de5c82e6cd7d20">armnn::BackendVersion::m_Minor</a></div><div class="ttdeci">uint32_t m_Minor</div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00035">IBackendInternal.hpp:35</a></div></div> |
| 104 | <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> |
| 105 | <div class="ttc" id="classarmnn_1_1_backend_registry_xhtml_a0318ffa738b798986c4347ea9fe5ab37"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml#a0318ffa738b798986c4347ea9fe5ab37">armnn::BackendRegistry::Register</a></div><div class="ttdeci">void Register(const BackendId &id, FactoryFunction factory)</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.xhtml#l00019">BackendRegistry.cpp:19</a></div></div> |
| 106 | <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> |
| 107 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a6789076aa25c6a10faeff1043359bda8"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6789076aa25c6a10faeff1043359bda8">armnn::DynamicBackendUtils::IsBackendCompatible</a></div><div class="ttdeci">static bool IsBackendCompatible(const BackendVersion &backendVersion)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00051">DynamicBackendUtils.cpp:51</a></div></div> |
| 108 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_xhtml"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend.xhtml">armnn::DynamicBackend</a></div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_dynamic_backend_8hpp_source.xhtml#l00018">DynamicBackend.hpp:18</a></div></div> |
| 109 | <div class="ttc" id="classarmnn_1_1_exception_xhtml_abf843cbb29dec939d0731e491bab6f70"><div class="ttname"><a href="classarmnn_1_1_exception.xhtml#abf843cbb29dec939d0731e491bab6f70">armnn::Exception::what</a></div><div class="ttdeci">virtual const char * what() const noexcept override</div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8cpp_source.xhtml#l00032">Exceptions.cpp:32</a></div></div> |
| 110 | <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> |
| 111 | <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> |
| 112 | <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> |
| 113 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a42e250dfa19b9df3abdb273e1d35fa5b"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a42e250dfa19b9df3abdb273e1d35fa5b">armnn::DynamicBackendUtils::CreateDynamicBackends</a></div><div class="ttdeci">static std::vector< DynamicBackendPtr > CreateDynamicBackends(const std::vector< std::string > &sharedObjects)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00263">DynamicBackendUtils.cpp:263</a></div></div> |
| 114 | <div class="ttc" id="namespacearmnn_xhtml"><div class="ttname"><a href="namespacearmnn.xhtml">armnn</a></div><div class="ttdoc">Copyright (c) 2020 ARM Limited. </div><div class="ttdef"><b>Definition:</b> <a href="00__introduction_8dox_source.xhtml#l00025">00_introduction.dox:25</a></div></div> |
| 115 | <div class="ttc" id="classarmnn_1_1_backend_registry_xhtml"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml">armnn::BackendRegistry</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8hpp_source.xhtml#l00020">BackendRegistry.hpp:20</a></div></div> |
| 116 | <div class="ttc" id="_dynamic_backend_utils_8hpp_xhtml"><div class="ttname"><a href="_dynamic_backend_utils_8hpp.xhtml">DynamicBackendUtils.hpp</a></div></div> |
| 117 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a6d47980f97dd4d3aab24d818f8474dce"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a6d47980f97dd4d3aab24d818f8474dce">armnn::DynamicBackendUtils::GetBackendPaths</a></div><div class="ttdeci">static std::vector< std::string > GetBackendPaths(const std::string &overrideBackendPath="")</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00080">DynamicBackendUtils.cpp:80</a></div></div> |
| 118 | <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> |
| 119 | <div class="ttc" id="structarmnn_1_1_backend_version_xhtml"><div class="ttname"><a href="structarmnn_1_1_backend_version.xhtml">armnn::BackendVersion</a></div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00032">IBackendInternal.hpp:32</a></div></div> |
| 120 | <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> |
| 121 | <div class="ttc" id="namespacearmnn_xhtml_a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd"><div class="ttname"><a href="namespacearmnn.xhtml#a4dc0adc6737b5944e7671bee71788407a7b83d3f08fa392b79e3f553b585971cd">armnn::BoostLogSeverityMapping::warning</a></div></div> |
| 122 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a48e1fb944c3ef4086365aedcadb4c311"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a48e1fb944c3ef4086365aedcadb4c311">armnn::DynamicBackendUtils::GetSharedObjects</a></div><div class="ttdeci">static std::vector< std::string > GetSharedObjects(const std::vector< std::string > &backendPaths)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00176">DynamicBackendUtils.cpp:176</a></div></div> |
| 123 | <div class="ttc" id="classarmnn_1_1_runtime_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_runtime_exception.xhtml">armnn::RuntimeException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00120">Exceptions.hpp:120</a></div></div> |
| 124 | <div class="ttc" id="classarmnn_1_1_invalid_argument_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_invalid_argument_exception.xhtml">armnn::InvalidArgumentException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00080">Exceptions.hpp:80</a></div></div> |
| 125 | <div class="ttc" id="_logging_8hpp_xhtml"><div class="ttname"><a href="_logging_8hpp.xhtml">Logging.hpp</a></div></div> |
| 126 | <div class="ttc" id="structarmnn_1_1_backend_version_xhtml_aa98a6e78930567c2d9cdcf320eaddb7a"><div class="ttname"><a href="structarmnn_1_1_backend_version.xhtml#aa98a6e78930567c2d9cdcf320eaddb7a">armnn::BackendVersion::m_Major</a></div><div class="ttdeci">uint32_t m_Major</div><div class="ttdef"><b>Definition:</b> <a href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml#l00034">IBackendInternal.hpp:34</a></div></div> |
| 127 | <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> |
| 128 | <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> |
| 129 | <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> |
| 130 | <div class="ttc" id="classarmnn_1_1_backend_id_xhtml_a8e12342fc420701fbffd97025421575a"><div class="ttname"><a href="classarmnn_1_1_backend_id.xhtml#a8e12342fc420701fbffd97025421575a">armnn::BackendId::IsEmpty</a></div><div class="ttdeci">bool IsEmpty() const</div><div class="ttdef"><b>Definition:</b> <a href="_backend_id_8hpp_source.xhtml#l00138">BackendId.hpp:138</a></div></div> |
| 131 | <div class="ttc" id="classarmnn_1_1_exception_xhtml"><div class="ttname"><a href="classarmnn_1_1_exception.xhtml">armnn::Exception</a></div><div class="ttdoc">Base class for all ArmNN exceptions so that users can filter to just those. </div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.xhtml#l00046">Exceptions.hpp:46</a></div></div> |
| 132 | <div class="ttc" id="classarmnn_1_1_backend_registry_xhtml_a41895cd60f4b1bfd0b88571a8773ff1c"><div class="ttname"><a href="classarmnn_1_1_backend_registry.xhtml#a41895cd60f4b1bfd0b88571a8773ff1c">armnn::BackendRegistry::Deregister</a></div><div class="ttdeci">void Deregister(const BackendId &id)</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.xhtml#l00034">BackendRegistry.cpp:34</a></div></div> |
| 133 | <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> |
| 134 | <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> |
| 135 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_a55415a62bbb0a72c1a2f333501989401"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#a55415a62bbb0a72c1a2f333501989401">armnn::DynamicBackendUtils::RegisterDynamicBackends</a></div><div class="ttdeci">static BackendIdSet RegisterDynamicBackends(const std::vector< DynamicBackendPtr > &dynamicBackends)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00326">DynamicBackendUtils.cpp:326</a></div></div> |
| 136 | <div class="ttc" id="classarmnn_1_1_backend_id_xhtml_ae36f5197d26d2e429d9c5fc100c2d500"><div class="ttname"><a href="classarmnn_1_1_backend_id.xhtml#ae36f5197d26d2e429d9c5fc100c2d500">armnn::BackendId::IsUndefined</a></div><div class="ttdeci">bool IsUndefined() const</div><div class="ttdef"><b>Definition:</b> <a href="_backend_id_8hpp_source.xhtml#l00139">BackendId.hpp:139</a></div></div> |
| 137 | <div class="ttc" id="classarmnn_1_1_dynamic_backend_utils_xhtml_aebd30d283660a07b4123fdb0245e8426"><div class="ttname"><a href="classarmnn_1_1_dynamic_backend_utils.xhtml#aebd30d283660a07b4123fdb0245e8426">armnn::DynamicBackendUtils::CloseHandle</a></div><div class="ttdeci">static void CloseHandle(const void *sharedObjectHandle)</div><div class="ttdef"><b>Definition:</b> <a href="_dynamic_backend_utils_8cpp_source.xhtml#l00037">DynamicBackendUtils.cpp:37</a></div></div> |
| 138 | <div class="ttc" id="classarmnn_1_1_backend_id_xhtml"><div class="ttname"><a href="classarmnn_1_1_backend_id.xhtml">armnn::BackendId</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_id_8hpp_source.xhtml#l00075">BackendId.hpp:75</a></div></div> |
| 139 | </div><!-- fragment --></div><!-- contents --> |
| 140 | </div><!-- doc-content --> |
| 141 | <!-- start footer part --> |
| 142 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 143 | <ul> |
| 144 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.xhtml">backends</a></li><li class="navelem"><a class="el" href="dir_797a213d7d01b98ef12d53b0820ea64e.xhtml">backendsCommon</a></li><li class="navelem"><a class="el" href="_dynamic_backend_utils_8cpp.xhtml">DynamicBackendUtils.cpp</a></li> |
| 145 | <li class="footer">Generated on Fri Mar 13 2020 16:09:10 for ArmNN by |
| 146 | <a href="http://www.doxygen.org/index.html"> |
| 147 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 148 | </ul> |
| 149 | </div> |
| 150 | </body> |
| 151 | </html> |