aboutsummaryrefslogtreecommitdiff
path: root/src/core/helpers/WindowHelpers.h
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2022-09-09 15:39:05 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2022-09-14 17:04:27 +0000
commit0d05b6690fe69c57f63ca43d59b551f074613062 (patch)
tree497965914895a34035399a12d9e325518454a31b /src/core/helpers/WindowHelpers.h
parent5687e55250613417c151864cb74229fc91ea6462 (diff)
downloadComputeLibrary-0d05b6690fe69c57f63ca43d59b551f074613062.tar.gz
Interpreting tensor as 1D for CPU multiplication
* Also fix a bug in mul_U8_U8_U8. Resolves: COMPMID-5460 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ie1edafeae7aaad91164caeeb04661a8974a7fc1b Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8244 Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/helpers/WindowHelpers.h')
-rw-r--r--src/core/helpers/WindowHelpers.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/helpers/WindowHelpers.h b/src/core/helpers/WindowHelpers.h
index 28c39ccd82..c9e5a135c0 100644
--- a/src/core/helpers/WindowHelpers.h
+++ b/src/core/helpers/WindowHelpers.h
@@ -176,6 +176,19 @@ inline Window calculate_max_enlarged_window(const ITensorInfo &info, const Steps
return calculate_max_enlarged_window(info.valid_region(), steps, border_size);
}
+/** Calculate the squashed or maximum window for the given tensor shapes.
+ *
+ * If the tensor data resides continuously in the memory, the tensor can be interpreted
+ * as 1D array and all the dimensions can be squashed together into the x-dimension.
+ * Otherwise, generate the max window for the given tensor shapes.
+ *
+ * @param[in] src0 Tensor info object defining the shape of the first input tensor.
+ * @param[in] src1 Tensor info object defining the shape of the second input tensor.
+ *
+ * @return The squashed or maximum window the kernel can be executed on and the preferred split dimension.
+ */
+std::pair<Window, size_t> calculate_squashed_or_max_window(const ITensorInfo &src0, const ITensorInfo &src1);
+
/** Function to compute the shape of output and window for the given inputs
*
* @param[in] infos Input tensor informations