|
1 | 1 | /* |
2 | | - * Copyright (c) 2017-2021, 2023 Arm Limited. |
| 2 | + * Copyright (c) 2017-2021, 2023, 2026 Arm Limited. |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: MIT |
5 | 5 | * |
@@ -214,8 +214,9 @@ void ClGemmConv2d::configure(const CLCompileContext &compile_context, |
214 | 214 | _is_prepared = weights_info.retain_internal_weights(); |
215 | 215 | _is_quantized = is_data_type_quantized_asymmetric(src->data_type()); |
216 | 216 | _skip_im2col = (data_layout == DataLayout::NHWC && kernel_width == 1 && kernel_height == 1 && |
217 | | - conv2d_info.conv_info.stride().first == 1 && conv2d_info.conv_info.stride().second == 1); |
218 | | - _skip_col2im = data_layout == DataLayout::NHWC; |
| 217 | + conv2d_info.conv_info.stride().first == 1 && conv2d_info.conv_info.stride().second == 1) && |
| 218 | + !conv2d_info.conv_info.has_padding(); |
| 219 | + _skip_col2im = data_layout == DataLayout::NHWC; |
219 | 220 |
|
220 | 221 | // Only for quantize there are few cases where we cannot fuse the activation function in GEMM |
221 | 222 | _fuse_activation = true; |
@@ -419,10 +420,12 @@ Status ClGemmConv2d::validate(const ITensorInfo *src, |
419 | 420 | const ITensorInfo *gemm_output_to_use = dst; |
420 | 421 | const ITensorInfo *weights_to_use = weights; |
421 | 422 | const bool is_quantized = is_data_type_quantized_asymmetric(data_type); |
422 | | - const bool skip_im2col = (data_layout == DataLayout::NHWC && kernel_width == 1 && kernel_height == 1 && |
423 | | - conv2d_info.conv_info.stride().first == 1 && conv2d_info.conv_info.stride().second == 1); |
424 | | - const bool skip_col2im = data_layout == DataLayout::NHWC; |
425 | | - bool fuse_activation = true; |
| 423 | + const bool skip_im2col = |
| 424 | + (data_layout == DataLayout::NHWC && kernel_width == 1 && kernel_height == 1 && |
| 425 | + conv2d_info.conv_info.stride().first == 1 && conv2d_info.conv_info.stride().second == 1) && |
| 426 | + !conv2d_info.conv_info.has_padding(); |
| 427 | + const bool skip_col2im = data_layout == DataLayout::NHWC; |
| 428 | + bool fuse_activation = true; |
426 | 429 |
|
427 | 430 | ARM_COMPUTE_RETURN_ERROR_ON((weights->dimension(idx_channel) * conv2d_info.num_groups) != |
428 | 431 | src->dimension(idx_channel)); |
|
0 commit comments