From 0f900c8d53314587535d55f081bc3df1acf48d0d Mon Sep 17 00:00:00 2001 From: lzk Date: Tue, 23 Mar 2021 18:14:21 -0700 Subject: [PATCH] power bug fix --- mindspore/lite/nnacl/fp16/power_fp16.h | 2 +- mindspore/lite/nnacl/fp32/pack_fp32.c | 2 +- mindspore/lite/nnacl/fp32/power_fp32.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/lite/nnacl/fp16/power_fp16.h b/mindspore/lite/nnacl/fp16/power_fp16.h index c707080d7fa..32663f809f0 100644 --- a/mindspore/lite/nnacl/fp16/power_fp16.h +++ b/mindspore/lite/nnacl/fp16/power_fp16.h @@ -30,7 +30,7 @@ typedef void (*PowerFunFp16)(const float16_t *, const float16_t *, float16_t *, #ifdef __cplusplus extern "C" { #endif -inline bool CheckInteger(float16_t f) { return floorf(f) == f; } +static inline bool CheckInteger(float16_t f) { return floorf(f) == f; } static inline float16_t StdPowerScalarFp16(float16_t x, const void *exponent) { return powf(x, *(float16_t *)exponent); diff --git a/mindspore/lite/nnacl/fp32/pack_fp32.c b/mindspore/lite/nnacl/fp32/pack_fp32.c index bc2d7c9ef78..69d3f6764d5 100644 --- a/mindspore/lite/nnacl/fp32/pack_fp32.c +++ b/mindspore/lite/nnacl/fp32/pack_fp32.c @@ -308,7 +308,7 @@ void PackNHWCToNCHWFp32(const void *src, void *dst, int batches, int plane, int return; } task_end = (task_id + 1) == thread_count ? plane : MSMIN(plane, task_start + offset_hw); - hw8 = task_start + (task_end - task_start) > offset_hw ? offset_hw : 0; + hw8 = task_start + (task_end - task_start) >= offset_hw ? offset_hw : 0; } else { hw8 *= C8NUM; } diff --git a/mindspore/lite/nnacl/fp32/power_fp32.h b/mindspore/lite/nnacl/fp32/power_fp32.h index 6485f432441..80e12e54ca2 100644 --- a/mindspore/lite/nnacl/fp32/power_fp32.h +++ b/mindspore/lite/nnacl/fp32/power_fp32.h @@ -30,7 +30,7 @@ typedef float (*PowerScalarFun)(float x, const void *exponent); #ifdef __cplusplus extern "C" { #endif -inline bool CheckInteger(float f) { return floorf(f) == f; } +static inline bool CheckInteger(float f) { return floorf(f) == f; } static inline float StdPowerScalar(float x, const void *exponent) { return powf(x, *(float *)exponent); }