aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2018-02-02 11:38:55 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:45:42 +0000
commitb7e3028a2bf81ca247895b8550f5a5da02d2483e (patch)
treec4728acce50fe3fab7a44a47199a965cd1c11b2b
parentf525eab6412053ccd8321af3e6cc2fbcb60ac65e (diff)
downloadComputeLibrary-b7e3028a2bf81ca247895b8550f5a5da02d2483e.tar.gz
COMPMID-890: Valgrind: NEON Convolution Layer validation fails
Change-Id: I5296815cf04e5f805d6523196567b6c01715c8b5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118711 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
-rw-r--r--src/runtime/NEON/functions/NEConvolutionLayer.cpp6
-rw-r--r--tests/benchmark/fixtures/ConvolutionLayerFixture.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp
index 598d350505..0f00f74fae 100644
--- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp
@@ -186,7 +186,7 @@ Status validate_and_initialize_values(const ITensorInfo *input, const ITensorInf
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_FIXED_POINT(input, weights);
ARM_COMPUTE_RETURN_ERROR_ON(!weights_info.are_reshaped() && weights->dimension(2) != input->dimension(2));
ARM_COMPUTE_RETURN_ERROR_ON(weights->num_dimensions() > 4);
- ARM_COMPUTE_ERROR_ON(weights_info.are_reshaped() && is_data_type_quantized_asymmetric(input->data_type()));
+ ARM_COMPUTE_RETURN_ERROR_ON(weights_info.are_reshaped() && is_data_type_quantized_asymmetric(input->data_type()));
dt = input->data_type();
is_quantized = is_data_type_quantized_asymmetric(dt);
@@ -195,11 +195,11 @@ Status validate_and_initialize_values(const ITensorInfo *input, const ITensorInf
{
if(is_quantized)
{
- ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::S32);
+ ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::S32);
}
else
{
- ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases);
+ ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases);
}
ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_FIXED_POINT(input, biases);
ARM_COMPUTE_RETURN_ERROR_ON(!weights_info.are_reshaped() && biases->dimension(0) != weights->dimension(3));
diff --git a/tests/benchmark/fixtures/ConvolutionLayerFixture.h b/tests/benchmark/fixtures/ConvolutionLayerFixture.h
index 0d2c3fd955..7dc7de0dc1 100644
--- a/tests/benchmark/fixtures/ConvolutionLayerFixture.h
+++ b/tests/benchmark/fixtures/ConvolutionLayerFixture.h
@@ -46,11 +46,12 @@ public:
const unsigned int fixed_point_position = 4;
src_shape.set(3 /* batch */, batches);
dst_shape.set(3 /* batch */, batches);
+ DataType bias_data_type = is_data_type_quantized_asymmetric(data_type) ? DataType::S32 : data_type;
// Create tensors
src = create_tensor<TensorType>(src_shape, data_type, 1, fixed_point_position);
weights = create_tensor<TensorType>(weights_shape, data_type, 1, fixed_point_position);
- biases = create_tensor<TensorType>(biases_shape, data_type, 1, fixed_point_position);
+ biases = create_tensor<TensorType>(biases_shape, bias_data_type, 1, fixed_point_position);
dst = create_tensor<TensorType>(dst_shape, data_type, 1, fixed_point_position);
// Create and configure function