From 9129549110527fd53655d3e6b61e8e59bed6f97f Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Fri, 21 Jul 2023 18:16:13 +0100 Subject: Retain back-compatibility for arm_compute/core/Types.h * Some symbols have been moved from core/Types.h. This patch retains back compatibility so that the user can still include this header for those symbols * A new header core/CoreTypes.h is created to avoid circular dependency. This header includes essential small types that are used across functions * Move all function info types into function_info folder for easier tracking Resolves COMPMID-6330 Related to https://review.mlplatform.org/c/ml/ComputeLibrary/+/9757 Signed-off-by: SiCong Li Change-Id: I4739175c2d4d184a9bc8e28b881b497fab03ca60 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9979 Reviewed-by: Jakub Sujak Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/core/utils/quantization/AsymmHelpers.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/core/utils/quantization/AsymmHelpers.cpp') diff --git a/src/core/utils/quantization/AsymmHelpers.cpp b/src/core/utils/quantization/AsymmHelpers.cpp index 0dec56c451..086d63b968 100644 --- a/src/core/utils/quantization/AsymmHelpers.cpp +++ b/src/core/utils/quantization/AsymmHelpers.cpp @@ -21,11 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#include "arm_compute/core/ActivationLayerInfo.h" #include "arm_compute/core/utils/quantization/AsymmHelpers.h" #include "arm_compute/core/Helpers.h" -#include "support/ToolchainSupport.h" +#include "arm_compute/function_info/ActivationLayerInfo.h" #include "src/core/utils/quantization/AsymmHelpers.h" +#include "support/ToolchainSupport.h" #include #include @@ -240,15 +240,14 @@ void compute_quantized_multipliers_and_shifts(const ITensorInfo *input, int32_t saturating_rounding_doubling_highmul(int32_t a, int32_t b) { - bool overflow = a == b && a == std::numeric_limits::min(); - int64_t a_64(a); - int64_t b_64(b); - int64_t ab_64 = a_64 * b_64; - const bool is_positive_or_zero = - a == 0 || b == 0 || - (std::signbit(static_cast(a)) == std::signbit(static_cast(b))); - int32_t nudge = is_positive_or_zero ? (1 << 30) : (1 - (1 << 30)); - int32_t ab_x2_high32 = static_cast((ab_64 + nudge) / (1ll << 31)); + bool overflow = a == b && a == std::numeric_limits::min(); + int64_t a_64(a); + int64_t b_64(b); + int64_t ab_64 = a_64 * b_64; + const bool is_positive_or_zero = + a == 0 || b == 0 || (std::signbit(static_cast(a)) == std::signbit(static_cast(b))); + int32_t nudge = is_positive_or_zero ? (1 << 30) : (1 - (1 << 30)); + int32_t ab_x2_high32 = static_cast((ab_64 + nudge) / (1ll << 31)); return overflow ? std::numeric_limits::max() : ab_x2_high32; } -- cgit v1.2.1