aboutsummaryrefslogtreecommitdiff
path: root/21.02/md_src_dynamic__r_e_a_d_m_e.xhtml
blob: f3511b4c5eed857195da48f35cf553216d13a819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!-- Copyright (c) 2020 ARM Limited. -->
<!--                                 -->
<!-- SPDX-License-Identifier: MIT    -->
<!--                                 -->
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ArmNN: Dynamically loadable Backend</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">21.02</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('md_src_dynamic__r_e_a_d_m_e.xhtml','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Dynamically loadable Backend </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Arm NN allows adding new dynamic backends. Dynamic Backends can be compiled as standalone against Arm NN and can be loaded by Arm NN dynamically at runtime.</p>
<p>To be properly loaded and used, the backend instances must comply to the standard interface for dynamic backends and to the versioning rules that enforce ABI compatibility. The details of how to add dynamic backends can be found in ../backends/README.md "src/backends/README.md".</p>
<h2>Standalone dynamic backend example</h2>
<p>The source code includes an example that is used to generate a simple dynamic backend and is provided at</p>
<p><a href="./sample/SampleDynamicBackend.hpp">SampleDynamicBackend.hpp</a> <a href="./sample/SampleDynamicBackend.cpp">SampleDynamicBackend.cpp</a></p>
<p>The details of how to create backends can be found in ../backends/README.md "src/backends/README.md".</p>
<p>The makefile used for building the standalone reference dynamic backend is also provided: <a href="./sample/CMakeLists.txt">CMakeLists.txt</a></p>
<h3>Standalone dynamic backend build</h3>
<p>The easiest way to build a standalone sample dynamic backend is to build using environment configured compiler and specify the Arm NN path and Boost path to the CMake command:</p>
<div class="fragment"><div class="line">cd ${DYNAMIC_BACKEND_DIR}</div><div class="line">mkdir build</div><div class="line">cd build</div><div class="line">cmake -DBOOST_ROOT=${BOOST_PATH} \</div><div class="line">      -DBoost_SYSTEM_LIBRARY=${BOOST_PATH}/lib/libboost_system.a \</div><div class="line">      -DARMNN_PATH=${ARMNN_PATH}/libarmnn.so ..</div></div><!-- fragment --><p>Then run the build</p>
<div class="fragment"><div class="line">make</div></div><!-- fragment --><p>The library will be created in ${DYNAMIC_BACKEND_DIR}/build.</p>
<h2>Dynamic backend loading paths</h2>
<p>During the creation of the Runtime, Arm NN will scan a given set of paths searching for suitable dynamic backend objects to load. A list of (absolute) paths can be specified at compile-time by setting a define named <code>DYNAMIC_BACKEND_PATHS</code> in the form of a colon-separated list of strings.</p>
<div class="fragment"><div class="line">-DDYNAMIC_BACKEND_PATHS=&quot;PATH_1:PATH_2...:PATH_N&quot;</div></div><!-- fragment --><p>Example for setting the path to the sample standalone dynamic backend built from the previous step:</p>
<div class="fragment"><div class="line">-DDYNAMIC_BACKEND_PATHS=${DYNAMIC_BACKEND_DIR}/build</div></div><!-- fragment --><p>The paths will be processed in the same order as they are indicated in the macro. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="contribguides.xhtml">Contribution Guides</a></li>
    <li class="footer">Generated on Thu Feb 25 2021 17:27:56 for ArmNN by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>