aboutsummaryrefslogtreecommitdiff
path: root/src/core/helpers/WindowHelpers.h
diff options
context:
space:
mode:
authorSiCongLi <sicong.li@arm.com>2021-02-22 14:28:33 +0000
committerSiCong Li <sicong.li@arm.com>2021-03-08 09:39:03 +0000
commitc7b1e84ac5f3ada1b2f78c66979ef4d44804a955 (patch)
tree3f2dd18121727cf8000a84ed0030523ce7c0e91e /src/core/helpers/WindowHelpers.h
parentb861074c74ea99222207a4a0a71954f8852f8704 (diff)
downloadComputeLibrary-c7b1e84ac5f3ada1b2f78c66979ef4d44804a955.tar.gz
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 <sicong.li@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5202 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/helpers/WindowHelpers.h')
-rw-r--r--src/core/helpers/WindowHelpers.h15
1 files changed, 13 insertions, 2 deletions
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
*
@@ -107,6 +107,17 @@ Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps
/** 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.
* @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.
@@ -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