blob: fd8a8448ae7c7e53d1911e8c37108c2bdad4ec7c [file] [log] [blame]
<!-- 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::helpers::float_ops Namespace Reference</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&amp;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">
&#160;<span id="projectnumber">19.08</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&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @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&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('namespacearm__compute_1_1helpers_1_1float__ops.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="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">arm_compute::helpers::float_ops Namespace Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionarm__compute_1_1helpers_1_1float__ops_1_1_raw_float.xhtml">RawFloat</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7b4d1b716f8f3af42a267805c5eb6671"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1helpers_1_1float__ops.xhtml#a7b4d1b716f8f3af42a267805c5eb6671">is_equal_ulps</a> (float a, float b, int max_allowed_ulps=0)</td></tr>
<tr class="memdesc:a7b4d1b716f8f3af42a267805c5eb6671"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if two floating point numbers are equal given an allowed number of ULPs. <a href="#a7b4d1b716f8f3af42a267805c5eb6671">More...</a><br /></td></tr>
<tr class="separator:a7b4d1b716f8f3af42a267805c5eb6671"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2dcf325d146568ecc8d4a4bd36c02ac"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1helpers_1_1float__ops.xhtml#ab2dcf325d146568ecc8d4a4bd36c02ac">is_one</a> (float a, float <a class="el" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>=0.00001f)</td></tr>
<tr class="memdesc:ab2dcf325d146568ecc8d4a4bd36c02ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the input floating point number is 1.0f checking if the difference is within a range defined with epsilon. <a href="#ab2dcf325d146568ecc8d4a4bd36c02ac">More...</a><br /></td></tr>
<tr class="separator:ab2dcf325d146568ecc8d4a4bd36c02ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bd19352aed7410633d1f9b95d74a809"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespacearm__compute_1_1helpers_1_1float__ops.xhtml#a3bd19352aed7410633d1f9b95d74a809">is_zero</a> (float a, float <a class="el" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>=0.00001f)</td></tr>
<tr class="memdesc:a3bd19352aed7410633d1f9b95d74a809"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the input floating point number is 0.0f checking if the difference is within a range defined with epsilon. <a href="#a3bd19352aed7410633d1f9b95d74a809">More...</a><br /></td></tr>
<tr class="separator:a3bd19352aed7410633d1f9b95d74a809"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7b4d1b716f8f3af42a267805c5eb6671"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b4d1b716f8f3af42a267805c5eb6671">&#9670;&nbsp;</a></span>is_equal_ulps()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool arm_compute::helpers::float_ops::is_equal_ulps </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>max_allowed_ulps</em> = <code>0</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if two floating point numbers are equal given an allowed number of ULPs. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>First number to compare </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Second number to compare </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">max_allowed_ulps</td><td>(Optional) Number of allowed ULPs</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if number is close else false </dd></dl>
<p class="definition">Definition at line <a class="el" href="float__ops_8h_source.xhtml#l00080">80</a> of file <a class="el" href="float__ops_8h_source.xhtml">float_ops.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;{</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; RawFloat ra(a);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; RawFloat rb(<a class="code" href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">b</a>);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="comment">// Check ULP distance</span></div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">const</span> <span class="keywordtype">int</span> ulps = std::abs(ra.i32 - rb.i32);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">return</span> ulps &lt;= max_allowed_ulps;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160;}</div><div class="ttc" id="namespacearm__compute_1_1test_1_1validation_xhtml_aa76b4a6e74940dabc5b7fc6b2dab3545"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1validation.xhtml#aa76b4a6e74940dabc5b7fc6b2dab3545">arm_compute::test::validation::b</a></div><div class="ttdeci">SimpleTensor&lt; float &gt; b</div><div class="ttdef"><b>Definition:</b> <a href="_c_p_p_2_d_f_t_8cpp_source.xhtml#l00157">DFT.cpp:157</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_c_p_p_2_d_f_t_8cpp_source.xhtml#l00157">arm_compute::test::validation::b</a>, and <a class="el" href="float__ops_8h_source.xhtml#l00068">RawFloat::i32</a>.</p>
</div>
</div>
<a id="ab2dcf325d146568ecc8d4a4bd36c02ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2dcf325d146568ecc8d4a4bd36c02ac">&#9670;&nbsp;</a></span>is_one()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool arm_compute::helpers::float_ops::is_one </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>epsilon</em> = <code>0.00001f</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if the input floating point number is 1.0f checking if the difference is within a range defined with epsilon. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>Input floating point number </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>(Optional) Epsilon used to define the error bounds</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if number is close to 1.0f </dd></dl>
<p class="definition">Definition at line <a class="el" href="float__ops_8h_source.xhtml#l00097">97</a> of file <a class="el" href="float__ops_8h_source.xhtml">float_ops.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;{</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">return</span> std::abs(1.0f - a) &lt;= <a class="code" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;}</div><div class="ttc" id="_asymm_helpers_8cpp_xhtml_a552dc3787d7ea1675f3e4e8993501d58"><div class="ttname"><a href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a></div><div class="ttdeci">constexpr float epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_asymm_helpers_8cpp_source.xhtml#l00033">AsymmHelpers.cpp:33</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_asymm_helpers_8cpp_source.xhtml#l00033">epsilon</a>.</p>
<p class="reference">Referenced by <a class="el" href="_c_l_g_e_m_m_matrix_multiply_native_kernel_8cpp_source.xhtml#l00212">CLGEMMMatrixMultiplyNativeKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_reshaped_only_r_h_s_kernel_8cpp_source.xhtml#l00215">CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_kernel_8cpp_source.xhtml#l00305">CLGEMMMatrixMultiplyKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_reshaped_kernel_8cpp_source.xhtml#l00214">CLGEMMMatrixMultiplyReshapedKernel::configure()</a>, and <a class="el" href="_n_e_g_e_m_m_matrix_multiply_kernel_8cpp_source.xhtml#l00996">NEGEMMMatrixMultiplyKernel::run()</a>.</p>
</div>
</div>
<a id="a3bd19352aed7410633d1f9b95d74a809"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bd19352aed7410633d1f9b95d74a809">&#9670;&nbsp;</a></span>is_zero()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool arm_compute::helpers::float_ops::is_zero </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>epsilon</em> = <code>0.00001f</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if the input floating point number is 0.0f checking if the difference is within a range defined with epsilon. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>Input floating point number </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">epsilon</td><td>(Optional) Epsilon used to define the error bounds</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if number is close to 0.0f </dd></dl>
<p class="definition">Definition at line <a class="el" href="float__ops_8h_source.xhtml#l00109">109</a> of file <a class="el" href="float__ops_8h_source.xhtml">float_ops.h</a>.</p>
<div class="fragment"><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;{</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordflow">return</span> std::abs(0.0f - a) &lt;= <a class="code" href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a>;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;}</div><div class="ttc" id="_asymm_helpers_8cpp_xhtml_a552dc3787d7ea1675f3e4e8993501d58"><div class="ttname"><a href="_asymm_helpers_8cpp.xhtml#a552dc3787d7ea1675f3e4e8993501d58">epsilon</a></div><div class="ttdeci">constexpr float epsilon</div><div class="ttdef"><b>Definition:</b> <a href="_asymm_helpers_8cpp_source.xhtml#l00033">AsymmHelpers.cpp:33</a></div></div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="_asymm_helpers_8cpp_source.xhtml#l00033">epsilon</a>.</p>
<p class="reference">Referenced by <a class="el" href="_c_l_g_e_m_m_matrix_multiply_native_kernel_8cpp_source.xhtml#l00212">CLGEMMMatrixMultiplyNativeKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_reshaped_only_r_h_s_kernel_8cpp_source.xhtml#l00215">CLGEMMMatrixMultiplyReshapedOnlyRHSKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_kernel_8cpp_source.xhtml#l00305">CLGEMMMatrixMultiplyKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_matrix_multiply_reshaped_kernel_8cpp_source.xhtml#l00214">CLGEMMMatrixMultiplyReshapedKernel::configure()</a>, <a class="el" href="_c_l_g_e_m_m_8cpp_source.xhtml#l00470">CLGEMM::configure()</a>, and <a class="el" href="_c_l_g_e_m_m_8cpp_source.xhtml#l00525">CLGEMM::validate()</a>.</p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1helpers.xhtml">helpers</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1helpers_1_1float__ops.xhtml">float_ops</a></li>
<li class="footer">Generated on Mon Sep 2 2019 11:47:40 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>