1 <!-- HTML header for doxygen 1.8.9.1-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.8.11"/>
8 <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
9 <title>Compute Library: tests/validation/reference/Scharr.cpp Source File</title>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
21 <link href="search/search.css" rel="stylesheet" type="text/css"/>
22 <script type="text/javascript" src="search/searchdata.js"></script>
23 <script type="text/javascript" src="search/search.js"></script>
24 <script type="text/javascript">
25 $(document).ready(function() { init_search(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
32 </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33 <link href="doxygen.css" rel="stylesheet" type="text/css" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">Compute Library
43  <span id="projectnumber">18.02</span>
50 <!-- end header part -->
51 <!-- Generated by Doxygen 1.8.11 -->
52 <script type="text/javascript">
53 var searchBox = new SearchBox("searchBox", "search",false,'Search');
55 <div id="navrow1" class="tabs">
57 <li><a href="index.xhtml"><span>Main Page</span></a></li>
58 <li><a href="pages.xhtml"><span>Related Pages</span></a></li>
59 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
61 <li class="current"><a href="files.xhtml"><span>Files</span></a></li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
80 <div id="navrow2" class="tabs2">
82 <li><a href="files.xhtml"><span>File List</span></a></li>
83 <li><a href="globals.xhtml"><span>Globals</span></a></li>
87 <div id="side-nav" class="ui-resizable side-nav-resizable">
89 <div id="nav-tree-contents">
90 <div id="nav-sync" class="sync"></div>
93 <div id="splitbar" style="-moz-user-select:none;"
94 class="ui-resizable-handle">
97 <script type="text/javascript">
98 $(document).ready(function(){initNavTree('reference_2_scharr_8cpp_source.xhtml','');});
100 <div id="doc-content">
101 <!-- window showing the filter options -->
102 <div id="MSearchSelectWindow"
103 onmouseover="return searchBox.OnSearchSelectShow()"
104 onmouseout="return searchBox.OnSearchSelectHide()"
105 onkeydown="return searchBox.OnSearchSelectKey(event)">
108 <!-- iframe showing the search results (closed by default) -->
109 <div id="MSearchResultsWindow">
110 <iframe src="javascript:void(0)" frameborder="0"
111 name="MSearchResults" id="MSearchResults">
116 <div class="headertitle">
117 <div class="title">Scharr.cpp</div> </div>
119 <div class="contents">
120 <a href="reference_2_scharr_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 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">#include "<a class="code" href="_scharr_8h.xhtml">Scharr.h</a>"</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="tests_2validation_2reference_2_utils_8h.xhtml">Utils.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="tests_2validation_2_helpers_8h.xhtml">tests/validation/Helpers.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <array></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <map></span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <utility></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">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> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">namespace </span>test</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">namespace </span>validation</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="keyword">namespace </span>reference</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">namespace</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">const</span> std::array<int8_t, 9> scharr_3_x{ { -3, 0, 3, -10, 0, 10, -3, 0, 3 } };</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="keyword">const</span> std::array<int8_t, 9> scharr_3_y{ { -3, -10, -3, 0, 0, 0, 3, 10, 3 } };</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">const</span> std::map<int, std::pair<const int8_t *, const int8_t *>> masks</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  { 3, { scharr_3_x.data(), scharr_3_y.data() } }</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"> 51</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">struct </span><a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ac2ad7f431e3446fddcd9b6b9f93c4c14">data_type</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">template</span> <></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">struct </span><a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#ac2ad7f431e3446fddcd9b6b9f93c4c14">data_type</a><int16_t></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>  <span class="keyword">const</span> <span class="keyword">static</span> <a class="code" href="namespacearm__compute.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a> <a class="code" href="hwc_8hpp.xhtml#a0f61d63b009d0880a89c843bd50d8d76">value</a> = <a class="code" href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6e0b0886efb94aec797f6b830329b72c">DataType::S16</a>;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> };</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> } <span class="comment">// namespace</span></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="keyword">template</span> <<span class="keyword">typename</span> T, <span class="keyword">typename</span> U></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a4578c34605a48d4b85ec0d0e6ab4b530"> 62</a></span> std::pair<SimpleTensor<T>, <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<T></a>> <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a4578c34605a48d4b85ec0d0e6ab4b530">scharr</a>(<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<U></a> &<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>, <span class="keywordtype">int</span> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a2237230a1357685ba2472c2d6fca17fa">filter_size</a>, <a class="code" href="namespacearm__compute.xhtml#a15a05537a472ee742404821851529327">BorderMode</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, uint8_t constant_border_value, <a class="code" href="namespacearm__compute.xhtml#ae46abc5ecac309cbece5c06cb80daaf7">GradientDimension</a> gradient_dimension)</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="keyword">const</span> <span class="keyword">auto</span> shape_size = <span class="keyword">static_cast<</span><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span><span class="keyword">></span>(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a2237230a1357685ba2472c2d6fca17fa">filter_size</a>);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<T></a> dst_x(src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aba5871b3e4a65d057ec1c28fce8b00ba">shape</a>(), <a class="code" href="hwc_8hpp.xhtml#a0f61d63b009d0880a89c843bd50d8d76">data_type<T>::value</a>, src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#abdd3637f2bbde9d7d0cc0b7bbd8400bb">num_channels</a>());</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<T></a> dst_y(src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aba5871b3e4a65d057ec1c28fce8b00ba">shape</a>(), <a class="code" href="hwc_8hpp.xhtml#a0f61d63b009d0880a89c843bd50d8d76">data_type<T>::value</a>, src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#abdd3637f2bbde9d7d0cc0b7bbd8400bb">num_channels</a>());</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="structarm__compute_1_1_valid_region.xhtml">ValidRegion</a> valid_region = <a class="code" href="namespacearm__compute_1_1test.xhtml#a8103df0e6c416f55f40106aa49072b42">shape_to_valid_region</a>(src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aba5871b3e4a65d057ec1c28fce8b00ba">shape</a>(), border_mode == <a class="code" href="namespacearm__compute.xhtml#a15a05537a472ee742404821851529327a0db45d2a4141101bdfe48e3314cfbca3">BorderMode::UNDEFINED</a>, <a class="code" href="structarm__compute_1_1_border_size.xhtml">BorderSize</a>(filter_size / 2));</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">for</span>(<span class="keywordtype">int</span> i = 0; i < src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aedcfdd4c3b92fe0d63b5463c7ad1d21e">num_elements</a>(); ++i)</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>  <a class="code" href="classarm__compute_1_1_coordinates.xhtml">Coordinates</a> coord = <a class="code" href="namespacearm__compute_1_1test.xhtml#a24d8c0391cfa38e78969b6ad97c0ff09">index2coord</a>(src.<a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aba5871b3e4a65d057ec1c28fce8b00ba">shape</a>(), i);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">if</span>(!<a class="code" href="namespacearm__compute_1_1test.xhtml#a856b55fc20ddcbdbeb84c35ae27bedac">is_in_valid_region</a>(valid_region, coord))</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">continue</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"> 80</span>  <span class="keywordflow">switch</span>(gradient_dimension)</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="keywordflow">case</span> GradientDimension::GRAD_X:</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5d1175c32ed7ea771e8ea46c936ea5c7">apply_2d_spatial_filter</a>(coord, src, dst_x, <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>{ shape_size, shape_size }, masks.at(filter_size).first, 1.f, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, constant_border_value);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordflow">case</span> GradientDimension::GRAD_Y:</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5d1175c32ed7ea771e8ea46c936ea5c7">apply_2d_spatial_filter</a>(coord, src, dst_y, <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>{ shape_size, shape_size }, masks.at(filter_size).second, 1.f, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, constant_border_value);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute.xhtml#ae46abc5ecac309cbece5c06cb80daaf7a5515a637eda61b978e97adaa5d7629cc">GradientDimension::GRAD_XY</a>:</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5d1175c32ed7ea771e8ea46c936ea5c7">apply_2d_spatial_filter</a>(coord, src, dst_x, <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>{ shape_size, shape_size }, masks.at(filter_size).first, 1.f, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, constant_border_value);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5d1175c32ed7ea771e8ea46c936ea5c7">apply_2d_spatial_filter</a>(coord, src, dst_y, <a class="code" href="classarm__compute_1_1_tensor_shape.xhtml">TensorShape</a>{ shape_size, shape_size }, masks.at(filter_size).second, 1.f, <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, constant_border_value);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <a class="code" href="core_2_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">"Gradient dimension not supported"</span>);</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> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">return</span> std::make_pair(dst_x, dst_y);</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> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">template</span> std::pair<SimpleTensor<int16_t>, <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<int16_t></a>> <a class="code" href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a4578c34605a48d4b85ec0d0e6ab4b530">scharr</a>(<span class="keyword">const</span> <a class="code" href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">SimpleTensor<uint8_t></a> &<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a6743f0a130e8311e6f5b1a23df102472">src</a>, <span class="keywordtype">int</span> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a2237230a1357685ba2472c2d6fca17fa">filter_size</a>, <a class="code" href="namespacearm__compute.xhtml#a15a05537a472ee742404821851529327">BorderMode</a> <a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">border_mode</a>, uint8_t constant_border_value,</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="namespacearm__compute.xhtml#ae46abc5ecac309cbece5c06cb80daaf7">GradientDimension</a> gradient_dimension);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> } <span class="comment">// namespace reference</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> } <span class="comment">// namespace validation</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> } <span class="comment">// namespace test</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> } <span class="comment">// namespace arm_compute</span></div><div class="ttc" id="namespacearm__compute_xhtml_a15a05537a472ee742404821851529327"><div class="ttname"><a href="namespacearm__compute.xhtml#a15a05537a472ee742404821851529327">arm_compute::BorderMode</a></div><div class="ttdeci">BorderMode</div><div class="ttdoc">Methods available to handle borders. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00221">Types.h:221</a></div></div>
121 <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>
122 <div class="ttc" id="tests_2validation_2reference_2_utils_8h_xhtml"><div class="ttname"><a href="tests_2validation_2reference_2_utils_8h.xhtml">Utils.h</a></div></div>
123 <div class="ttc" id="_scharr_8h_xhtml"><div class="ttname"><a href="_scharr_8h.xhtml">Scharr.h</a></div></div>
124 <div class="ttc" id="structarm__compute_1_1_border_size_xhtml"><div class="ttname"><a href="structarm__compute_1_1_border_size.xhtml">arm_compute::BorderSize</a></div><div class="ttdoc">Container for 2D border size. </div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00229">Types.h:229</a></div></div>
125 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a5d1175c32ed7ea771e8ea46c936ea5c7"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a5d1175c32ed7ea771e8ea46c936ea5c7">arm_compute::test::validation::apply_2d_spatial_filter</a></div><div class="ttdeci">void apply_2d_spatial_filter(Coordinates coord, const SimpleTensor< T > &src, SimpleTensor< U > &dst, const TensorShape &filter_shape, const V *filter_itr, double scale, BorderMode border_mode, T constant_border_value=T(0))</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2reference_2_utils_8h_source.xhtml#l00096">Utils.h:96</a></div></div>
126 <div class="ttc" id="core_2_error_8h_xhtml_a05b19c75afe9c24200a62b9724734bbd"><div class="ttname"><a href="core_2_error_8h.xhtml#a05b19c75afe9c24200a62b9724734bbd">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(...)</div><div class="ttdoc">Print the given message then throw an std::runtime_error. </div><div class="ttdef"><b>Definition:</b> <a href="core_2_error_8h_source.xhtml#l00238">Error.h:238</a></div></div>
127 <div class="ttc" id="tests_2validation_2_helpers_8h_xhtml"><div class="ttname"><a href="tests_2validation_2_helpers_8h.xhtml">Helpers.h</a></div></div>
128 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_1_1reference_xhtml_a4578c34605a48d4b85ec0d0e6ab4b530"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation_1_1reference.xhtml#a4578c34605a48d4b85ec0d0e6ab4b530">arm_compute::test::validation::reference::scharr</a></div><div class="ttdeci">std::pair< SimpleTensor< T >, SimpleTensor< T > > scharr(const SimpleTensor< U > &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)</div><div class="ttdef"><b>Definition:</b> <a href="reference_2_scharr_8cpp_source.xhtml#l00062">Scharr.cpp:62</a></div></div>
129 <div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml_aba5871b3e4a65d057ec1c28fce8b00ba"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aba5871b3e4a65d057ec1c28fce8b00ba">arm_compute::test::SimpleTensor::shape</a></div><div class="ttdeci">TensorShape shape() const override</div><div class="ttdoc">Shape of the tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00245">SimpleTensor.h:245</a></div></div>
130 <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>
131 <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>
132 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a5471e46933e7a9c4709972d91fc4ea65"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a5471e46933e7a9c4709972d91fc4ea65">arm_compute::test::validation::border_mode</a></div><div class="ttdeci">border_mode</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00133">Convolution.cpp:133</a></div></div>
133 <div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_a2237230a1357685ba2472c2d6fca17fa"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#a2237230a1357685ba2472c2d6fca17fa">arm_compute::test::validation::filter_size</a></div><div class="ttdeci">filter_size</div><div class="ttdef"><b>Definition:</b> <a href="_c_l_2_convolution_8cpp_source.xhtml#l00134">Convolution.cpp:134</a></div></div>
134 <div class="ttc" id="namespacearm__compute_1_1test_xhtml_a856b55fc20ddcbdbeb84c35ae27bedac"><div class="ttname"><a href="namespacearm__compute_1_1test.xhtml#a856b55fc20ddcbdbeb84c35ae27bedac">arm_compute::test::is_in_valid_region</a></div><div class="ttdeci">bool is_in_valid_region(const ValidRegion &valid_region, Coordinates coord)</div><div class="ttdoc">Check if a coordinate is within a valid region. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2_utils_8h_source.xhtml#l00450">Utils.h:450</a></div></div>
135 <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>
136 <div class="ttc" id="namespacearm__compute_1_1test_xhtml_a24d8c0391cfa38e78969b6ad97c0ff09"><div class="ttname"><a href="namespacearm__compute_1_1test.xhtml#a24d8c0391cfa38e78969b6ad97c0ff09">arm_compute::test::index2coord</a></div><div class="ttdeci">Coordinates index2coord(const TensorShape &shape, int index)</div><div class="ttdoc">Convert a linear index into n-dimensional coordinates. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2_utils_8h_source.xhtml#l00403">Utils.h:403</a></div></div>
137 <div class="ttc" id="namespacearm__compute_xhtml_ab4e88c89b3b7ea1735996cc4def22d58a6e0b0886efb94aec797f6b830329b72c"><div class="ttname"><a href="namespacearm__compute.xhtml#ab4e88c89b3b7ea1735996cc4def22d58a6e0b0886efb94aec797f6b830329b72c">arm_compute::Format::S16</a></div><div class="ttdoc">1 channel, 1 S16 per channel </div></div>
138 <div class="ttc" id="hwc_8hpp_xhtml_a0f61d63b009d0880a89c843bd50d8d76"><div class="ttname"><a href="hwc_8hpp.xhtml#a0f61d63b009d0880a89c843bd50d8d76">value</a></div><div class="ttdeci">void * value</div><div class="ttdef"><b>Definition:</b> <a href="hwc_8hpp_source.xhtml#l00278">hwc.hpp:278</a></div></div>
139 <div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml">arm_compute::test::SimpleTensor</a></div><div class="ttdoc">Simple tensor object that stores elements in a consecutive chunk of memory. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00059">SimpleTensor.h:59</a></div></div>
140 <div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml_abdd3637f2bbde9d7d0cc0b7bbd8400bb"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#abdd3637f2bbde9d7d0cc0b7bbd8400bb">arm_compute::test::SimpleTensor::num_channels</a></div><div class="ttdeci">int num_channels() const override</div><div class="ttdoc">Number of channels of the tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00295">SimpleTensor.h:295</a></div></div>
141 <div class="ttc" id="namespacearm__compute_xhtml_ae46abc5ecac309cbece5c06cb80daaf7a5515a637eda61b978e97adaa5d7629cc"><div class="ttname"><a href="namespacearm__compute.xhtml#ae46abc5ecac309cbece5c06cb80daaf7a5515a637eda61b978e97adaa5d7629cc">arm_compute::GradientDimension::GRAD_XY</a></div><div class="ttdoc">x and y gradient dimension </div></div>
142 <div class="ttc" id="namespacearm__compute_xhtml_a15a05537a472ee742404821851529327a0db45d2a4141101bdfe48e3314cfbca3"><div class="ttname"><a href="namespacearm__compute.xhtml#a15a05537a472ee742404821851529327a0db45d2a4141101bdfe48e3314cfbca3">arm_compute::BorderMode::UNDEFINED</a></div><div class="ttdoc">Borders are left undefined. </div></div>
143 <div class="ttc" id="classarm__compute_1_1test_1_1_simple_tensor_xhtml_aedcfdd4c3b92fe0d63b5463c7ad1d21e"><div class="ttname"><a href="classarm__compute_1_1test_1_1_simple_tensor.xhtml#aedcfdd4c3b92fe0d63b5463c7ad1d21e">arm_compute::test::SimpleTensor::num_elements</a></div><div class="ttdeci">int num_elements() const override</div><div class="ttdoc">Number of elements of the tensor. </div><div class="ttdef"><b>Definition:</b> <a href="_simple_tensor_8h_source.xhtml#l00331">SimpleTensor.h:331</a></div></div>
144 <div class="ttc" id="structarm__compute_1_1_valid_region_xhtml"><div class="ttname"><a href="structarm__compute_1_1_valid_region.xhtml">arm_compute::ValidRegion</a></div><div class="ttdef"><b>Definition:</b> <a href="arm__compute_2core_2_types_8h_source.xhtml#l00163">Types.h:163</a></div></div>
145 <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>
146 <div class="ttc" id="namespacearm__compute_xhtml_ae46abc5ecac309cbece5c06cb80daaf7"><div class="ttname"><a href="namespacearm__compute.xhtml#ae46abc5ecac309cbece5c06cb80daaf7">arm_compute::GradientDimension</a></div><div class="ttdeci">GradientDimension</div><div class="ttdoc">Gradient dimension type. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2_types_8h_source.xhtml#l00046">Types.h:46</a></div></div>
147 <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>
148 <div class="ttc" id="namespacearm__compute_1_1test_xhtml_a8103df0e6c416f55f40106aa49072b42"><div class="ttname"><a href="namespacearm__compute_1_1test.xhtml#a8103df0e6c416f55f40106aa49072b42">arm_compute::test::shape_to_valid_region</a></div><div class="ttdeci">ValidRegion shape_to_valid_region(const TensorShape &a_shape, bool border_undefined=false, BorderSize border_size=BorderSize(0))</div><div class="ttdoc">Create a valid region based on tensor shape, border mode and border size. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2_utils_8h_source.xhtml#l00212">Utils.h:212</a></div></div>
149 </div><!-- fragment --></div><!-- contents -->
150 </div><!-- doc-content -->
151 <!-- start footer part -->
152 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
154 <li class="navelem"><a class="el" href="dir_59425e443f801f1f2fd8bbe4959a3ccf.xhtml">tests</a></li><li class="navelem"><a class="el" href="dir_e7c7b16542faa38cb4655ff1750d3604.xhtml">validation</a></li><li class="navelem"><a class="el" href="dir_46fdb196cebdbffe77dac340cde62f29.xhtml">reference</a></li><li class="navelem"><a class="el" href="reference_2_scharr_8cpp.xhtml">Scharr.cpp</a></li>
155 <li class="footer">Generated on Thu Feb 22 2018 15:45:21 for Compute Library by
156 <a href="http://www.doxygen.org/index.html">
157 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>