diff options
author | Adnan AlSinan <adnan.alsinan@arm.com> | 2022-01-25 16:37:44 +0000 |
---|---|---|
committer | Adnan AlSinan <adnan.alsinan@arm.com> | 2022-01-26 17:33:37 +0000 |
commit | 21391c3f8b234c1a141e1c2d192072c91c254b33 (patch) | |
tree | c56eff6c0d281ccfebc6ff3851402388df176330 /src | |
parent | 7195f71b2e44e2119b1763fde02b2cf3f9371a6b (diff) | |
download | ComputeLibrary-21391c3f8b234c1a141e1c2d192072c91c254b33.tar.gz |
Fix s10plus NEON/PoolingLayer Nightly failure
Resolves: COMPMID-5041
Signed-off-by: Adnan AlSinan <adnan.alsinan@arm.com>
Change-Id: I27a856671ec6210ef7b28f894124a79ca6a4281c
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7009
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cpu/kernels/pool2d/neon/nchw/all.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/cpu/kernels/pool2d/neon/nchw/all.cpp b/src/cpu/kernels/pool2d/neon/nchw/all.cpp index ec18f40569..10cbfc56a1 100644 --- a/src/cpu/kernels/pool2d/neon/nchw/all.cpp +++ b/src/cpu/kernels/pool2d/neon/nchw/all.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. + * Copyright (c) 2021-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -93,7 +93,7 @@ void pooling3_fp16_neon_nchw(const ITensor *src, ITensor *dst0, ITensor *dst1, P const int src_h = src->info()->dimension(1); const int upper_bound_w = src_w + (pool_info.exclude_padding ? 0 : pool_pad_right); const int upper_bound_h = src_h + (pool_info.exclude_padding ? 0 : pool_pad_bottom); - constexpr float16_t fp16_min = -100.0f; + const float16_t fp16_min = -std::numeric_limits<half_float::half>::infinity(); const float16_t fill_value = (pool_info.pool_type == PoolingType::MAX) ? fp16_min : 0.f; const unsigned char *const src_top_ptr = src->ptr_to_element(Coordinates(-static_cast<int>(pool_pad_left), -static_cast<int>(pool_pad_top))); const unsigned char *const src_middle_ptr = src->ptr_to_element(Coordinates(-static_cast<int>(pool_pad_left), -static_cast<int>(pool_pad_top) + 1)); @@ -142,7 +142,7 @@ void pooling3_fp16_neon_nchw(const ITensor *src, ITensor *dst0, ITensor *dst1, P // Calculate square-root in case of l2 pooling if(pool_info.pool_type == PoolingType::L2) { - res = vinv_f16(vinvsqrt_f16(res)); + res = vsqrt_f16(res); } *(reinterpret_cast<float16_t *>(out.ptr())) = vget_lane_f16(res, 0); @@ -203,7 +203,7 @@ void pooling2_nchw_maxpool_indices(const ITensor *src, ITensor *dst0, ITensor *d const int pad_left = src->info()->padding().left; const int pad_right = src->info()->padding().right; const int in_stride_y = static_cast<int>(src->info()->strides_in_bytes().y()); - constexpr T float_min = -100.0f; + constexpr T float_min = -std::numeric_limits<float>::infinity(); const T fill_value = (pool_info.pool_type == PoolingType::MAX) ? float_min : 0.f; execute_window_loop(window, [&](const Coordinates & id) @@ -255,12 +255,12 @@ void pooling2_fp16_neon_nchw(const ITensor *src, ITensor *dst0, ITensor *dst1, P const int pool_pad_bottom = pool_info.pad_stride_info.pad_bottom(); int pool_stride_x, pool_stride_y = 0; std::tie(pool_stride_x, pool_stride_y) = pool_info.pad_stride_info.stride(); - const int src_w = src->info()->dimension(0); - const int src_h = src->info()->dimension(1); - const int upper_bound_w = src_w + (pool_info.exclude_padding ? 0 : pool_pad_right); - const int upper_bound_h = src_h + (pool_info.exclude_padding ? 0 : pool_pad_bottom); - constexpr float16_t fp16_min = -100.0f; - const float16_t fill_value = (pool_info.pool_type == PoolingType::MAX) ? fp16_min : 0.0f; + const int src_w = src->info()->dimension(0); + const int src_h = src->info()->dimension(1); + const int upper_bound_w = src_w + (pool_info.exclude_padding ? 0 : pool_pad_right); + const int upper_bound_h = src_h + (pool_info.exclude_padding ? 0 : pool_pad_bottom); + const float16_t fp16_min = -std::numeric_limits<half_float::half>::infinity(); + const float16_t fill_value = (pool_info.pool_type == PoolingType::MAX) ? fp16_min : 0.0f; const unsigned char *const src_top_ptr = src->ptr_to_element(Coordinates(-static_cast<int>(pool_pad_left), -static_cast<int>(pool_pad_top))); const unsigned char *const src_bottom_ptr = src->ptr_to_element(Coordinates(-static_cast<int>(pool_pad_left), -static_cast<int>(pool_pad_top) + 1)); @@ -304,7 +304,7 @@ void pooling2_fp16_neon_nchw(const ITensor *src, ITensor *dst0, ITensor *dst1, P // Calculate square-root in case of l2 pooling if(pool_info.pool_type == PoolingType::L2) { - res = vinv_f16(vinvsqrt_f16(res)); + res = vsqrt_f16(res); } // Store result @@ -329,12 +329,12 @@ void poolingMxN_fp16_neon_nchw(const ITensor *src, ITensor *dst0, ITensor *dst1, int pool_stride_x = 0; int pool_stride_y = 0; std::tie(pool_stride_x, pool_stride_y) = pool_info.pad_stride_info.stride(); - const int src_w = src->info()->dimension(0); - const int src_h = src->info()->dimension(1); - const int upper_bound_w = src_w + (pool_info.exclude_padding ? 0 : pool_pad_right); - const int upper_bound_h = src_h + (pool_info.exclude_padding ? 0 : pool_pad_bottom); - constexpr float16_t fp16_min = -100.0f; - const float16_t fill_value = (pool_info.pool_type == PoolingType::MAX) ? fp16_min : 0.0f; + const int src_w = src->info()->dimension(0); + const int src_h = src->info()->dimension(1); + const int upper_bound_w = src_w + (pool_info.exclude_padding ? 0 : pool_pad_right); + const int upper_bound_h = src_h + (pool_info.exclude_padding ? 0 : pool_pad_bottom); + const float16_t fp16_min = -std::numeric_limits<half_float::half>::infinity(); + const float16_t fill_value = (pool_info.pool_type == PoolingType::MAX) ? fp16_min : 0.0f; execute_window_loop(window, [&](const Coordinates & id) { |