aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/WarpAffineFixture.h
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2018-08-07 11:23:54 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commitd8b03dd029261091e34dd8831d546299c60ce094 (patch)
treeced5c96940aa018f0a5a5a3a5fb0769d8dadcd1e /tests/validation/fixtures/WarpAffineFixture.h
parent7da6dcfc199580828dbedfed15afdcc7a789192c (diff)
downloadComputeLibrary-d8b03dd029261091e34dd8831d546299c60ce094.tar.gz
MLCE-13: Sanitizing matrix argument in the Warp.
This changes help to prevent errors like passing a matrix with less elements than required into the warp functions. Change-Id: I863f933a5e0568258717cffed3a20788d3d03083 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143044 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/fixtures/WarpAffineFixture.h')
-rw-r--r--tests/validation/fixtures/WarpAffineFixture.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/validation/fixtures/WarpAffineFixture.h b/tests/validation/fixtures/WarpAffineFixture.h
index c027072a13..3cbf86f92d 100644
--- a/tests/validation/fixtures/WarpAffineFixture.h
+++ b/tests/validation/fixtures/WarpAffineFixture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -55,11 +55,11 @@ public:
uint8_t constant_border_value = distribution_u8(gen);
// Create the matrix
- std::array<float, 6> matrix{ {} };
- fill_warp_matrix<6>(matrix);
+ std::array<float, 9> matrix{ {} };
+ fill_warp_matrix<9>(matrix);
- _target = compute_target(shape, data_type, matrix.data(), policy, border_mode, constant_border_value);
- _reference = compute_reference(shape, data_type, matrix.data(), policy, border_mode, constant_border_value);
+ _target = compute_target(shape, data_type, matrix, policy, border_mode, constant_border_value);
+ _reference = compute_reference(shape, data_type, matrix, policy, border_mode, constant_border_value);
}
protected:
@@ -69,7 +69,7 @@ protected:
library->fill_tensor_uniform(tensor, 0);
}
- TensorType compute_target(const TensorShape &shape, DataType data_type, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
+ TensorType compute_target(const TensorShape &shape, DataType data_type, const std::array<float, 9> &matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
{
// Create tensors
TensorType src = create_tensor<TensorType>(shape, data_type);
@@ -97,7 +97,7 @@ protected:
return dst;
}
- SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, const float *matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
+ SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, const std::array<float, 9> &matrix, InterpolationPolicy policy, BorderMode border_mode, uint8_t constant_border_value)
{
// Create reference
SimpleTensor<T> src{ shape, data_type };
@@ -108,7 +108,7 @@ protected:
// Fill reference
fill(src);
- return reference::warp_affine<T>(src, _valid_mask, matrix, policy, border_mode, constant_border_value);
+ return reference::warp_affine<T>(src, _valid_mask, matrix.data(), policy, border_mode, constant_border_value);
}
TensorType _target{};