aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Utils.h
diff options
context:
space:
mode:
authorramelg01 <ramy.elgammal@arm.com>2022-02-26 22:06:20 +0000
committerRamy Elgammal <ramy.elgammal@arm.com>2022-03-15 16:18:13 +0000
commit375156937a0783432c5d18e199b5d8d2b3ec33f7 (patch)
tree4c755770ac569c286179e5ce40df1c820baa73d8 /arm_compute/core/Utils.h
parent4e66d707a292b90a344e32c59eb1dacb67a0e4c1 (diff)
downloadComputeLibrary-375156937a0783432c5d18e199b5d8d2b3ec33f7.tar.gz
Implementation of ClPooling3d
- For NDHWC layout - For F16 and F32 data types - Mixed Precision stil not supported Resolves: COMPMID-4670 Signed-off-by: ramy.elgammal@arm.com Change-Id: I0e14a13e4625569e8e5ee67e6033bd1efe0da469 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7262 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/Utils.h')
-rw-r--r--arm_compute/core/Utils.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h
index 2d774770ae..a47cfbdec6 100644
--- a/arm_compute/core/Utils.h
+++ b/arm_compute/core/Utils.h
@@ -793,6 +793,23 @@ std::pair<int, int> scaled_dimensions_signed(int width, int height,
int kernel_width, int kernel_height,
const PadStrideInfo &pad_stride_info);
+/** Returns calculated width, height and depth of output scaled tensor depending on dimensions rounding mode.
+ *
+ * @param[in] width Width of input tensor
+ * @param[in] height Height of input tensor
+ * @param[in] depth Depth of input tensor
+ * @param[in] kernel_width Kernel width.
+ * @param[in] kernel_height Kernel height.
+ * @param[in] kernel_depth Kernel depth.
+ * @param[in] pool3d_info Pad and stride and round information for 3d pooling
+ *
+ * @return A tuple with the new width in the first position, the new height in the second, and the new depth in the third.
+ * Returned values can be < 1
+ */
+std::tuple<int, int, int> scaled_3d_dimensions_signed(int width, int height, int depth,
+ int kernel_width, int kernel_height, int kernel_depth,
+ const Pooling3dLayerInfo &pool3d_info);
+
/** Check if the given reduction operation should be handled in a serial way.
*
* @param[in] op Reduction operation to perform
@@ -893,6 +910,23 @@ const std::string &string_from_pooling_type(PoolingType type);
* @return True if the pool region is entirely outside the input tensor, False otherwise.
*/
bool is_pool_region_entirely_outside_input(const PoolingLayerInfo &info);
+/** Check if the 3d pool region is entirely outside the input tensor
+ *
+ * @param[in] info @ref Pooling3dLayerInfo to be checked.
+ *
+ * @return True if the pool region is entirely outside the input tensor, False otherwise.
+ */
+bool is_pool_3d_region_entirely_outside_input(const Pooling3dLayerInfo &info);
+/** Check if the 3D padding is symmetric i.e. padding in each opposite sides are euqal (left=right, top=bottom and front=back)
+ *
+ * @param[in] info @ref Padding3D input 3D padding object to check if it is symmetric
+ *
+ * @return True if padding is symmetric
+ */
+inline bool is_symmetric(const Padding3D& info)
+{
+ return ((info.left == info.right) && (info.top == info.bottom) && (info.front == info.back));
+}
/** Translates a given GEMMLowp output stage to a string.
*
* @param[in] output_stage @ref GEMMLowpOutputStageInfo to be translated to string.