aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/RemapFixture.h
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-01-23 08:31:41 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:45:00 +0000
commitfc1ffe626278e75ba11c803280a6ef46a5bd1ad6 (patch)
tree4572cd84868fe0322884113b85575bff942ae924 /tests/validation/fixtures/RemapFixture.h
parent4df057551194ba079731f097ce840cc320353199 (diff)
downloadComputeLibrary-fc1ffe626278e75ba11c803280a6ef46a5bd1ad6.tar.gz
COMPMID-837: Fixed remap tests failures in Valgrind.
Some minor improvements in the test fixture, for example making sure the values in the mapx and mapy tensors are in the range of [-5, in_width+5] and [-5,in_height]. Tolerance was changed to 0, no mismatches expected. Change-Id: I2fad06defb293bf9fdd1988799b19547c102dee5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118044 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/fixtures/RemapFixture.h')
-rw-r--r--tests/validation/fixtures/RemapFixture.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/validation/fixtures/RemapFixture.h b/tests/validation/fixtures/RemapFixture.h
index 846ebf44a2..78b30151ac 100644
--- a/tests/validation/fixtures/RemapFixture.h
+++ b/tests/validation/fixtures/RemapFixture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -50,7 +50,7 @@ public:
{
std::mt19937 gen(library->seed());
std::uniform_int_distribution<uint8_t> distribution(0, 255);
- T constant_border_value = static_cast<T>(distribution(gen));
+ const T constant_border_value = static_cast<T>(distribution(gen));
_target = compute_target(shape, policy, data_type, border_mode, constant_border_value);
_reference = compute_reference(shape, policy, data_type, border_mode, constant_border_value);
@@ -58,9 +58,10 @@ public:
protected:
template <typename U>
- void fill(U &&tensor, int i)
+ void fill(U &&tensor, int i, float min, float max)
{
- library->fill_tensor_uniform(tensor, i);
+ std::uniform_int_distribution<> distribution((int)min, (int)max);
+ library->fill(tensor, distribution, i);
}
TensorType compute_target(const TensorShape &shape, InterpolationPolicy policy, DataType data_type, BorderMode border_mode, T constant_border_value)
@@ -92,9 +93,9 @@ protected:
ARM_COMPUTE_EXPECT(!dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Fill tensors
- fill(AccessorType(src), 0);
- fill(AccessorType(map_x), 1);
- fill(AccessorType(map_y), 2);
+ fill(AccessorType(src), 0, 0, 255);
+ fill(AccessorType(map_x), 1, -5, shape.x() + 5);
+ fill(AccessorType(map_y), 2, -5, shape.y() + 5);
// Compute function
remap.run();
@@ -115,9 +116,9 @@ protected:
_valid_mask = SimpleTensor<T> { shape, data_type };
// Fill reference
- fill(src, 0);
- fill(map_x, 1);
- fill(map_y, 2);
+ fill(src, 0, 0, 255);
+ fill(map_x, 1, -5, shape.x() + 5);
+ fill(map_y, 2, -5, shape.y() + 5);
// Compute reference
return reference::remap<T>(src, map_x, map_y, _valid_mask, policy, border_mode, constant_border_value);