From c7b1e84ac5f3ada1b2f78c66979ef4d44804a955 Mon Sep 17 00:00:00 2001 From: SiCongLi Date: Mon, 22 Feb 2021 14:28:33 +0000 Subject: Remove usage of valid window region in NHWC CPU kernels - Part1 Replace all calculate_max_window(ValidRegion, ...) with calculate_max_window(TensorShape, ...) in CPU kernels Resolves COMPMID-4152 (1/2) Change-Id: I7403ea6b24b9e7889890839142a06439d6c8a499 Signed-off-by: SiCongLi Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5202 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- src/core/helpers/WindowHelpers.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/core/helpers/WindowHelpers.h') diff --git a/src/core/helpers/WindowHelpers.h b/src/core/helpers/WindowHelpers.h index 9bc2135b6d..9216c33f16 100644 --- a/src/core/helpers/WindowHelpers.h +++ b/src/core/helpers/WindowHelpers.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020 Arm Limited. +* Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -105,6 +105,17 @@ ValidRegion intersect_valid_regions(const Ts &... regions) */ Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps = Steps(), bool skip_border = false, BorderSize border_size = BorderSize()); +/** Calculate the maximum window for a given tensor shape and border setting + * + * @param[in] shape Shape of the tensor space + * @param[in] steps (Optional) Number of elements processed for each step. + * @param[in] skip_border (Optional) If true exclude the border region from the window. + * @param[in] border_size (Optional) Border size. + * + * @return The maximum window the kernel can be executed on. + */ +Window calculate_max_window(const TensorShape &shape, const Steps &steps = Steps(), bool skip_border = false, BorderSize border_size = BorderSize()); + /** Calculate the maximum window for a given tensor shape and border setting * * @param[in] info Tensor info object defining the shape of the object for which the window is created. @@ -116,7 +127,7 @@ Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps */ inline Window calculate_max_window(const ITensorInfo &info, const Steps &steps = Steps(), bool skip_border = false, BorderSize border_size = BorderSize()) { - return calculate_max_window(info.valid_region(), steps, skip_border, border_size); + return calculate_max_window(info.tensor_shape(), steps, skip_border, border_size); } /** Calculate the maximum window used by a horizontal kernel for a given tensor shape and border setting -- cgit v1.2.1