aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2017-06-14 18:00:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit0a8334cb78dae66fdc31257a96ba15f7c41bde50 (patch)
treec8e5f290f8a9a674588e1d67f6a623debf9397f7 /tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp
parente5f8fd64a46ce61dac61fd50095a27cfd94930b5 (diff)
downloadComputeLibrary-0a8334cb78dae66fdc31257a96ba15f7c41bde50.tar.gz
COMPMID-400 Add support for 16 bit fixed point arithmetic.
Change-Id: Iebfaef1b219d80d6362b7fd4b1357612b31e43cb Reviewed-on: http://mpd-gerrit.cambridge.arm.com/77749 Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp')
-rw-r--r--tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp b/tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp
index 3308f7d855..ab63cbe76f 100644
--- a/tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp
+++ b/tests/validation/NEON/Fixedpoint/Invsqrt_QS8.cpp
@@ -49,7 +49,7 @@ using namespace arm_compute::test::validation;
namespace
{
-const float tolerance = 3; /**< Tolerance value for comparing reference's output against implementation's output */
+const float tolerance = 4.0f; /**< Tolerance value for comparing reference's output against implementation's output */
/** Compute Neon inverse square root function for signed 8bit fixed point.
*
@@ -78,9 +78,8 @@ Tensor compute_invsqrt_qs8(const TensorShape &shape, int fixed_point_position)
BOOST_TEST(!src.info()->is_resizable());
BOOST_TEST(!dst.info()->is_resizable());
- // Fill tensors. Keep the range between (32, 127) so the result won't
- // overflow. E.g. for Q2.5 invsqrt(0.001) = 31.6, which cannot be represented.
- std::uniform_int_distribution<> distribution(32, 127);
+ // Fill tensors. Keep the range between [1, 127).
+ std::uniform_int_distribution<> distribution(1, 127);
library->fill(NEAccessor(src), distribution, 0);
Iterator input(&src, window);
@@ -89,7 +88,7 @@ Tensor compute_invsqrt_qs8(const TensorShape &shape, int fixed_point_position)
execute_window_loop(window, [&](const Coordinates & id)
{
qint8x16_t in = vld1q_s8(reinterpret_cast<const qint8_t *>(input.ptr()));
- vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()), vinvsqrtq_qs8(in, fixed_point_position));
+ vst1q_s8(reinterpret_cast<qint8_t *>(output.ptr()), vqinvsqrtq_qs8(in, fixed_point_position));
},
input, output);