aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-04-12 16:44:24 +0100
committerGiorgio Arena <giorgio.arena@arm.com>2021-04-12 18:51:33 +0000
commit0a66abec3723f7dd655a118cf2969db59b37f171 (patch)
tree4dffc6812dafabe89e6bbde15adab84485b056b6
parent0b76f7dd12240dc7a546c202ee80a7942d9898cd (diff)
downloadComputeLibrary-0a66abec3723f7dd655a118cf2969db59b37f171.tar.gz
Fix CLDepthwiseConvolutionLayer QSYMM8_PER_CHANNEL mismatches
Resolve COMPMID-4367 Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Change-Id: I5e65b62c2ca52cf65950c9c343864ef55b7122c3 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5407 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h3
-rw-r--r--src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp13
2 files changed, 9 insertions, 7 deletions
diff --git a/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h
index 8e594bc09f..e2c5d683cf 100644
--- a/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h
+++ b/arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -231,6 +231,7 @@ private:
bool _needs_weights_reshape;
bool _is_prepared;
bool _is_quantized;
+ bool _is_nhwc;
};
/** Basic function to execute a generic depthwise convolution. This function calls the following OpenCL kernels:
diff --git a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
index 5ed8aa98c9..f7517a50a3 100644
--- a/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
+++ b/src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp
@@ -366,7 +366,8 @@ CLDepthwiseConvolutionLayer::CLDepthwiseConvolutionLayerInternal3x3::CLDepthwise
_needs_permute(false),
_needs_weights_reshape(false),
_is_prepared(false),
- _is_quantized(false)
+ _is_quantized(false),
+ _is_nhwc(false)
{
}
@@ -394,10 +395,10 @@ void CLDepthwiseConvolutionLayer::CLDepthwiseConvolutionLayerInternal3x3::config
gpu_target,
dilation));
- const bool is_nhwc = input->info()->data_layout() == DataLayout::NHWC;
+ _is_nhwc = input->info()->data_layout() == DataLayout::NHWC;
_is_quantized = is_data_type_quantized_asymmetric(input->info()->data_type());
- _needs_permute = is_nhwc && (depth_multiplier > 1);
- _needs_weights_reshape = is_nhwc && (depth_multiplier == 1) && _is_quantized;
+ _needs_permute = _is_nhwc && (depth_multiplier > 1);
+ _needs_weights_reshape = _is_nhwc && (depth_multiplier == 1) && _is_quantized;
_is_prepared = false;
_original_weights = weights;
@@ -437,7 +438,7 @@ void CLDepthwiseConvolutionLayer::CLDepthwiseConvolutionLayerInternal3x3::config
_kernel = std::make_unique<CLDepthwiseConvolutionLayer3x3NCHWKernel>();
}
- else if(is_nhwc)
+ else if(_is_nhwc)
{
if(_needs_weights_reshape)
{
@@ -529,7 +530,7 @@ void CLDepthwiseConvolutionLayer::CLDepthwiseConvolutionLayerInternal3x3::prepar
{
_output_multipliers.map();
_output_shifts.map();
- const unsigned int idx_ofms = _needs_permute ? 2 : 0;
+ const unsigned int idx_ofms = _is_nhwc ? 0 : 2;
quantization::compute_quantized_multipliers_and_shifts(_input->info(),
_original_weights->info(),
_output->info(),