| <!-- HTML header for doxygen 1.8.9.1--> |
| <!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.11"/> |
| <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines --> |
| <title>Compute Library: examples/gc_dc.cpp Source File</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); |
| $(window).load(resizeHeight); |
| </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/javascript"> |
| $(document).ready(function() { init_search(); }); |
| </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" /> |
| </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;"> |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname">Compute Library |
|  <span id="projectnumber">18.02</span> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.11 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.xhtml"><span>Main Page</span></a></li> |
| <li><a href="pages.xhtml"><span>Related Pages</span></a></li> |
| <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li> |
| <li><a href="annotated.xhtml"><span>Data Structures</span></a></li> |
| <li class="current"><a href="files.xhtml"><span>Files</span></a></li> |
| <li> |
| <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="files.xhtml"><span>File List</span></a></li> |
| <li><a href="globals.xhtml"><span>Globals</span></a></li> |
| </ul> |
| </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('gc__dc_8cpp_source.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">gc_dc.cpp</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <a href="gc__dc_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 (c) 2017, 2018 ARM Limited.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * SPDX-License-Identifier: MIT</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * of this software and associated documentation files (the "Software"), to</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * deal in the Software without restriction, including without limitation the</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * sell copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * SOFTWARE.</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef ARM_COMPUTE_GC</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#error "This example needs to be built with -DARM_COMPUTE_GC"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#endif </span><span class="comment">/* ARM_COMPUTE_GC */</span><span class="preprocessor"></span></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="preprocessor">#include "<a class="code" href="_g_c_functions_8h.xhtml">arm_compute/runtime/GLES_COMPUTE/GCFunctions.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="_g_c_scheduler_8h.xhtml">arm_compute/runtime/GLES_COMPUTE/GCScheduler.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "half/half.hpp"</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="utils_2_utils_8h.xhtml">utils/Utils.h</a>"</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">using namespace </span><a class="code" href="namespacearm__compute.xhtml">arm_compute</a>;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">using namespace </span>utils;</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> <span class="keyword">class </span>GCDCExample : <span class="keyword">public</span> <a class="code" href="classarm__compute_1_1utils_1_1_example.xhtml">Example</a></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordtype">void</span> do_setup(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)<span class="keyword"> override</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <a class="code" href="core_2_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a>(argc);</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <a class="code" href="core_2_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a>(argv);</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>  <span class="comment">// init instance</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="classarm__compute_1_1_g_c_scheduler.xhtml#ac758c6b5a7ccc31b7193cfde59c32109">GCScheduler::get</a>().<a class="code" href="classarm__compute_1_1_g_c_scheduler.xhtml#a19bb5002a62b62e050e89c975f7b9fdf">default_init</a>();</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> src_shape = <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>{ 11<a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a> <span class="comment">/* W */</span>, 13<a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a> <span class="comment">/* H */</span>, 4U <span class="comment">/* C */</span>, 3U <span class="comment">/* N */</span> };</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> kernel_size = 3;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> stride_x = 1;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> stride_y = 1;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> pad_x = 0;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keyword">const</span> <span class="keywordtype">int</span> pad_y = 0;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> num_kernels = 256;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keyword">const</span> <a class="code" href="namespacearm__compute.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ac2ad7f431e3446fddcd9b6b9f93c4c14">data_type</a> = <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a56d8353718e6fdc78b8d69078a2cdb94">DataType::F16</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="comment">// generate shape</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> weights_shape(kernel_size, kernel_size, src_shape.<a class="code" href="classarm__compute_1_1_dimensions.xhtml#a336121cb63ed79fa0a072eed03d694ac">z</a>(), num_kernels);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> bias_shape(num_kernels);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_pad_stride_info.xhtml">PadStrideInfo</a> pad_info(stride_x, stride_y, pad_x, pad_y, <a class="code" href="namespacearm__compute.xhtml#a1fece1bd804e64f39f602d1c3969849aa56c1e354d36beb85b0d881c5b2e24cbe">DimensionRoundingType::FLOOR</a>);</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="comment">// output shape should be 9*11*256*3 (W*H*C*N)</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> dst_shape = get_output_shape(src_shape, weights_shape, pad_info);</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>  <span class="comment">// create tensors</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>.allocator()->init(<a class="code" href="classarm__compute_1_1_tensor_info.xhtml">TensorInfo</a>(src_shape, 1, data_type));</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  weights.allocator()->init(<a class="code" href="classarm__compute_1_1_tensor_info.xhtml">TensorInfo</a>(weights_shape, 1, data_type));</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  bias.allocator()->init(<a class="code" href="classarm__compute_1_1_tensor_info.xhtml">TensorInfo</a>(bias_shape, 1, data_type));</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>.<a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml#ad6dc6b773780dd6b1ad17fc82368d9f3">allocator</a>()-><a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#aa72161e0e3c0f6b2da20f835de6af680">init</a>(<a class="code" href="classarm__compute_1_1_tensor_info.xhtml">TensorInfo</a>(dst_shape, 1, data_type));</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="comment">// configure layer</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adf88bb8e946175c496fb362aa458128b">conv</a>.configure(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>, &weights, &bias, &<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>, pad_info);</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>  <span class="comment">// allocate tensors</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>.allocator()->allocate();</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  weights.allocator()->allocate();</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  bias.allocator()->allocate();</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>.<a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml#ad6dc6b773780dd6b1ad17fc82368d9f3">allocator</a>()-><a class="code" href="classarm__compute_1_1_i_tensor_allocator.xhtml#aa8a4946cd749d482dd996874d295af85">allocate</a>();</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>  <span class="comment">// To demonstrate how to fill tensor with some values...</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>.map();</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="classarm__compute_1_1_window.xhtml">Window</a> window;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  window.<a class="code" href="classarm__compute_1_1_window.xhtml#a14470b4cb59140a1b6ff3b8f16c89ab6">use_tensor_dimensions</a>(src_shape);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classarm__compute_1_1_iterator.xhtml">Iterator</a> it(&<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>, window);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="namespacearm__compute.xhtml#a6c0dcc38187027dcb89cd9724bc5a823">execute_window_loop</a>(window, [&](<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_coordinates.xhtml">Coordinates</a> & <span class="keywordtype">id</span>)</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  *<span class="keyword">reinterpret_cast<</span><a class="code" href="namespacearm__compute.xhtml#a73e2825fd61d349c5ca2f5313e3c8ea1">half_float::half</a> *<span class="keyword">></span>(it.ptr()) = <a class="code" href="namespacearm__compute.xhtml#a73e2825fd61d349c5ca2f5313e3c8ea1">half_float::half</a>(1.f);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  });</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>.unmap();</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="keywordtype">void</span> do_run()<span class="keyword"> override</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="comment">// run the layer</span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adf88bb8e946175c496fb362aa458128b">conv</a>.run();</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>  <span class="keywordtype">void</span> do_teardown()<span class="keyword"> override</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="keyword"> </span>{</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment">// check result</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>.<a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml#a14c53d2d17be6fa8a2c9861527c7b002">map</a>();</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// do something</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>.<a class="code" href="classarm__compute_1_1_c_l_tensor.xhtml#a1ffeb3b5abb3d61f62b58a391816201c">unmap</a>();</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  }</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="classarm__compute_1_1_g_c_tensor.xhtml">GCTensor</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>{}, weights{}, bias{}, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">dst</a>{};</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <a class="code" href="classarm__compute_1_1_g_c_direct_convolution_layer.xhtml">GCDirectConvolutionLayer</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#adf88bb8e946175c496fb362aa458128b">conv</a>{};</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>  <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> get_output_shape(<a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> in_shape, <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> kernel_shape, <span class="keyword">const</span> <a class="code" href="classarm__compute_1_1_pad_stride_info.xhtml">PadStrideInfo</a> &<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a096668313a9a819d54a2e65ec21ff0cc">info</a>)</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a> out_shape(in_shape);</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keyword">const</span> std::pair<unsigned int, unsigned int> scaled_dims = <a class="code" href="namespacearm__compute.xhtml#a3d3d8bf7b86db4d7d4ebfe5b332f41b3">scaled_dimensions</a>(in_shape.<a class="code" href="classarm__compute_1_1_dimensions.xhtml#afb5cd37bb08f1029691590372e6330f0">x</a>(),</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  in_shape.<a class="code" href="classarm__compute_1_1_dimensions.xhtml#a691c9cb93365c2e33f3429de43244098">y</a>(),</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  kernel_shape.<a class="code" href="classarm__compute_1_1_dimensions.xhtml#afb5cd37bb08f1029691590372e6330f0">x</a>(),</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  kernel_shape.<a class="code" href="classarm__compute_1_1_dimensions.xhtml#a691c9cb93365c2e33f3429de43244098">y</a>(),</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a096668313a9a819d54a2e65ec21ff0cc">info</a>);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  out_shape.set(0, scaled_dims.first);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  out_shape.set(1, scaled_dims.second);</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  out_shape.set(2, kernel_shape[3]);</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">return</span> out_shape;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> };</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="gc__dc_8cpp.xhtml#a3c04138a5bfe5d72780bb7e82a18e627"> 127</a></span> <span class="keywordtype">int</span> <a class="code" href="gc__dc_8cpp.xhtml#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keywordflow">return</span> utils::run_example<GCDCExample>(argc, argv);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> }</div><div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a336121cb63ed79fa0a072eed03d694ac"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a336121cb63ed79fa0a072eed03d694ac">arm_compute::Dimensions::z</a></div><div class="ttdeci">T z() const </div><div class="ttdoc">Alias to access the size of the third dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00091">Dimensions.h:91</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_tensor_shape_xhtml"><div class="ttname"><a href="classarm__compute_1_1_tensor_shape.xhtml">arm_compute::TensorShape</a></div><div class="ttdoc">Shape of a tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_shape_8h_source.xhtml#l00039">TensorShape.h:39</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_c_l_tensor_xhtml_ad6dc6b773780dd6b1ad17fc82368d9f3"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor.xhtml#ad6dc6b773780dd6b1ad17fc82368d9f3">arm_compute::CLTensor::allocator</a></div><div class="ttdeci">ITensorAllocator * allocator()</div><div class="ttdoc">Return a pointer to the tensor&#39;s allocator. </div></div> |
| <div class="ttc" id="utils_2_utils_8h_xhtml"><div class="ttname"><a href="utils_2_utils_8h.xhtml">Utils.h</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_a1fece1bd804e64f39f602d1c3969849aa56c1e354d36beb85b0d881c5b2e24cbe"><div class="ttname"><a href="namespacearm__compute.xhtml#a1fece1bd804e64f39f602d1c3969849aa56c1e354d36beb85b0d881c5b2e24cbe">arm_compute::DimensionRoundingType::FLOOR</a></div><div class="ttdoc">Floor rounding. </div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_a73e2825fd61d349c5ca2f5313e3c8ea1"><div class="ttname"><a href="namespacearm__compute.xhtml#a73e2825fd61d349c5ca2f5313e3c8ea1">arm_compute::half</a></div><div class="ttdeci">half_float::half half</div><div class="ttdoc">16-bit floating point type </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00044">Types.h:44</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_adf88bb8e946175c496fb362aa458128b"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#adf88bb8e946175c496fb362aa458128b">arm_compute::test::validation::conv</a></div><div class="ttdeci">int16_t conv[25]</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00140">Convolution.cpp:140</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_g_c_direct_convolution_layer_xhtml"><div class="ttname"><a href="classarm__compute_1_1_g_c_direct_convolution_layer.xhtml">arm_compute::GCDirectConvolutionLayer</a></div><div class="ttdoc">Basic function to execute direct convolution function. </div><div class="ttdef"><b>Definition:</b> <a href="_g_c_direct_convolution_layer_8h_source.xhtml#l00049">GCDirectConvolutionLayer.h:49</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_g_c_tensor_xhtml"><div class="ttname"><a href="classarm__compute_1_1_g_c_tensor.xhtml">arm_compute::GCTensor</a></div><div class="ttdoc">Interface for OpenGL ES tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_g_c_tensor_8h_source.xhtml#l00037">GCTensor.h:37</a></div></div> |
| <div class="ttc" id="core_2_error_8h_xhtml_a4103adbb45806b2f2002d44b91d0d206"><div class="ttname"><a href="core_2_error_8h.xhtml#a4103adbb45806b2f2002d44b91d0d206">ARM_COMPUTE_UNUSED</a></div><div class="ttdeci">#define ARM_COMPUTE_UNUSED(var)</div><div class="ttdoc">To avoid unused variables warnings. </div><div class="ttdef"><b>Definition:</b> <a href="core_2_error_8h_source.xhtml#l00147">Error.h:147</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_window_xhtml_a14470b4cb59140a1b6ff3b8f16c89ab6"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml#a14470b4cb59140a1b6ff3b8f16c89ab6">arm_compute::Window::use_tensor_dimensions</a></div><div class="ttdeci">void use_tensor_dimensions(const TensorShape &shape, size_t first_dimension=Window::DimX)</div><div class="ttdoc">Use the tensor&#39;s dimensions to fill the window dimensions. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8inl_source.xhtml#l00240">Window.inl:240</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a096668313a9a819d54a2e65ec21ff0cc"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a096668313a9a819d54a2e65ec21ff0cc">arm_compute::test::validation::info</a></div><div class="ttdeci">src info() -> set_format(Format::S16)</div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml"><div class="ttname"><a href="namespacearm__compute.xhtml">arm_compute</a></div><div class="ttdoc">This file contains all available output stages for GEMMLowp on OpenCL. </div><div class="ttdef"><b>Definition:</b> <a href="01__library_8dox_source.xhtml#l00001">01_library.dox:1</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a56d8353718e6fdc78b8d69078a2cdb94"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a56d8353718e6fdc78b8d69078a2cdb94">arm_compute::Format::F16</a></div><div class="ttdoc">1 channel, 1 F16 per channel </div></div> |
| <div class="ttc" id="classarm__compute_1_1_c_l_tensor_xhtml_a14c53d2d17be6fa8a2c9861527c7b002"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor.xhtml#a14c53d2d17be6fa8a2c9861527c7b002">arm_compute::CLTensor::map</a></div><div class="ttdeci">void map(bool blocking=true)</div><div class="ttdoc">Enqueue a map operation of the allocated buffer. </div></div> |
| <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_afb5cd37bb08f1029691590372e6330f0"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#afb5cd37bb08f1029691590372e6330f0">arm_compute::Dimensions::x</a></div><div class="ttdeci">T x() const </div><div class="ttdoc">Alias to access the size of the first dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00081">Dimensions.h:81</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_ac2ad7f431e3446fddcd9b6b9f93c4c14"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#ac2ad7f431e3446fddcd9b6b9f93c4c14">arm_compute::test::validation::data_type</a></div><div class="ttdeci">data_type</div><div class="ttdef"><b>Definition:</b> <a href="validation_2_c_l_2_g_e_m_m_8cpp_source.xhtml#l00114">GEMM.cpp:114</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::Channel::U</a></div><div class="ttdoc">Cb/U channel. </div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_a6c0dcc38187027dcb89cd9724bc5a823"><div class="ttname"><a href="namespacearm__compute.xhtml#a6c0dcc38187027dcb89cd9724bc5a823">arm_compute::execute_window_loop</a></div><div class="ttdeci">void execute_window_loop(const Window &w, L &&lambda_function, Ts &&...iterators)</div><div class="ttdoc">Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...</div><div class="ttdef"><b>Definition:</b> <a href="_helpers_8inl_source.xhtml#l00122">Helpers.inl:122</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_coordinates_xhtml"><div class="ttname"><a href="classarm__compute_1_1_coordinates.xhtml">arm_compute::Coordinates</a></div><div class="ttdoc">Coordinates of an item. </div><div class="ttdef"><b>Definition:</b> <a href="_coordinates_8h_source.xhtml#l00037">Coordinates.h:37</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1utils_1_1_example_xhtml"><div class="ttname"><a href="classarm__compute_1_1utils_1_1_example.xhtml">arm_compute::utils::Example</a></div><div class="ttdoc">Abstract Example class. </div><div class="ttdef"><b>Definition:</b> <a href="utils_2_utils_8h_source.xhtml#l00062">Utils.h:62</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_pad_stride_info_xhtml"><div class="ttname"><a href="classarm__compute_1_1_pad_stride_info.xhtml">arm_compute::PadStrideInfo</a></div><div class="ttdoc">Padding and stride information class. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00491">Types.h:491</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_adbf67dcee294e673cf796f1ed8aeb6a4"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#adbf67dcee294e673cf796f1ed8aeb6a4">arm_compute::test::validation::dst</a></div><div class="ttdeci">CLTensor dst</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00137">Convolution.cpp:137</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_i_tensor_allocator_xhtml_aa8a4946cd749d482dd996874d295af85"><div class="ttname"><a href="classarm__compute_1_1_i_tensor_allocator.xhtml#aa8a4946cd749d482dd996874d295af85">arm_compute::ITensorAllocator::allocate</a></div><div class="ttdeci">virtual void allocate()=0</div><div class="ttdoc">Interface to be implemented by the child class to allocate the tensor. </div></div> |
| <div class="ttc" id="gc__dc_8cpp_xhtml_a3c04138a5bfe5d72780bb7e82a18e627"><div class="ttname"><a href="gc__dc_8cpp.xhtml#a3c04138a5bfe5d72780bb7e82a18e627">main</a></div><div class="ttdeci">int main(int argc, char **argv)</div><div class="ttdoc">Main program for directconvolution test. </div><div class="ttdef"><b>Definition:</b> <a href="gc__dc_8cpp_source.xhtml#l00127">gc_dc.cpp:127</a></div></div> |
| <div class="ttc" id="_g_c_functions_8h_xhtml"><div class="ttname"><a href="_g_c_functions_8h.xhtml">GCFunctions.h</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_dimensions_xhtml_a691c9cb93365c2e33f3429de43244098"><div class="ttname"><a href="classarm__compute_1_1_dimensions.xhtml#a691c9cb93365c2e33f3429de43244098">arm_compute::Dimensions::y</a></div><div class="ttdeci">T y() const </div><div class="ttdoc">Alias to access the size of the second dimension. </div><div class="ttdef"><b>Definition:</b> <a href="_dimensions_8h_source.xhtml#l00086">Dimensions.h:86</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_a3d3d8bf7b86db4d7d4ebfe5b332f41b3"><div class="ttname"><a href="namespacearm__compute.xhtml#a3d3d8bf7b86db4d7d4ebfe5b332f41b3">arm_compute::scaled_dimensions</a></div><div class="ttdeci">const std::pair< unsigned int, unsigned int > scaled_dimensions(unsigned int width, unsigned int height, unsigned int kernel_width, unsigned int kernel_height, const PadStrideInfo &pad_stride_info)</div><div class="ttdoc">Returns expected width and height of output scaled tensor depending on dimensions rounding mode...</div></div> |
| <div class="ttc" id="classarm__compute_1_1_i_tensor_allocator_xhtml_aa72161e0e3c0f6b2da20f835de6af680"><div class="ttname"><a href="classarm__compute_1_1_i_tensor_allocator.xhtml#aa72161e0e3c0f6b2da20f835de6af680">arm_compute::ITensorAllocator::init</a></div><div class="ttdeci">void init(const TensorInfo &input)</div><div class="ttdoc">Initialize a tensor based on the passed TensorInfo. </div></div> |
| <div class="ttc" id="_g_c_scheduler_8h_xhtml"><div class="ttname"><a href="_g_c_scheduler_8h.xhtml">GCScheduler.h</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarm__compute_1_1_tensor_info.xhtml">arm_compute::TensorInfo</a></div><div class="ttdoc">Store the tensor&#39;s metadata. </div><div class="ttdef"><b>Definition:</b> <a href="_tensor_info_8h_source.xhtml#l00044">TensorInfo.h:44</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_iterator_xhtml"><div class="ttname"><a href="classarm__compute_1_1_iterator.xhtml">arm_compute::Iterator</a></div><div class="ttdoc">Iterator updated by execute_window_loop for each window element. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_helpers_8h_source.xhtml#l00257">Helpers.h:257</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6"><div class="ttname"><a href="namespacearm__compute.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6">arm_compute::DataType</a></div><div class="ttdeci">DataType</div><div class="ttdoc">Available data types. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00072">Types.h:72</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_c_l_tensor_xhtml_a1ffeb3b5abb3d61f62b58a391816201c"><div class="ttname"><a href="classarm__compute_1_1_c_l_tensor.xhtml#a1ffeb3b5abb3d61f62b58a391816201c">arm_compute::CLTensor::unmap</a></div><div class="ttdeci">void unmap()</div><div class="ttdoc">Enqueue an unmap operation of the allocated and mapped buffer. </div></div> |
| <div class="ttc" id="classarm__compute_1_1_g_c_scheduler_xhtml_ac758c6b5a7ccc31b7193cfde59c32109"><div class="ttname"><a href="classarm__compute_1_1_g_c_scheduler.xhtml#ac758c6b5a7ccc31b7193cfde59c32109">arm_compute::GCScheduler::get</a></div><div class="ttdeci">static GCScheduler & get()</div><div class="ttdoc">Access the scheduler singleton. </div></div> |
| <div class="ttc" id="classarm__compute_1_1_window_xhtml"><div class="ttname"><a href="classarm__compute_1_1_window.xhtml">arm_compute::Window</a></div><div class="ttdoc">Describe a multidimensional execution window. </div><div class="ttdef"><b>Definition:</b> <a href="_window_8h_source.xhtml#l00039">Window.h:39</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a6743f0a130e8311e6f5b1a23df102472"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">arm_compute::test::validation::src</a></div><div class="ttdeci">convolution configure & src</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00147">Convolution.cpp:147</a></div></div> |
| <div class="ttc" id="classarm__compute_1_1_g_c_scheduler_xhtml_a19bb5002a62b62e050e89c975f7b9fdf"><div class="ttname"><a href="classarm__compute_1_1_g_c_scheduler.xhtml#a19bb5002a62b62e050e89c975f7b9fdf">arm_compute::GCScheduler::default_init</a></div><div class="ttdeci">void default_init()</div><div class="ttdoc">Initialises the context and command queue used by the scheduler to default values and sets a default ...</div></div> |
| </div><!-- fragment --></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="dir_d28a4824dc47e487b107a5db32ef43c4.xhtml">examples</a></li><li class="navelem"><a class="el" href="gc__dc_8cpp.xhtml">gc_dc.cpp</a></li> |
| <li class="footer">Generated on Thu Feb 22 2018 15:45:19 for Compute Library by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |