diff options
author | Pablo Marquez Tello <pablo.tello@arm.com> | 2023-01-09 17:21:01 +0000 |
---|---|---|
committer | Pablo Marquez Tello <pablo.tello@arm.com> | 2023-02-08 11:05:08 +0000 |
commit | 4e2bbbbb23e6f4bd452f7f865e51228e1f51efec (patch) | |
tree | 36469f45f17d94f13bc1206e3a5975ba6cbccad5 /src/core/NEON/kernels/assembly/depthwise_common.hpp | |
parent | fbe94da93b5be8745727ba7624b3d011e2bfa383 (diff) | |
download | ComputeLibrary-4e2bbbbb23e6f4bd452f7f865e51228e1f51efec.tar.gz |
Add support for dilation > 1 in assembly DepthwiseConvolution
* Resolve COMPMID-5689
Change-Id: I81a3791ad054db59562b76d1c729f2b2168aee8b
Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com>
Signed-off-by: Andrew Mundy <andrew.mundy@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8919
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/assembly/depthwise_common.hpp')
-rw-r--r-- | src/core/NEON/kernels/assembly/depthwise_common.hpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/core/NEON/kernels/assembly/depthwise_common.hpp b/src/core/NEON/kernels/assembly/depthwise_common.hpp index 52963ab357..fea6326897 100644 --- a/src/core/NEON/kernels/assembly/depthwise_common.hpp +++ b/src/core/NEON/kernels/assembly/depthwise_common.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. + * Copyright (c) 2021-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,8 @@ #include "arm_gemm.hpp" #include "common.hpp" +#include <cstddef> +#include <tuple> namespace arm_conv { @@ -64,6 +66,9 @@ class IDepthwiseCommon public: virtual ~IDepthwiseCommon() = default; + // Get the name of the depthwise implementation + virtual std::string name() const = 0; + // Determine the amount of storage space required for the rearranged weights // and bias. virtual size_t get_storage_size(void) const = 0; @@ -127,5 +132,25 @@ public: unsigned int n_threads) const = 0; }; +// To handle a dilation factor of D execute the kernel once for each d in +// [0..D). Each `d` corresponds to a portion or "view" of the input and output +// tensors. The output view corresponds to every Dth pixel starting from `d`; +// this function computes how many pixels are covered. The input view consists +// of an amount of before padding, every Dth pixel starting from an offset, and +// some after padding. This function computes the start padding, input offset, +// number of valid input pixels, and the after padding. +// +// Returns +// - Number of valid output pixels corresponding to `d` +// - Number of valid input pixels corresponding to `d` +// - Offset of the first pixel corresponding to `d` +// - Amount of padding in the view for `d` +std::tuple<size_t, size_t, size_t, size_t, size_t> +get_reduced_view_for_dilation( + size_t out_size, size_t in_size, + size_t d, size_t dilation_factor, + size_t kernel_size, size_t stride, + size_t pad_before); + } // namespace depthwise } // namespace arm_conv |