From 0a66abec3723f7dd655a118cf2969db59b37f171 Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Mon, 12 Apr 2021 16:44:24 +0100 Subject: Fix CLDepthwiseConvolutionLayer QSYMM8_PER_CHANNEL mismatches Resolve COMPMID-4367 Signed-off-by: Giorgio Arena Change-Id: I5e65b62c2ca52cf65950c9c343864ef55b7122c3 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5407 Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/runtime/CL/functions/CLDepthwiseConvolutionLayer.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/runtime/CL/functions') 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(); } - 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(), -- cgit v1.2.1