aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-02-05 14:59:54 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:46:07 +0000
commit5ae9b694e5d154a2ab3ec0d448394eb5de49368e (patch)
tree05268ad5b73e372435b9db7fa6571d6eb64b86c5
parent54f18c4a7a20ff697dc1ba66a73e9d622a407d02 (diff)
downloadComputeLibrary-5ae9b694e5d154a2ab3ec0d448394eb5de49368e.tar.gz
COMPMID-885 Valgrind NEConvolutionSquare::configure relies on uninitialised values
Change-Id: I7a9a694064db8a92b2f8d4ea46e42070da6ed15a Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118904 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
-rw-r--r--tests/validation/NEON/Convolution.cpp12
-rw-r--r--tests/validation/fixtures/ConvolutionFixture.h10
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/validation/NEON/Convolution.cpp b/tests/validation/NEON/Convolution.cpp
index 32df51abba..5545b7f574 100644
--- a/tests/validation/NEON/Convolution.cpp
+++ b/tests/validation/NEON/Convolution.cpp
@@ -66,7 +66,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
Tensor dst = create_tensor<Tensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[9];
+ int16_t conv[9] = {};
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
@@ -150,7 +150,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
Tensor dst = create_tensor<Tensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[25];
+ int16_t conv[25] = {};
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
@@ -234,7 +234,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
Tensor dst = create_tensor<Tensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[49];
+ int16_t conv[49] = {};
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
@@ -318,7 +318,7 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combi
Tensor dst = create_tensor<Tensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[81];
+ int16_t conv[81] = {};
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
@@ -404,14 +404,14 @@ shape, output_data_type, border_mode, filter_width, filter_height)
Tensor dst = create_tensor<Tensor>(shape, output_data_type);
// Create conv matrix
- int16_t conv[filter_width * filter_height];
+ std::vector<int16_t> conv(filter_height * filter_width);
ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
// Create and configure function
NEConvolutionRectangle convolution;
- convolution.configure(&src, &dst, conv, filter_width, filter_height, 1, border_mode);
+ convolution.configure(&src, &dst, conv.data(), filter_width, filter_height, 1, border_mode);
// Validate valid region
const ValidRegion dst_valid_region = shape_to_valid_region(shape, (border_mode == BorderMode::UNDEFINED), BorderSize(filter_height / 2, filter_width / 2));
diff --git a/tests/validation/fixtures/ConvolutionFixture.h b/tests/validation/fixtures/ConvolutionFixture.h
index 4d0d7a2a6f..8ebb924c65 100644
--- a/tests/validation/fixtures/ConvolutionFixture.h
+++ b/tests/validation/fixtures/ConvolutionFixture.h
@@ -59,22 +59,22 @@ protected:
ARM_COMPUTE_ERROR_ON(3 != width && 5 != width && 7 != width && 9 != width);
ARM_COMPUTE_ERROR_ON(3 != height && 5 != height && 7 != height && 9 != height);
- int16_t conv[width * height];
+ std::vector<int16_t> conv(width * height);
_width = width;
_height = height;
if(is_separable)
{
- create_separable_conv(conv);
+ create_separable_conv(conv.data());
}
else
{
- create_conv(conv);
+ create_conv(conv.data());
}
- _target = compute_target(shape, output_data_type, conv, scale, border_mode, constant_border_value);
- _reference = compute_reference(shape, output_data_type, conv, scale, border_mode, constant_border_value);
+ _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