diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc index b6252b6ca83..724bbb7df0f 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc @@ -57,7 +57,7 @@ bool BiasAddCPUKernel::Launch(const std::vector &inputs, const std:: size_t offset = n * c_size * hw_size + c * hw_size; size_t hw = 0; #ifdef ENABLE_AVX - constexpr size_t C8NUM = 8; + const size_t C8NUM = 8; size_t hw8 = hw_size / C8NUM * C8NUM; const float *in_ptr = src_addr + offset; float *out_ptr = output_addr + offset; diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc index 16b30e3bb71..27cb74986d9 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc @@ -189,11 +189,7 @@ void SliceCPUKernel::CopyDataToOutput(const std::vector &inp MS_LOG(EXCEPTION) << id << " output memory out of bounds."; } - size_t buff_size = out_buff_size - out_offset * sizeof(T); size_t copy_size = copy_num * sizeof(T); - if (buff_size < copy_size) { - MS_LOG(EXCEPTION) << "output buffer is not enough. memcpy failed!"; - } auto ret = memcpy_s(output_addr + out_offset, copy_size, input_addr + in_offset, copy_size); if (ret != EOK) { MS_LOG(EXCEPTION) << "memcpy failed. ret:" << ret;