From 5dc732e95b64c793e3204515df51b403d05e79bb Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Tue, 7 Feb 2023 09:46:53 +0000 Subject: Fix performance regression in Transposed Convolution Resolves: COMPMID-5849 Change-Id: I86f8bbc1f3a7c12c66d5ad8fcd74dd9e69629aa0 Signed-off-by: Gunes Bayir Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9102 Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins Tested-by: Arm Jenkins Dynamic-Fusion: Jakub Sujak --- src/runtime/CL/functions/CLDeconvolutionLayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/runtime/CL/functions') diff --git a/src/runtime/CL/functions/CLDeconvolutionLayer.cpp b/src/runtime/CL/functions/CLDeconvolutionLayer.cpp index 56e9dae45d..5c25cbafaf 100644 --- a/src/runtime/CL/functions/CLDeconvolutionLayer.cpp +++ b/src/runtime/CL/functions/CLDeconvolutionLayer.cpp @@ -150,10 +150,12 @@ DeconvolutionMethod CLDeconvolutionLayer::get_deconvolution_method(const ITensor const size_t idx_w = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); const size_t idx_h = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); + const size_t idx_n = get_data_layout_dimension_index(data_layout, DataLayoutDimension::BATCHES); + const size_t ofm = weights->tensor_shape()[idx_n]; if(weights->dimension(idx_w) != deconv_info.stride().first || weights->dimension(idx_h) != deconv_info.stride().second) { - if(input->data_layout() == DataLayout::NHWC) + if(input->data_layout() == DataLayout::NHWC && ofm <= 16) { return DeconvolutionMethod::DIRECT; } -- cgit v1.2.1