From 83be745adba7a9928c03beda65a6a83f14846475 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Tue, 29 Aug 2017 13:47:03 +0100 Subject: COMPMID-424 Implemented reference implementation and tests for WarpAffine Change-Id: I4924ab1de17adc3b880a5cc22f2497abbc8e221b Reviewed-on: http://mpd-gerrit.cambridge.arm.com/85820 Tested-by: Kaizen Reviewed-by: Steven Niu --- tests/validation/CPP/Utils.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests/validation/CPP/Utils.h') diff --git a/tests/validation/CPP/Utils.h b/tests/validation/CPP/Utils.h index 91d1afe1d7..e9a0f09847 100644 --- a/tests/validation/CPP/Utils.h +++ b/tests/validation/CPP/Utils.h @@ -100,6 +100,32 @@ void apply_2d_spatial_filter(Coordinates coord, const SimpleTensor &src, Simp } RawTensor transpose(const RawTensor &src, int chunk_width = 1); + +/** Fill matrix random. + * + * @param[in,out] matrix Matrix + * @param[in] cols Columns (width) of matrix + * @param[in] rows Rows (height) of matrix + */ +template +inline void fill_warp_matrix(std::array &matrix, int cols, int rows) +{ + std::mt19937 gen(library.get()->seed()); + std::uniform_real_distribution dist(-1, 1); + + for(int v = 0, r = 0; r < rows; ++r) + { + for(int c = 0; c < cols; ++c, ++v) + { + matrix[v] = dist(gen); + } + } + if(SIZE == 9) + { + matrix[(cols * rows) - 1] = 1; + } +} + } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1