From d616cb906e6fb7eda3d1527c0ac3d630fc1c71c7 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Wed, 27 Sep 2017 10:07:45 +0100 Subject: COMPMID-510: Cleaned up Warp tests. Change-Id: I8e3fece5b786b5529e8f1320fb5794e43756ec4a Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89274 Tested-by: Kaizen Reviewed-by: Georgios Pinitas Reviewed-by: Anthony Barbier --- tests/validation/CPP/Utils.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests/validation/CPP') 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 -inline void fill_warp_matrix(std::array &matrix, int cols, int rows) +inline void fill_warp_matrix(std::array &matrix) { std::mt19937 gen(library.get()->seed()); std::uniform_real_distribution 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; } } -- cgit v1.2.1