Browse Source

!14960 clear code warning

From: @wangyanling10
Reviewed-by: @wuxuejian,@liangchenghui
Signed-off-by: @wuxuejian
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
ade2d4a945
2 changed files with 1 additions and 5 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc
  2. +0
    -4
      mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc

+ 1
- 1
mindspore/ccsrc/backend/kernel_compiler/cpu/bias_add_cpu_kernel.cc View File

@@ -57,7 +57,7 @@ bool BiasAddCPUKernel::Launch(const std::vector<AddressPtr> &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;


+ 0
- 4
mindspore/ccsrc/backend/kernel_compiler/cpu/slice_cpu_kernel.cc View File

@@ -189,11 +189,7 @@ void SliceCPUKernel::CopyDataToOutput(const std::vector<kernel::AddressPtr> &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;


Loading…
Cancel
Save