aboutsummaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2017-06-28 11:32:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit997aba2dc6a0b5a8c3b424a31ae8370b395cf0d8 (patch)
treed0c12ba56607ae788c07880875bae39f8960030f /tests/validation
parent7b7858df42fccefbe6eb086ad516d5c011becd07 (diff)
downloadComputeLibrary-997aba2dc6a0b5a8c3b424a31ae8370b395cf0d8.tar.gz
COMPMID-421: Fixed a problem in Convolution Layer reference values for FP16.
All methods in std::numeric_limits<float16_t> return 0. Change-Id: I2289e01853e1b2c38afdec119ef6fc8af8a9752e Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79312 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/NEON/ConvolutionLayer.cpp9
-rw-r--r--tests/validation/Reference.cpp2
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/validation/NEON/ConvolutionLayer.cpp b/tests/validation/NEON/ConvolutionLayer.cpp
index 40c1e2e969..d81834bd57 100644
--- a/tests/validation/NEON/ConvolutionLayer.cpp
+++ b/tests/validation/NEON/ConvolutionLayer.cpp
@@ -42,7 +42,10 @@ using namespace arm_compute::test::validation;
namespace
{
const float tolerance_f32 = 1e-03f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-const float tolerance_qs8 = 3.0f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::QS8 */
+#ifdef ARM_COMPUTE_ENABLE_FP16
+const float tolerance_f16 = 0.01f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
+#endif
+const float tolerance_qs8 = 3.0f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::QS8 */
Tensor compute_convolution_layer(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &bias_shape, const TensorShape &output_shape, DataType dt,
const PadStrideInfo &conv_info, int fixed_point_position)
@@ -69,7 +72,7 @@ Tensor compute_convolution_layer(const TensorShape &input_shape, const TensorSha
BOOST_TEST(!dst.info()->is_resizable());
// Fill tensors
- if(dt == DataType::F32)
+ if(dt == DataType::F16 || dt == DataType::F32)
{
std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
library->fill(NEAccessor(src), distribution, 0);
@@ -144,7 +147,7 @@ BOOST_DATA_TEST_CASE(SmallConvolutionLayer,
RawTensor ref_dst = Reference::compute_reference_convolution_layer(conv_set.src_shape, conv_set.weights_shape, conv_set.bias_shape, conv_set.dst_shape, dt, conv_set.info, 0);
// Validate output
- validate(NEAccessor(dst), ref_dst, tolerance_f32);
+ validate(NEAccessor(dst), ref_dst, tolerance_f16);
}
BOOST_AUTO_TEST_SUITE_END()
#endif
diff --git a/tests/validation/Reference.cpp b/tests/validation/Reference.cpp
index 2388fb6fe3..0518819173 100644
--- a/tests/validation/Reference.cpp
+++ b/tests/validation/Reference.cpp
@@ -506,7 +506,7 @@ RawTensor Reference::compute_reference_convolution_layer(const TensorShape &inpu
RawTensor ref_dst = library->get(output_shape, dt, 1, fixed_point_position);
// Fill reference
- if(dt == DataType::F32)
+ if(dt == DataType::F16 || dt == DataType::F32)
{
std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
library->fill(ref_src, distribution, 0);