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>
diff --git a/src/core/helpers/WindowHelpers.h b/src/core/helpers/WindowHelpers.h
index 9bc2135..9216c33 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 @@
/** 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 @@
*/
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