aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/CPP
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2017-09-27 10:07:45 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commitd616cb906e6fb7eda3d1527c0ac3d630fc1c71c7 (patch)
tree13eca21fcf5b6ee2bdb2703549f1d258fbd9eae5 /tests/validation/CPP
parentdaec1aa17a27b5b10ae9bcda66cc51d708da4da9 (diff)
downloadComputeLibrary-d616cb906e6fb7eda3d1527c0ac3d630fc1c71c7.tar.gz
COMPMID-510: Cleaned up Warp tests.
Change-Id: I8e3fece5b786b5529e8f1320fb5794e43756ec4a Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89274 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/validation/CPP')
-rw-r--r--tests/validation/CPP/Utils.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/validation/CPP/Utils.h b/tests/validation/CPP/Utils.h
index 38fd924afc..0733411462 100644
--- a/tests/validation/CPP/Utils.h
+++ b/tests/validation/CPP/Utils.h
@@ -106,21 +106,18 @@ RawTensor transpose(const RawTensor &src, int chunk_width = 1);
* @param[in,out] matrix Matrix
*/
template <std::size_t SIZE>
-inline void fill_warp_matrix(std::array<float, SIZE> &matrix, int cols, int rows)
+inline void fill_warp_matrix(std::array<float, SIZE> &matrix)
{
std::mt19937 gen(library.get()->seed());
std::uniform_real_distribution<float> dist(-1, 1);
-
- for(int v = 0, r = 0; r < rows; ++r)
+ for(auto &x : matrix)
{
- for(int c = 0; c < cols; ++c, ++v)
- {
- matrix[v] = dist(gen);
- }
+ x = dist(gen);
}
if(SIZE == 9)
{
- matrix[(cols * rows) - 1] = 1;
+ // This is only used in Warp Perspective, we set M[3][3] = 1 so that Z0 is not 0 and we avoid division by 0.
+ matrix[8] = 1.f;
}
}