!14382 [MSLITE][DEVELOP] clear static check warnings in module of lite runtime op
From: @yangruoqi713 Reviewed-by: @zhang_xue_tong,@zhanghaibo5 Signed-off-by: @zhang_xue_tong
This commit is contained in:
commit
253b2db10d
|
|
@ -59,7 +59,7 @@ static inline void single_exp_fp16(float16_t src, float16_t *dst) {
|
|||
int integer = (float)src / param[0];
|
||||
float decimal = (float)src - integer * param[0];
|
||||
int int_exp = (integer + 127) << 23;
|
||||
float decimal_exp =
|
||||
const float decimal_exp =
|
||||
1.0f + decimal * (1.0f + decimal * (0.5f + decimal * (param[3] + decimal * (param[2] + decimal * param[1]))));
|
||||
*dst = (float16_t)(*((float *)&int_exp) * decimal_exp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ bool CheckConvDw1DWinograd(const ConvParameter *conv_param, int thread_num) {
|
|||
conv_param->stride_h_ == 1 && conv_param->dilation_h_ == 1 && conv_param->dilation_w_ == 1 &&
|
||||
conv_param->pad_u_ == 1 && conv_param->pad_d_ == 1 && conv_param->pad_l_ == 1 && conv_param->pad_r_ == 1 &&
|
||||
conv_param->input_channel_ == conv_param->output_channel_ &&
|
||||
conv_param->output_h_ / thread_num >= 4; // better had more than 4 rows for each thread
|
||||
conv_param->output_h_ >= thread_num * 4; // better had more than 4 rows for each thread
|
||||
}
|
||||
|
||||
void ConvDw3x3RowLeft(const float *src, float *line, int lw, int channel) {
|
||||
|
|
|
|||
|
|
@ -144,8 +144,7 @@ void MaxPoolingGrad(const float *input_ptr, const float *dy_ptr, float *output_p
|
|||
int xw = yw * stride_w + kw - pad_w;
|
||||
int val_idx = (xw + in_w * xh) * channel + ic;
|
||||
#ifdef ENABLE_ARM
|
||||
unsigned int val_idx_vec[] = {val_idx, val_idx + 1, val_idx + 2, val_idx + 3};
|
||||
uint32x4_t index = vld1q_u32(val_idx_vec);
|
||||
uint32x4_t index = {val_idx, val_idx + 1, val_idx + 2, val_idx + 3};
|
||||
float32x4_t in = vld1q_f32(inPtr + val_idx);
|
||||
max_idx = MaxIndex(in, &max_val, index, max_idx);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ using mindspore::kernel::LiteKernel;
|
|||
using mindspore::lite::RET_ERROR;
|
||||
using mindspore::lite::RET_OK;
|
||||
namespace mindspore::kernel {
|
||||
#define NPU_MEMORY_MAX 200 * 1024 * 1024
|
||||
class NPUKernel : public LiteKernel {
|
||||
public:
|
||||
NPUKernel(OpParameter *parameter, const std::vector<lite::Tensor *> &inputs,
|
||||
|
|
@ -65,12 +64,6 @@ kernel::LiteKernel *NPUKernelCreator(const std::vector<lite::Tensor *> &inputs,
|
|||
free(opParameter);
|
||||
return nullptr;
|
||||
}
|
||||
if (inputs[0]->Size() > NPU_MEMORY_MAX) {
|
||||
MS_LOG(ERROR) << "Npu does not support input tensor size greater than 200MB";
|
||||
free(opParameter);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto *kernel = new (std::nothrow) T(opParameter, inputs, outputs, ctx, primitive);
|
||||
if (kernel == nullptr) {
|
||||
MS_LOG(ERROR) << "kernel " << opParameter->name_ << "is nullptr.";
|
||||
|
|
|
|||
|
|
@ -2309,16 +2309,6 @@ if [[ ${backend} == "all" || ${backend} == "npu" ]]; then
|
|||
fi
|
||||
|
||||
# Check benchmark result and return value
|
||||
if [[ ${backend} == "all" || ${backend} == "x86" ]]; then
|
||||
wait ${Run_x86_PID}
|
||||
Run_x86_status=$?
|
||||
|
||||
if [[ ${Run_x86_status} != 0 ]];then
|
||||
echo "Run_x86 failed"
|
||||
cat ${run_x86_log_file}
|
||||
isFailed=1
|
||||
fi
|
||||
fi
|
||||
if [[ ${backend} == "all" || ${backend} == "x86-sse" ]]; then
|
||||
wait ${Run_x86_sse_PID}
|
||||
Run_x86_sse_status=$?
|
||||
|
|
@ -2339,6 +2329,16 @@ if [[ ${backend} == "all" || ${backend} == "x86-avx" ]]; then
|
|||
isFailed=1
|
||||
fi
|
||||
fi
|
||||
if [[ ${backend} == "all" || ${backend} == "x86" ]]; then
|
||||
wait ${Run_x86_PID}
|
||||
Run_x86_status=$?
|
||||
|
||||
if [[ ${Run_x86_status} != 0 ]];then
|
||||
echo "Run_x86 failed"
|
||||
cat ${run_x86_log_file}
|
||||
isFailed=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${backend} == "all" || ${backend} == "arm64_fp32" ]]; then
|
||||
if [[ ${Run_arm64_fp32_status} != 0 ]];then
|
||||
|
|
|
|||
Loading…
Reference in New Issue