| <!-- HTML header for doxygen 1.8.15--> |
| <!-- Remember to use version doxygen 1.8.15 +--> |
| <!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.15"/> |
| <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines --> |
| <title>Compute Library: arm_compute/core/utils/misc/Rounding.h 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"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(document).ready(initResizable); |
| /* @license-end */</script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/x-mathjax-config"> |
| MathJax.Hub.Config({ |
| extensions: ["tex2jax.js"], |
| jax: ["input/TeX","output/HTML-CSS"], |
| }); |
| </script><script type="text/javascript" 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> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <img alt="Compute Library" src="https://raw.githubusercontent.com/ARM-software/ComputeLibrary/gh-pages/ACL_logo.png" style="max-width: 100%;margin-top: 15px;margin-left: 10px"/> |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname"> |
|  <span id="projectnumber">20.02.1</span> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.15 --> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&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&dn=gpl-2.0.txt GPL-v2 */ |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| /* @license-end */</script> |
| <div id="main-nav"></div> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(document).ready(function(){initNavTree('utils_2misc_2_rounding_8h_source.xhtml','');}); |
| /* @license-end */ |
| </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">Rounding.h</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <a href="utils_2misc_2_rounding_8h.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) 2018-2019 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_UTILS_ROUNDING_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define ARM_COMPUTE_UTILS_ROUNDING_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="_error_8h.xhtml">arm_compute/core/Error.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="_requires_8h.xhtml">arm_compute/core/utils/misc/Requires.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="utils_2misc_2traits_8h.xhtml">arm_compute/core/utils/misc/Traits.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="_toolchain_support_8h.xhtml">support/ToolchainSupport.h</a>"</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <cmath></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">namespace </span><a class="code" href="namespacearm__compute.xhtml">arm_compute</a></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">namespace </span>utils</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml"> 38</a></span> <span class="keyword">namespace </span>rounding</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> {<span class="comment"></span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">/** Rounding mode */</span></div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101"> 41</a></span> <span class="keyword">enum class</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101">RoundingMode</a></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>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a5631ad8e27788edfca7e13535d862c06">TO_ZERO</a>, <span class="comment">/**< Round towards zero */</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a1ff3077771e77d24ec18776e2ed9edc7">AWAY_FROM_ZERO</a>, <span class="comment">/**< Round away from zero */</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101afe7ff9704b5494f69cd7ccd330bc3969">HALF_TO_ZERO</a>, <span class="comment">/**< Round half towards from zero */</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a0af811513148901478bd420235c48c6b">HALF_AWAY_FROM_ZERO</a>, <span class="comment">/**< Round half away from zero */</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101ae184ac539927e7effd9eae762e9f1904">HALF_UP</a>, <span class="comment">/**< Round half towards positive infinity */</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a8f7b877b609236c678a778dd131ebcb6">HALF_DOWN</a>, <span class="comment">/**< Round half towards negative infinity */</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a29746b187c41c8e51b96a3104cbda3b6">HALF_EVEN</a> <span class="comment">/**< Round half towards nearest even */</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="comment"></span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="comment">/** Round floating-point value with round to zero</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment"> *</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> *</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"> *</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment"> */</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a02f57d08fe3b3f4efd408fb4875c0789"> 61</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a02f57d08fe3b3f4efd408fb4875c0789">round_to_zero</a>(T value)</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  T res = std::floor(std::fabs(value));</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">return</span> (value < 0.f) ? -res : res;</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> <span class="comment"></span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment">/** Round floating-point value with round away from zero</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> *</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment"> *</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> *</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment"> */</span></div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4d6feea06f0c1ad779760e477348db6b"> 76</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4d6feea06f0c1ad779760e477348db6b">round_away_from_zero</a>(T value)</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  T res = std::ceil(std::fabs(value));</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> (value < 0.f) ? -res : res;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"></span></div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment">/** Round floating-point value with half value rounding towards zero.</span></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> *</span></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment"> *</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment"> *</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment"> */</span></div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a2b38aea22003d34e97d6678f329896d9"> 91</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a2b38aea22003d34e97d6678f329896d9">round_half_to_zero</a>(T value)</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> {</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  T res = T(std::ceil(std::fabs(value) - 0.5f));</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">return</span> (value < 0.f) ? -res : res;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"></span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">/** Round floating-point value with half value rounding away from zero.</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> *</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment"> *</span></div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment"> *</span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"> */</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#aeecc6e8935077dc93cc5079fe98d3adc"> 106</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#aeecc6e8935077dc93cc5079fe98d3adc">round_half_away_from_zero</a>(T value)</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  T res = T(std::floor(std::fabs(value) + 0.5f));</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">return</span> (value < 0.f) ? -res : res;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"></span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment">/** Round floating-point value with half value rounding to positive infinity.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> *</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"> *</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> *</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> */</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a7d412c5e09b4d4be67727d85d24d51be"> 121</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a7d412c5e09b4d4be67727d85d24d51be">round_half_up</a>(T value)</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">return</span> std::floor(value + 0.5f);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> }</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"></span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment">/** Round floating-point value with half value rounding to negative infinity.</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> *</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> *</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"> *</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="comment"> */</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4a17ff00e5272477260c040731aa1d36"> 135</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4a17ff00e5272477260c040731aa1d36">round_half_down</a>(T value)</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> {</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">return</span> std::ceil(value - 0.5f);</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="comment"></span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment">/** Round floating-point value with half value rounding to nearest even.</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="comment"> *</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="comment"> *</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment"> * @param[in] epsilon precision.</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> *</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"> */</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#af1c8bd162677ab8a8ae5dfddc55ca9b8"> 150</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#af1c8bd162677ab8a8ae5dfddc55ca9b8">round_half_even</a>(T value, T <a class="code" href="namespacearm__compute_1_1quantization.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a> = <a class="code" href="namespacearm__compute_1_1quantization.xhtml#a552dc3787d7ea1675f3e4e8993501d58">std::numeric_limits<T>::epsilon</a>())</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> {</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  T positive_value = std::abs(value);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  T ipart = 0;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  std::modf(positive_value, &ipart);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="comment">// If 'value' is exactly halfway between two integers</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">if</span>(std::abs(positive_value - (ipart + 0.5f)) < <a class="code" href="namespacearm__compute_1_1quantization.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>)</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="comment">// If 'ipart' is even then return 'ipart'</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">if</span>(std::fmod(ipart, 2.f) < <a class="code" href="namespacearm__compute_1_1quantization.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>)</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#a28096f8372c0ad762864c790917375e2">support::cpp11::copysign</a>(ipart, value);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="comment">// Else return the nearest even integer</span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#a28096f8372c0ad762864c790917375e2">support::cpp11::copysign</a>(std::ceil(ipart + 0.5f), value);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  }</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="comment">// Otherwise use the usual round to closest</span></div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#a28096f8372c0ad762864c790917375e2">support::cpp11::copysign</a>(<a class="code" href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">support::cpp11::round</a>(positive_value), value);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span> }</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span> <span class="comment"></span></div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="comment">/** Round floating-point value given a rounding mode</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment"> *</span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="comment"> * @tparam T Parameter type. Should be of floating point type.</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="comment"> *</span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"> * @param[in] value floating-point value to be rounded.</span></div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> <span class="comment"> * @param[in] rounding_mode Rounding mode to use.</span></div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> <span class="comment"> *</span></div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="comment"> * @return Floating-point value of rounded @p value.</span></div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="comment"> */</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T, REQUIRES_TA(traits::is_<span class="keywordtype">float</span>ing_po<span class="keywordtype">int</span><T>::value)></div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a995d306fa75c139b6a878506701e6e07"> 180</a></span> <span class="keyword">inline</span> T <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a995d306fa75c139b6a878506701e6e07">round</a>(T value, <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101">RoundingMode</a> rounding_mode)</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> {</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="keywordflow">switch</span>(rounding_mode)</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  {</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a5631ad8e27788edfca7e13535d862c06">RoundingMode::TO_ZERO</a>:</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a02f57d08fe3b3f4efd408fb4875c0789">round_to_zero</a>(value);</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a1ff3077771e77d24ec18776e2ed9edc7">RoundingMode::AWAY_FROM_ZERO</a>:</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4d6feea06f0c1ad779760e477348db6b">round_away_from_zero</a>(value);</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101afe7ff9704b5494f69cd7ccd330bc3969">RoundingMode::HALF_TO_ZERO</a>:</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a2b38aea22003d34e97d6678f329896d9">round_half_to_zero</a>(value);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a0af811513148901478bd420235c48c6b">RoundingMode::HALF_AWAY_FROM_ZERO</a>:</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#aeecc6e8935077dc93cc5079fe98d3adc">round_half_away_from_zero</a>(value);</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101ae184ac539927e7effd9eae762e9f1904">RoundingMode::HALF_UP</a>:</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a7d412c5e09b4d4be67727d85d24d51be">round_half_up</a>(value);</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a8f7b877b609236c678a778dd131ebcb6">RoundingMode::HALF_DOWN</a>:</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4a17ff00e5272477260c040731aa1d36">round_half_down</a>(value);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a29746b187c41c8e51b96a3104cbda3b6">RoundingMode::HALF_EVEN</a>:</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1utils_1_1rounding.xhtml#af1c8bd162677ab8a8ae5dfddc55ca9b8">round_half_even</a>(value);</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <a class="code" href="_error_8h.xhtml#a7cf8d8b669b8f7b05680230be30d60f4">ARM_COMPUTE_ERROR</a>(<span class="stringliteral">"Unsupported rounding mode!"</span>);</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  }</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> }</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> } <span class="comment">// namespace rounding</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span> } <span class="comment">// namespace utils</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> } <span class="comment">// namespace arm_compute</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span> <span class="preprocessor">#endif </span><span class="comment">/*ARM_COMPUTE_UTILS_ROUNDING_H */</span><span class="preprocessor"></span></div><div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a4a17ff00e5272477260c040731aa1d36"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4a17ff00e5272477260c040731aa1d36">arm_compute::utils::rounding::round_half_down</a></div><div class="ttdeci">T round_half_down(T value)</div><div class="ttdoc">Round floating-point value with half value rounding to negative infinity.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00135">Rounding.h:135</a></div></div> |
| <div class="ttc" id="_toolchain_support_8h_xhtml"><div class="ttname"><a href="_toolchain_support_8h.xhtml">ToolchainSupport.h</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101afe7ff9704b5494f69cd7ccd330bc3969"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101afe7ff9704b5494f69cd7ccd330bc3969">arm_compute::utils::rounding::RoundingMode::HALF_TO_ZERO</a></div><div class="ttdoc">Round half towards from zero.</div></div> |
| <div class="ttc" id="_error_8h_xhtml_a7cf8d8b669b8f7b05680230be30d60f4"><div class="ttname"><a href="_error_8h.xhtml#a7cf8d8b669b8f7b05680230be30d60f4">ARM_COMPUTE_ERROR</a></div><div class="ttdeci">#define ARM_COMPUTE_ERROR(msg)</div><div class="ttdoc">Print the given message then throw an std::runtime_error.</div><div class="ttdef"><b>Definition:</b> <a href="_error_8h_source.xhtml#l00352">Error.h:352</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1support_1_1cpp11_xhtml_a28096f8372c0ad762864c790917375e2"><div class="ttname"><a href="namespacearm__compute_1_1support_1_1cpp11.xhtml#a28096f8372c0ad762864c790917375e2">arm_compute::support::cpp11::copysign</a></div><div class="ttdeci">T copysign(T x, T y)</div><div class="ttdoc">Composes a floating point value with the magnitude of x and the sign of y.</div><div class="ttdef"><b>Definition:</b> <a href="_toolchain_support_8h_source.xhtml#l00349">ToolchainSupport.h:349</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a7d412c5e09b4d4be67727d85d24d51be"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a7d412c5e09b4d4be67727d85d24d51be">arm_compute::utils::rounding::round_half_up</a></div><div class="ttdeci">T round_half_up(T value)</div><div class="ttdoc">Round floating-point value with half value rounding to positive infinity.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00121">Rounding.h:121</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a4d6feea06f0c1ad779760e477348db6b"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a4d6feea06f0c1ad779760e477348db6b">arm_compute::utils::rounding::round_away_from_zero</a></div><div class="ttdeci">T round_away_from_zero(T value)</div><div class="ttdoc">Round floating-point value with round away from zero.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00076">Rounding.h:76</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_aeecc6e8935077dc93cc5079fe98d3adc"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#aeecc6e8935077dc93cc5079fe98d3adc">arm_compute::utils::rounding::round_half_away_from_zero</a></div><div class="ttdeci">T round_half_away_from_zero(T value)</div><div class="ttdoc">Round floating-point value with half value rounding away from zero.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00106">Rounding.h:106</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_af1c8bd162677ab8a8ae5dfddc55ca9b8"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#af1c8bd162677ab8a8ae5dfddc55ca9b8">arm_compute::utils::rounding::round_half_even</a></div><div class="ttdeci">T round_half_even(T value, T epsilon=std::numeric_limits< T >::epsilon())</div><div class="ttdoc">Round floating-point value with half value rounding to nearest even.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00150">Rounding.h:150</a></div></div> |
| <div class="ttc" id="namespacearm__compute_xhtml"><div class="ttname"><a href="namespacearm__compute.xhtml">arm_compute</a></div><div class="ttdoc">Copyright (c) 2017-2020 ARM Limited.</div><div class="ttdef"><b>Definition:</b> <a href="00__introduction_8dox_source.xhtml#l00024">00_introduction.dox:24</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101a5631ad8e27788edfca7e13535d862c06"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a5631ad8e27788edfca7e13535d862c06">arm_compute::utils::rounding::RoundingMode::TO_ZERO</a></div><div class="ttdoc">Round towards zero.</div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a2b38aea22003d34e97d6678f329896d9"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a2b38aea22003d34e97d6678f329896d9">arm_compute::utils::rounding::round_half_to_zero</a></div><div class="ttdeci">T round_half_to_zero(T value)</div><div class="ttdoc">Round floating-point value with half value rounding towards zero.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00091">Rounding.h:91</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101a8f7b877b609236c678a778dd131ebcb6"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a8f7b877b609236c678a778dd131ebcb6">arm_compute::utils::rounding::RoundingMode::HALF_DOWN</a></div><div class="ttdoc">Round half towards negative infinity.</div></div> |
| <div class="ttc" id="_requires_8h_xhtml"><div class="ttname"><a href="_requires_8h.xhtml">Requires.h</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a02f57d08fe3b3f4efd408fb4875c0789"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a02f57d08fe3b3f4efd408fb4875c0789">arm_compute::utils::rounding::round_to_zero</a></div><div class="ttdeci">T round_to_zero(T value)</div><div class="ttdoc">Round floating-point value with round to zero.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00061">Rounding.h:61</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101a1ff3077771e77d24ec18776e2ed9edc7"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a1ff3077771e77d24ec18776e2ed9edc7">arm_compute::utils::rounding::RoundingMode::AWAY_FROM_ZERO</a></div><div class="ttdoc">Round away from zero.</div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101ae184ac539927e7effd9eae762e9f1904"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101ae184ac539927e7effd9eae762e9f1904">arm_compute::utils::rounding::RoundingMode::HALF_UP</a></div><div class="ttdoc">Round half towards positive infinity.</div></div> |
| <div class="ttc" id="_error_8h_xhtml"><div class="ttname"><a href="_error_8h.xhtml">Error.h</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101a29746b187c41c8e51b96a3104cbda3b6"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a29746b187c41c8e51b96a3104cbda3b6">arm_compute::utils::rounding::RoundingMode::HALF_EVEN</a></div><div class="ttdoc">Round half towards nearest even.</div></div> |
| <div class="ttc" id="namespacearm__compute_1_1support_1_1cpp11_xhtml_ab71c35ca207b916a9f8b0336ab88484e"><div class="ttname"><a href="namespacearm__compute_1_1support_1_1cpp11.xhtml#ab71c35ca207b916a9f8b0336ab88484e">arm_compute::support::cpp11::round</a></div><div class="ttdeci">T round(T value)</div><div class="ttdoc">Round floating-point value with half value rounding away from zero.</div><div class="ttdef"><b>Definition:</b> <a href="_toolchain_support_8h_source.xhtml#l00317">ToolchainSupport.h:317</a></div></div> |
| <div class="ttc" id="utils_2misc_2traits_8h_xhtml"><div class="ttname"><a href="utils_2misc_2traits_8h.xhtml">Traits.h</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101a0af811513148901478bd420235c48c6b"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101a0af811513148901478bd420235c48c6b">arm_compute::utils::rounding::RoundingMode::HALF_AWAY_FROM_ZERO</a></div><div class="ttdoc">Round half away from zero.</div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a995d306fa75c139b6a878506701e6e07"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a995d306fa75c139b6a878506701e6e07">arm_compute::utils::rounding::round</a></div><div class="ttdeci">T round(T value, RoundingMode rounding_mode)</div><div class="ttdoc">Round floating-point value given a rounding mode.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00180">Rounding.h:180</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1quantization_xhtml_a552dc3787d7ea1675f3e4e8993501d58"><div class="ttname"><a href="namespacearm__compute_1_1quantization.xhtml#a552dc3787d7ea1675f3e4e8993501d58">arm_compute::quantization::epsilon</a></div><div class="ttdeci">constexpr float epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_asymm_helpers_8cpp_source.xhtml#l00036">AsymmHelpers.cpp:36</a></div></div> |
| <div class="ttc" id="namespacearm__compute_1_1utils_1_1rounding_xhtml_a5959c934b204c7bcb6766cfaea8ae101"><div class="ttname"><a href="namespacearm__compute_1_1utils_1_1rounding.xhtml#a5959c934b204c7bcb6766cfaea8ae101">arm_compute::utils::rounding::RoundingMode</a></div><div class="ttdeci">RoundingMode</div><div class="ttdoc">Rounding mode.</div><div class="ttdef"><b>Definition:</b> <a href="utils_2misc_2_rounding_8h_source.xhtml#l00041">Rounding.h:41</a></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_214608ef36d61442cb2b0c1c4e9a7def.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="dir_1fb090f0c6070330bfaccc4236d3ca0d.xhtml">core</a></li><li class="navelem"><a class="el" href="dir_7b0825b7536eda12b63e5d87347b1c7d.xhtml">utils</a></li><li class="navelem"><a class="el" href="dir_cab437ca4f6ec1fbc573ae83f91b2654.xhtml">misc</a></li><li class="navelem"><a class="el" href="utils_2misc_2_rounding_8h.xhtml">Rounding.h</a></li> |
| <li class="footer">Generated on Thu Mar 5 2020 16:06:55 for Compute Library by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |