aboutsummaryrefslogtreecommitdiff
path: root/23.02/_dynamic_sample_8cpp-example.xhtml
diff options
context:
space:
mode:
authorDavid Monahan <david.monahan@arm.com>2023-03-22 16:48:58 +0000
committerDavid Monahan <david.monahan@arm.com>2023-03-22 16:48:58 +0000
commitae050524109f1ce827962665436ef7430f2ac479 (patch)
treea087fe0c77570971dd7979f2757426c24e91afc7 /23.02/_dynamic_sample_8cpp-example.xhtml
parent8d2ca734165a068478df7cffa46185680b05cd20 (diff)
downloadarmnn-ae050524109f1ce827962665436ef7430f2ac479.tar.gz
IVGCVSW-7255 Update Doxygen Documentation and publish on GitHub.
* Updating Doxygen documentation for 23.02 release. Signed-off-by: David Monahan <david.monahan@arm.com> Change-Id: I545574ff7664b4595d2fe6a91a3c35d2ad55df82
Diffstat (limited to '23.02/_dynamic_sample_8cpp-example.xhtml')
-rw-r--r--23.02/_dynamic_sample_8cpp-example.xhtml134
1 files changed, 123 insertions, 11 deletions
diff --git a/23.02/_dynamic_sample_8cpp-example.xhtml b/23.02/_dynamic_sample_8cpp-example.xhtml
index 7c8f053d77..a2e1b042e1 100644
--- a/23.02/_dynamic_sample_8cpp-example.xhtml
+++ b/23.02/_dynamic_sample_8cpp-example.xhtml
@@ -8,7 +8,7 @@
<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="generator" content="Doxygen 1.8.17"/>
<meta name="robots" content="NOINDEX, NOFOLLOW" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ArmNN: DynamicSample.cpp</title>
@@ -19,9 +19,6 @@
<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>
@@ -30,7 +27,8 @@
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
-</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
+</script>
+<script type="text/javascript" async="async" 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>
@@ -51,18 +49,21 @@
</table>
</div>
<!-- end header part -->
-<!-- Generated by Doxygen 1.8.13 -->
+<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
+/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
-</script>
+/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
@@ -76,7 +77,9 @@ $(function() {
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('_dynamic_sample_8cpp-example.xhtml','');});
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
+$(document).ready(function(){initNavTree('_dynamic_sample_8cpp-example.xhtml',''); initResizable(); });
+/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
@@ -100,14 +103,123 @@ $(document).ready(function(){initNavTree('_dynamic_sample_8cpp-example.xhtml',''
<div class="contents">
<p>This is simple example that shows how to use a dynamic backend. Dynamic Backends can be compiled as standalone against Arm NN and can be loaded by Arm NN dynamically at runtime. This way you can quickly integrate new backends without having to worry or recompile Arm NN.</p>
<p>This example makes use of a very simplistic dynamic backend called 'SampleDynamic'. There is a guide that tells you more about dynamic backends and how this particular backend was created so you can create a dynamic backend yourself <a class="el" href="md_src_dynamic__r_e_a_d_m_e.xhtml">Dynamically loadable Backend</a>.</p>
-<div class="fragment"><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Copyright © 2020 Arm Ltd. All rights reserved.</span></div><div class="line"><span class="comment">// SPDX-License-Identifier: MIT</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_network_8hpp.xhtml">armnn/INetwork.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_runtime_8hpp.xhtml">armnn/IRuntime.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_utils_8hpp.xhtml">armnn/Utils.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_descriptors_8hpp.xhtml">armnn/Descriptors.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">/// A simple example of using the ArmNN SDK API with the standalone sample dynamic backend.</span></div><div class="line"><span class="comment">/// In this example, an addition layer is used to add 2 input tensors to produce a result output tensor.</span></div><div class="line"><span class="comment"></span><span class="keywordtype">int</span> <a name="a0"></a><a class="code" href="_armnn_converter_8cpp.xhtml#a0ddf1224851353fc92bfbff6f499fa97">main</a>()</div><div class="line">{</div><div class="line"> <span class="keyword">using namespace </span><a class="code" href="namespacearmnn.xhtml">armnn</a>;</div><div class="line"></div><div class="line"> <span class="comment">// Construct ArmNN network</span></div><div class="line"> <a class="code" href="namespacearmnn.xhtml#a0d8160388a127c1a23b37bc88dc6e2ec">armnn::NetworkId</a> networkIdentifier;</div><div class="line"> <a class="code" href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">INetworkPtr</a> myNetwork = <a name="a1"></a><a class="code" href="classarmnn_1_1_i_network.xhtml#a41ce159095e95f7cd4174ce5d4662697">INetwork::Create</a>();</div><div class="line"></div><div class="line"> <a name="_a2"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* input0 = myNetwork-&gt;AddInputLayer(0);</div><div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* input1 = myNetwork-&gt;AddInputLayer(1);</div><div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* add = myNetwork-&gt;AddAdditionLayer();</div><div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* output = myNetwork-&gt;AddOutputLayer(0);</div><div class="line"></div><div class="line"> input0-&gt;<a name="a3"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a name="a4"></a><a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(add-&gt;<a name="a5"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(0));</div><div class="line"> input1-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(1));</div><div class="line"> add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(output-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(0));</div><div class="line"></div><div class="line"> <a name="_a6"></a><a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> tensorInfo(<a name="_a7"></a><a class="code" href="classarmnn_1_1_tensor_shape.xhtml">TensorShape</a>({2, 1}), <a name="a8"></a><a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">DataType::Float32</a>);</div><div class="line"> input0-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a name="a9"></a><a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div><div class="line"> input1-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div><div class="line"> add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div><div class="line"></div><div class="line"> <span class="comment">// Create ArmNN runtime</span></div><div class="line"> <a name="_a10"></a><a class="code" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">IRuntime::CreationOptions</a> options; <span class="comment">// default options</span></div><div class="line"> <a class="code" href="namespacearmnn.xhtml#a150468a02bd7b2d2d061c4aaaee939f0">armnn::IRuntimePtr</a> run(<a name="a11"></a><a class="code" href="classarmnn_1_1_i_runtime.xhtml#ad44ecd3700748dc30dc4bbe34ba5bde7">armnn::IRuntime::Create</a>(options));</div><div class="line"></div><div class="line"> <span class="comment">// Optimise ArmNN network</span></div><div class="line"> <a class="code" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">armnn::IOptimizedNetworkPtr</a> optNet = <a name="a12"></a><a class="code" href="namespacearmnn.xhtml#a82e98ef05fd67036d1195ba17174d685">Optimize</a>(*myNetwork, {<span class="stringliteral">&quot;SampleDynamic&quot;</span>}, run-&gt;GetDeviceSpec());</div><div class="line"> <span class="keywordflow">if</span> (!optNet)</div><div class="line"> {</div><div class="line"> <span class="comment">// This shouldn&#39;t happen for this simple sample, with reference backend.</span></div><div class="line"> <span class="comment">// But in general usage Optimize could fail if the hardware at runtime cannot</span></div><div class="line"> <span class="comment">// support the model that has been provided.</span></div><div class="line"> std::cerr &lt;&lt; <span class="stringliteral">&quot;Error: Failed to optimise the input network.&quot;</span> &lt;&lt; std::endl;</div><div class="line"> <span class="keywordflow">return</span> 1;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">// Load graph into runtime</span></div><div class="line"> run-&gt;LoadNetwork(networkIdentifier, std::move(optNet));</div><div class="line"></div><div class="line"> <span class="comment">// input data</span></div><div class="line"> std::vector&lt;float&gt; input0Data</div><div class="line"> {</div><div class="line"> 5.0f, 3.0f</div><div class="line"> };</div><div class="line"> std::vector&lt;float&gt; input1Data</div><div class="line"> {</div><div class="line"> 10.0f, 8.0f</div><div class="line"> };</div><div class="line"> std::vector&lt;float&gt; outputData(2);</div><div class="line"></div><div class="line"> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> inputTensorInfo = run-&gt;GetInputTensorInfo(networkIdentifier, 0);</div><div class="line"> inputTensorInfo.<a name="a13"></a><a class="code" href="classarmnn_1_1_tensor_info.xhtml#a8ffca1e21bdfa7f945617acd606aac91">SetConstant</a>(<span class="keyword">true</span>);</div><div class="line"> <a class="code" href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">InputTensors</a> inputTensors</div><div class="line"> {</div><div class="line"> {0,<a name="_a14"></a><a class="code" href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a>(inputTensorInfo, input0Data.data())},</div><div class="line"> {1,<a class="code" href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a>(inputTensorInfo, input1Data.data())}</div><div class="line"> };</div><div class="line"> <a class="code" href="namespacearmnn.xhtml#a8f091a512915d1cb29a4ebf13dfc53ea">OutputTensors</a> outputTensors</div><div class="line"> {</div><div class="line"> {0,<a name="_a15"></a><a class="code" href="classarmnn_1_1_tensor.xhtml">armnn::Tensor</a>(run-&gt;GetOutputTensorInfo(networkIdentifier, 0), outputData.data())}</div><div class="line"> };</div><div class="line"></div><div class="line"> <span class="comment">// Execute network</span></div><div class="line"> run-&gt;EnqueueWorkload(networkIdentifier, inputTensors, outputTensors);</div><div class="line"></div><div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Addition operator result is {&quot;</span> &lt;&lt; outputData[0] &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; outputData[1] &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; std::endl;</div><div class="line"> <span class="keywordflow">return</span> 0;</div><div class="line">}</div></div><!-- fragment --> </div><!-- contents -->
+<div class="fragment"><div class="line"><span class="comment">//</span></div>
+<div class="line"><span class="comment">// Copyright © 2020 Arm Ltd. All rights reserved.</span></div>
+<div class="line"><span class="comment">// SPDX-License-Identifier: MIT</span></div>
+<div class="line"><span class="comment">//</span></div>
+<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_network_8hpp.xhtml">armnn/INetwork.hpp</a>&gt;</span></div>
+<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_i_runtime_8hpp.xhtml">armnn/IRuntime.hpp</a>&gt;</span></div>
+<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_utils_8hpp.xhtml">armnn/Utils.hpp</a>&gt;</span></div>
+<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="_descriptors_8hpp.xhtml">armnn/Descriptors.hpp</a>&gt;</span></div>
+<div class="line"> </div>
+<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
+<div class="line"><span class="comment"></span> </div>
+<div class="line"><span class="comment">/// A simple example of using the ArmNN SDK API with the standalone sample dynamic backend.</span></div>
+<div class="line"><span class="comment">/// In this example, an addition layer is used to add 2 input tensors to produce a result output tensor.</span></div>
+<div class="line"><span class="comment"></span><span class="keywordtype">int</span> <a name="a0"></a><a class="code" href="_armnn_converter_8cpp.xhtml#a0ddf1224851353fc92bfbff6f499fa97">main</a>()</div>
+<div class="line">{</div>
+<div class="line"> <span class="keyword">using namespace </span><a class="code" href="namespacearmnn.xhtml">armnn</a>;</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// Construct ArmNN network</span></div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#a0d8160388a127c1a23b37bc88dc6e2ec">armnn::NetworkId</a> networkIdentifier;</div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">INetworkPtr</a> myNetwork = <a name="a1"></a><a class="code" href="classarmnn_1_1_i_network.xhtml#a41ce159095e95f7cd4174ce5d4662697">INetwork::Create</a>();</div>
+<div class="line"> </div>
+<div class="line"> <a name="_a2"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* input0 = myNetwork-&gt;AddInputLayer(0);</div>
+<div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* input1 = myNetwork-&gt;AddInputLayer(1);</div>
+<div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* add = myNetwork-&gt;AddAdditionLayer();</div>
+<div class="line"> <a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml">IConnectableLayer</a>* output = myNetwork-&gt;AddOutputLayer(0);</div>
+<div class="line"> </div>
+<div class="line"> input0-&gt;<a name="a3"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a name="a4"></a><a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(add-&gt;<a name="a5"></a><a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(0));</div>
+<div class="line"> input1-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(1));</div>
+<div class="line"> add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">Connect</a>(output-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">GetInputSlot</a>(0));</div>
+<div class="line"> </div>
+<div class="line"> <a name="_a6"></a><a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> tensorInfo(<a name="_a7"></a><a class="code" href="classarmnn_1_1_tensor_shape.xhtml">TensorShape</a>({2, 1}), <a name="a8"></a><a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">DataType::Float32</a>);</div>
+<div class="line"> input0-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a name="a9"></a><a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div>
+<div class="line"> input1-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div>
+<div class="line"> add-&gt;<a class="code" href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">GetOutputSlot</a>(0).<a class="code" href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">SetTensorInfo</a>(tensorInfo);</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// Create ArmNN runtime</span></div>
+<div class="line"> <a name="_a10"></a><a class="code" href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">IRuntime::CreationOptions</a> options; <span class="comment">// default options</span></div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#a150468a02bd7b2d2d061c4aaaee939f0">armnn::IRuntimePtr</a> run(<a name="a11"></a><a class="code" href="classarmnn_1_1_i_runtime.xhtml#ad44ecd3700748dc30dc4bbe34ba5bde7">armnn::IRuntime::Create</a>(options));</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// Optimise ArmNN network</span></div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">armnn::IOptimizedNetworkPtr</a> optNet = <a name="a12"></a><a class="code" href="namespacearmnn.xhtml#a2783360b253135639f4c63cfcaed6d48">Optimize</a>(*myNetwork, {<span class="stringliteral">&quot;SampleDynamic&quot;</span>}, run-&gt;GetDeviceSpec());</div>
+<div class="line"> <span class="keywordflow">if</span> (!optNet)</div>
+<div class="line"> {</div>
+<div class="line"> <span class="comment">// This shouldn&#39;t happen for this simple sample, with reference backend.</span></div>
+<div class="line"> <span class="comment">// But in general usage Optimize could fail if the hardware at runtime cannot</span></div>
+<div class="line"> <span class="comment">// support the model that has been provided.</span></div>
+<div class="line"> std::cerr &lt;&lt; <span class="stringliteral">&quot;Error: Failed to optimise the input network.&quot;</span> &lt;&lt; std::endl;</div>
+<div class="line"> <span class="keywordflow">return</span> 1;</div>
+<div class="line"> }</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// Load graph into runtime</span></div>
+<div class="line"> run-&gt;LoadNetwork(networkIdentifier, std::move(optNet));</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// input data</span></div>
+<div class="line"> std::vector&lt;float&gt; input0Data</div>
+<div class="line"> {</div>
+<div class="line"> 5.0f, 3.0f</div>
+<div class="line"> };</div>
+<div class="line"> std::vector&lt;float&gt; input1Data</div>
+<div class="line"> {</div>
+<div class="line"> 10.0f, 8.0f</div>
+<div class="line"> };</div>
+<div class="line"> std::vector&lt;float&gt; outputData(2);</div>
+<div class="line"> </div>
+<div class="line"> <a class="code" href="classarmnn_1_1_tensor_info.xhtml">TensorInfo</a> inputTensorInfo = run-&gt;GetInputTensorInfo(networkIdentifier, 0);</div>
+<div class="line"> inputTensorInfo.<a name="a13"></a><a class="code" href="classarmnn_1_1_tensor_info.xhtml#a8ffca1e21bdfa7f945617acd606aac91">SetConstant</a>(<span class="keyword">true</span>);</div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">InputTensors</a> inputTensors</div>
+<div class="line"> {</div>
+<div class="line"> {0,<a name="_a14"></a><a class="code" href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a>(inputTensorInfo, input0Data.data())},</div>
+<div class="line"> {1,<a class="code" href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a>(inputTensorInfo, input1Data.data())}</div>
+<div class="line"> };</div>
+<div class="line"> <a class="code" href="namespacearmnn.xhtml#a8f091a512915d1cb29a4ebf13dfc53ea">OutputTensors</a> outputTensors</div>
+<div class="line"> {</div>
+<div class="line"> {0,<a name="_a15"></a><a class="code" href="classarmnn_1_1_tensor.xhtml">armnn::Tensor</a>(run-&gt;GetOutputTensorInfo(networkIdentifier, 0), outputData.data())}</div>
+<div class="line"> };</div>
+<div class="line"> </div>
+<div class="line"> <span class="comment">// Execute network</span></div>
+<div class="line"> run-&gt;EnqueueWorkload(networkIdentifier, inputTensors, outputTensors);</div>
+<div class="line"> </div>
+<div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Addition operator result is {&quot;</span> &lt;&lt; outputData[0] &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; outputData[1] &lt;&lt; <span class="stringliteral">&quot;}&quot;</span> &lt;&lt; std::endl;</div>
+<div class="line"> <span class="keywordflow">return</span> 0;</div>
+<div class="line">}</div>
+</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
+<div class="ttc" id="anamespacearmnn_xhtml_a674efcf6cbdb9e831d653ff0e821fb38"><div class="ttname"><a href="namespacearmnn.xhtml#a674efcf6cbdb9e831d653ff0e821fb38">armnn::IOptimizedNetworkPtr</a></div><div class="ttdeci">std::unique_ptr&lt; IOptimizedNetwork, void(*)(IOptimizedNetwork *network)&gt; IOptimizedNetworkPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.xhtml#l00253">INetwork.hpp:253</a></div></div>
+<div class="ttc" id="a_utils_8hpp_xhtml"><div class="ttname"><a href="_utils_8hpp.xhtml">Utils.hpp</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_connectable_layer_xhtml"><div class="ttname"><a href="classarmnn_1_1_i_connectable_layer.xhtml">armnn::IConnectableLayer</a></div><div class="ttdoc">Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.xhtml#l00068">INetwork.hpp:68</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_const_tensor_xhtml"><div class="ttname"><a href="classarmnn_1_1_const_tensor.xhtml">armnn::ConstTensor</a></div><div class="ttdoc">A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00327">Tensor.hpp:327</a></div></div>
+<div class="ttc" id="astructarmnn_1_1_i_runtime_1_1_creation_options_xhtml"><div class="ttname"><a href="structarmnn_1_1_i_runtime_1_1_creation_options.xhtml">armnn::IRuntime::CreationOptions</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_runtime_8hpp_source.xhtml#l00085">IRuntime.hpp:85</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_connectable_layer_xhtml_a80ac4eda2e7f2757ec9dd96fc96dbd16"><div class="ttname"><a href="classarmnn_1_1_i_connectable_layer.xhtml#a80ac4eda2e7f2757ec9dd96fc96dbd16">armnn::IConnectableLayer::GetOutputSlot</a></div><div class="ttdeci">virtual const IOutputSlot &amp; GetOutputSlot(unsigned int index) const =0</div><div class="ttdoc">Get the const output slot handle by slot index.</div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_output_slot_xhtml_ac1835f8756a9f03c02fcf9664e3a0fce"><div class="ttname"><a href="classarmnn_1_1_i_output_slot.xhtml#ac1835f8756a9f03c02fcf9664e3a0fce">armnn::IOutputSlot::Connect</a></div><div class="ttdeci">virtual int Connect(IInputSlot &amp;destination)=0</div></div>
+<div class="ttc" id="aclassarmnn_1_1_tensor_info_xhtml_a8ffca1e21bdfa7f945617acd606aac91"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml#a8ffca1e21bdfa7f945617acd606aac91">armnn::TensorInfo::SetConstant</a></div><div class="ttdeci">void SetConstant(const bool IsConstant=true)</div><div class="ttdoc">Marks the data corresponding to this tensor info as constant.</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8cpp_source.xhtml#l00514">Tensor.cpp:514</a></div></div>
+<div class="ttc" id="a_i_network_8hpp_xhtml"><div class="ttname"><a href="_i_network_8hpp.xhtml">INetwork.hpp</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml"><div class="ttname"><a href="namespacearmnn.xhtml">armnn</a></div><div class="ttdoc">Copyright (c) 2021 ARM Limited and Contributors.</div><div class="ttdef"><b>Definition:</b> <a href="01__00__quick__start_8dox_source.xhtml#l00006">01_00_quick_start.dox:6</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_connectable_layer_xhtml_a6ec9e0eb66d7d6a01240492a0b18104c"><div class="ttname"><a href="classarmnn_1_1_i_connectable_layer.xhtml#a6ec9e0eb66d7d6a01240492a0b18104c">armnn::IConnectableLayer::GetInputSlot</a></div><div class="ttdeci">virtual const IInputSlot &amp; GetInputSlot(unsigned int index) const =0</div><div class="ttdoc">Get a const input slot handle by slot index.</div></div>
+<div class="ttc" id="aclassarmnn_1_1_tensor_shape_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_shape.xhtml">armnn::TensorShape</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00020">Tensor.hpp:20</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_aa01bce88f89975a5a031db4cc8861527"><div class="ttname"><a href="namespacearmnn.xhtml#aa01bce88f89975a5a031db4cc8861527">armnn::InputTensors</a></div><div class="ttdeci">std::vector&lt; std::pair&lt; LayerBindingId, class ConstTensor &gt; &gt; InputTensors</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00392">Tensor.hpp:392</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a></div><div class="ttdeci">@ Float32</div></div>
+<div class="ttc" id="aclassarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00152">Tensor.hpp:152</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_a0d8160388a127c1a23b37bc88dc6e2ec"><div class="ttname"><a href="namespacearmnn.xhtml#a0d8160388a127c1a23b37bc88dc6e2ec">armnn::NetworkId</a></div><div class="ttdeci">int NetworkId</div><div class="ttdef"><b>Definition:</b> <a href="_i_runtime_8hpp_source.xhtml#l00035">IRuntime.hpp:35</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_network_xhtml_a41ce159095e95f7cd4174ce5d4662697"><div class="ttname"><a href="classarmnn_1_1_i_network.xhtml#a41ce159095e95f7cd4174ce5d4662697">armnn::INetwork::Create</a></div><div class="ttdeci">static INetworkPtr Create(const NetworkOptions &amp;networkOptions={})</div><div class="ttdef"><b>Definition:</b> <a href="_network_8cpp_source.xhtml#l00452">Network.cpp:452</a></div></div>
+<div class="ttc" id="a_i_runtime_8hpp_xhtml"><div class="ttname"><a href="_i_runtime_8hpp.xhtml">IRuntime.hpp</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_output_slot_xhtml_a5ee4a6c9a2481245487b1b1a70d20fd0"><div class="ttname"><a href="classarmnn_1_1_i_output_slot.xhtml#a5ee4a6c9a2481245487b1b1a70d20fd0">armnn::IOutputSlot::SetTensorInfo</a></div><div class="ttdeci">virtual void SetTensorInfo(const TensorInfo &amp;tensorInfo)=0</div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_a8f091a512915d1cb29a4ebf13dfc53ea"><div class="ttname"><a href="namespacearmnn.xhtml#a8f091a512915d1cb29a4ebf13dfc53ea">armnn::OutputTensors</a></div><div class="ttdeci">std::vector&lt; std::pair&lt; LayerBindingId, class Tensor &gt; &gt; OutputTensors</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00393">Tensor.hpp:393</a></div></div>
+<div class="ttc" id="a_descriptors_8hpp_xhtml"><div class="ttname"><a href="_descriptors_8hpp.xhtml">Descriptors.hpp</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_ace74f6f9feb95a964a49d79458232703"><div class="ttname"><a href="namespacearmnn.xhtml#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a></div><div class="ttdeci">std::unique_ptr&lt; INetwork, void(*)(INetwork *network)&gt; INetworkPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.xhtml#l00252">INetwork.hpp:252</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_i_runtime_xhtml_ad44ecd3700748dc30dc4bbe34ba5bde7"><div class="ttname"><a href="classarmnn_1_1_i_runtime.xhtml#ad44ecd3700748dc30dc4bbe34ba5bde7">armnn::IRuntime::Create</a></div><div class="ttdeci">static IRuntimePtr Create(const CreationOptions &amp;options)</div><div class="ttdef"><b>Definition:</b> <a href="_runtime_8cpp_source.xhtml#l00052">Runtime.cpp:52</a></div></div>
+<div class="ttc" id="a_armnn_converter_8cpp_xhtml_a0ddf1224851353fc92bfbff6f499fa97"><div class="ttname"><a href="_armnn_converter_8cpp.xhtml#a0ddf1224851353fc92bfbff6f499fa97">main</a></div><div class="ttdeci">int main(int argc, char *argv[])</div><div class="ttdef"><b>Definition:</b> <a href="_armnn_converter_8cpp_source.xhtml#l00327">ArmnnConverter.cpp:327</a></div></div>
+<div class="ttc" id="aclassarmnn_1_1_tensor_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor.xhtml">armnn::Tensor</a></div><div class="ttdoc">A tensor defined by a TensorInfo (shape and data type) and a mutable backing store.</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00319">Tensor.hpp:319</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_a2783360b253135639f4c63cfcaed6d48"><div class="ttname"><a href="namespacearmnn.xhtml#a2783360b253135639f4c63cfcaed6d48">armnn::Optimize</a></div><div class="ttdeci">IOptimizedNetworkPtr Optimize(const INetwork &amp;network, const std::vector&lt; BackendId &gt; &amp;backendPreferences, const IDeviceSpec &amp;deviceSpec, const OptimizerOptions &amp;options=OptimizerOptions(), Optional&lt; std::vector&lt; std::string &gt; &amp; &gt; messages=EmptyOptional())</div><div class="ttdoc">Create an optimized version of the network.</div><div class="ttdef"><b>Definition:</b> <a href="_network_8cpp_source.xhtml#l01773">Network.cpp:1773</a></div></div>
+<div class="ttc" id="anamespacearmnn_xhtml_a150468a02bd7b2d2d061c4aaaee939f0"><div class="ttname"><a href="namespacearmnn.xhtml#a150468a02bd7b2d2d061c4aaaee939f0">armnn::IRuntimePtr</a></div><div class="ttdeci">std::unique_ptr&lt; IRuntime, void(*)(IRuntime *runtime)&gt; IRuntimePtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_runtime_8hpp_source.xhtml#l00041">IRuntime.hpp:41</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="footer">Generated on Fri Feb 24 2023 10:24:24 for ArmNN by
+ <li class="footer">Generated on Wed Mar 22 2023 15:52:59 for ArmNN by
<a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
+ <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>