From 375156937a0783432c5d18e199b5d8d2b3ec33f7 Mon Sep 17 00:00:00 2001 From: ramelg01 Date: Sat, 26 Feb 2022 22:06:20 +0000 Subject: 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 Reviewed-by: SiCong Li Reviewed-by: Gunes Bayir Tested-by: Arm Jenkins --- utils/TypePrinter.h | 194 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 78 deletions(-) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index 664a39d150..dae81e4a5a 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -2083,6 +2083,122 @@ inline std::string to_string(const PoolingLayerInfo &info) return str.str(); } +/** Formatted output of the Size3D type. + * + * @param[out] os Output stream + * @param[in] size Type to output + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const Size3D &size) +{ + os << size.width << "x" << size.height << "x" << size.depth; + + return os; +} + +/** Formatted output of the Size3D type. + * + * @param[in] type Type to output + * + * @return Formatted string. + */ +inline std::string to_string(const Size3D &type) +{ + std::stringstream str; + str << type; + return str.str(); +} + +/** Formatted output of the Padding3D type. + * + * @param[out] os Output stream. + * @param[in] padding3d Padding info for 3D spatial dimension shape. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const Padding3D &padding3d) +{ + os << padding3d.left << "," << padding3d.right << "," + << padding3d.top << "," << padding3d.bottom << "," + << padding3d.front << "," << padding3d.back; + return os; +} + +/** Converts a @ref Padding3D to string + * + * @param[in] padding3d Padding3D value to be converted + * + * @return String representing the corresponding Padding3D + */ +inline std::string to_string(const Padding3D &padding3d) +{ + std::stringstream str; + str << padding3d; + return str.str(); +} + +/** Formatted output of the DimensionRoundingType type. + * + * @param[out] os Output stream. + * @param[in] rounding_type DimensionRoundingType Dimension rounding type when down-scaling, or compute output shape of pooling(2D or 3D). + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const DimensionRoundingType &rounding_type) +{ + switch(rounding_type) + { + case DimensionRoundingType::CEIL: + os << "CEIL"; + break; + case DimensionRoundingType::FLOOR: + os << "FLOOR"; + break; + default: + ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); + } + return os; +} + +/** Formatted output of the Pooling 3d Layer Info. + * + * @param[out] os Output stream. + * @param[in] info Pooling 3D layer info to print to output stream. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const Pooling3dLayerInfo &info) +{ + os << "{Type=" << info.pool_type << "," + << "IsGlobalPooling=" << info.is_global_pooling; + if(!info.is_global_pooling) + { + os << "," + << "PoolSize=" << info.pool_size << ", " + << "Stride=" << info.stride << ", " + << "Padding=" << info.padding << ", " + << "Exclude Padding=" << info.exclude_padding << ", " + << "fp_mixed_precision=" << info.fp_mixed_precision << ", " + << "DimensionRoundingType=" << info.round_type; + } + os << "}"; + return os; +} + +/** Formatted output of the Pooling 3d Layer Info. + * + * @param[in] info Type to output. + * + * @return Formatted string. + */ +inline std::string to_string(const Pooling3dLayerInfo &info) +{ + std::stringstream str; + str << info; + return str.str(); +} + /** Formatted output of the PriorBoxLayerInfo. * * @param[in] info Type to output. @@ -2134,33 +2250,6 @@ inline std::string to_string(const Size2D &type) return str.str(); } -/** Formatted output of the Size3D type. - * - * @param[out] os Output stream - * @param[in] size Type to output - * - * @return Modified output stream. - */ -inline ::std::ostream &operator<<(::std::ostream &os, const Size3D &size) -{ - os << size.width << "x" << size.height << "x" << size.depth; - - return os; -} - -/** Formatted output of the Size2D type. - * - * @param[in] type Type to output - * - * @return Formatted string. - */ -inline std::string to_string(const Size3D &type) -{ - std::stringstream str; - str << type; - return str.str(); -} - /** Formatted output of the ConvolutionMethod type. * * @param[out] os Output stream @@ -3097,29 +3186,6 @@ inline std::string to_string(const BoxNMSLimitInfo &info) return str.str(); } -/** Formatted output of the DimensionRoundingType type. - * - * @param[out] os Output stream. - * @param[in] rounding_type DimensionRoundingType to output. - * - * @return Modified output stream. - */ -inline ::std::ostream &operator<<(::std::ostream &os, const DimensionRoundingType &rounding_type) -{ - switch(rounding_type) - { - case DimensionRoundingType::CEIL: - os << "CEIL"; - break; - case DimensionRoundingType::FLOOR: - os << "FLOOR"; - break; - default: - ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); - } - return os; -} - /** Converts a @ref DimensionRoundingType to string * * @param[in] rounding_type DimensionRoundingType value to be converted @@ -3133,34 +3199,6 @@ inline std::string to_string(const DimensionRoundingType &rounding_type) return str.str(); } -/** Formatted output of the Padding3D type. - * - * @param[out] os Output stream. - * @param[in] padding3d Padding3D to output. - * - * @return Modified output stream. - */ -inline ::std::ostream &operator<<(::std::ostream &os, const Padding3D &padding3d) -{ - os << padding3d.left << "," << padding3d.right << "," - << padding3d.top << "," << padding3d.bottom << "," - << padding3d.front << "," << padding3d.back; - return os; -} - -/** Converts a @ref Padding3D to string - * - * @param[in] padding3d Padding3D value to be converted - * - * @return String representing the corresponding Padding3D - */ -inline std::string to_string(const Padding3D &padding3d) -{ - std::stringstream str; - str << padding3d; - return str.str(); -} - /** Formatted output of the Conv3dInfo type. * * @param[out] os Output stream. -- cgit v1.2.1