aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-08-16 14:14:39 +0100
committerRamy Elgammal <ramy.elgammal@arm.com>2023-08-17 15:01:01 +0100
commit1a4ae04ed1918352864909c955da93b435f0ef9b (patch)
tree13e86f75c741bd84c685db4f854e6421213d54eb
parent0c854246295638275d808be564ea1be5a5520412 (diff)
downloadComputeLibrary-1a4ae04ed1918352864909c955da93b435f0ef9b.tar.gz
Fix depthwise convolution not using assembly kernel
* Take dilation into account when checking padding. Resolves: COMPMID-6348 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I897a13ba7f37382733c35c1701d1ec310ed55331 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10147 Reviewed-by: SiCong Li <sicong.li@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/cpu/kernels/internal/CpuDepthwiseConv2dAssemblyWrapperKernel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cpu/kernels/internal/CpuDepthwiseConv2dAssemblyWrapperKernel.cpp b/src/cpu/kernels/internal/CpuDepthwiseConv2dAssemblyWrapperKernel.cpp
index e092c836af..b503a8b734 100644
--- a/src/cpu/kernels/internal/CpuDepthwiseConv2dAssemblyWrapperKernel.cpp
+++ b/src/cpu/kernels/internal/CpuDepthwiseConv2dAssemblyWrapperKernel.cpp
@@ -306,11 +306,15 @@ Status CpuDepthwiseConv2dAssemblyWrapperKernel::validate(const ITensorInfo *src,
// Assembly kernels cannot work with padding greater than the kernel.
const auto &padding = info.pad_stride_info;
+ const auto &dilation = info.dilation;
const auto &wei_shape = weights->tensor_shape();
+ const auto dilated_wei_w = wei_shape[1] + (wei_shape[1] - 1) * (dilation.x() - 1);
+ const auto dilated_wei_h = wei_shape[2] + (wei_shape[2] - 1) * (dilation.y() - 1);
+
ARM_COMPUTE_RETURN_ERROR_ON(
- padding.pad_top() >= wei_shape[2] || padding.pad_bottom() >= wei_shape[2] ||
- padding.pad_left() >= wei_shape[1] || padding.pad_right() >= wei_shape[1]
+ padding.pad_left() >= dilated_wei_w || padding.pad_right() >= dilated_wei_w ||
+ padding.pad_top() >= dilated_wei_h || padding.pad_bottom() >= dilated_wei_h
);
return Status{};