diff --git a/mindspore/lite/nnacl/common_func.c b/mindspore/lite/nnacl/common_func.c index 8bf49572a3..def3913b67 100644 --- a/mindspore/lite/nnacl/common_func.c +++ b/mindspore/lite/nnacl/common_func.c @@ -228,4 +228,3 @@ void IndirectGemmFp32_Comm(float *output, const float *input, const float *weigh } return; } - diff --git a/mindspore/lite/nnacl/common_func.h b/mindspore/lite/nnacl/common_func.h index 4a69715571..93a761e1fd 100644 --- a/mindspore/lite/nnacl/common_func.h +++ b/mindspore/lite/nnacl/common_func.h @@ -46,16 +46,16 @@ void IndirectGemmFp32(float *output, const float *input, const float *weight, co int offset(const int *shape, const int dim0, const int dim1, const int dim2, const int dim3); int offsetComm(const int *shape, const int dim0, const int dim1, const int dim2); int offset4d(const int *shape, const int *dims); -inline bool isAddOverflow(int32_t x, int32_t y) { + +static inline bool isAddOverflow(int32_t x, int32_t y) { int32_t sum = x + y; return (x > 0 && y > 0 && sum < 0) || (x < 0 && y < 0 && sum > 0); } -inline bool isMulOverflow(int32_t x, int32_t y) { +static inline bool isMulOverflow(int32_t x, int32_t y) { int32_t p = x * y; return (x != 0) && (p / x != y); } - #ifdef ENABLE_ARM64 void BiasAdd(const float *bias, float *data, size_t oc4, size_t plan_size); void BiasAddRelu6(const float *bias, float *data, size_t oc4, size_t plan_size); diff --git a/mindspore/lite/nnacl/int8/reduce_int8.h b/mindspore/lite/nnacl/int8/reduce_int8.h index 39d31fdc98..b27634d630 100644 --- a/mindspore/lite/nnacl/int8/reduce_int8.h +++ b/mindspore/lite/nnacl/int8/reduce_int8.h @@ -45,8 +45,6 @@ int ReduceSumSquareLastAxis(const int outer_size, const int inner_size, const in int8_t *dst_data, const ReduceQuantArg *quant, const int tid, const int thread_num); int ReduceSumSquareInt8(const int outer_size, const int inner_size, const int axis_size, const int32_t *src_data, int32_t *dst_data, const ReduceQuantArg *quant, const int tid, const int thread_num); -bool isAddOverflow(int32_t x, int32_t y); -bool isMulOverflow(int32_t x, int32_t y); #ifdef __cplusplus } #endif