From 32af1f8ed8466647abb4f0532c70f72530a1a9ca Mon Sep 17 00:00:00 2001 From: John Richardson Date: Tue, 5 Jun 2018 12:47:20 +0100 Subject: COMPMID-761: Add CL/NEON Convolution benchmark tests Change-Id: I684baff3bfdff2244e04facd2d85d84609b7caff Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/134769 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- tests/validation/fixtures/ConvolutionFixture.h | 43 ++------------------------ 1 file changed, 2 insertions(+), 41 deletions(-) (limited to 'tests/validation') diff --git a/tests/validation/fixtures/ConvolutionFixture.h b/tests/validation/fixtures/ConvolutionFixture.h index 8ebb924c65..741ebe5eb9 100644 --- a/tests/validation/fixtures/ConvolutionFixture.h +++ b/tests/validation/fixtures/ConvolutionFixture.h @@ -66,56 +66,17 @@ protected: if(is_separable) { - create_separable_conv(conv.data()); + init_separable_conv(conv.data(), width, height, library->seed()); } else { - create_conv(conv.data()); + init_conv(conv.data(), width, height, library->seed()); } _target = compute_target(shape, output_data_type, conv.data(), scale, border_mode, constant_border_value); _reference = compute_reference(shape, output_data_type, conv.data(), scale, border_mode, constant_border_value); } - void - create_conv(int16_t *conv) - { - std::mt19937 gen(library->seed()); - std::uniform_int_distribution distribution_int16(-32768, 32767); - - for(unsigned int i = 0; i < _width * _height; ++i) - { - conv[i] = distribution_int16(gen); - } - } - - void - create_separable_conv(int16_t *conv) - { - std::mt19937 gen(library->seed()); - // Set it between -128 and 127 to ensure the matrix does not overflow - std::uniform_int_distribution distribution_int16(-128, 127); - - int16_t conv_row[_width]; - int16_t conv_col[_height]; - - conv_row[0] = conv_col[0] = 1; - for(unsigned int i = 1; i < _width; ++i) - { - conv_row[i] = distribution_int16(gen); - conv_col[i] = distribution_int16(gen); - } - - // Multiply two matrices - for(unsigned int i = 0; i < _width; ++i) - { - for(unsigned int j = 0; j < _height; ++j) - { - conv[i * _width + j] = conv_col[i] * conv_row[j]; - } - } - } - template void fill(U &&tensor, int i) { -- cgit v1.2.1