From 98c00e490eed0ab11eea598ac796df5ac91499d0 Mon Sep 17 00:00:00 2001 From: YijieChen Date: Fri, 24 Feb 2023 12:46:25 +0800 Subject: [PATCH] Fix gcc11 compile bug --- .../plugin/device/cpu/kernel/sparse_add_grad_cpu_kernel.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_add_grad_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_add_grad_cpu_kernel.cc index 54b1f350adb..4aa929c0e9f 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_add_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/sparse_add_grad_cpu_kernel.cc @@ -149,8 +149,8 @@ bool SparseAddGradCpuKernelMod::LaunchKernel(const std::vectorsize / (sizeof(S) * indices_column_); const int64_t out_indices_num = inputs[kOutIndicesIdx]->size / (sizeof(S) * indices_column_); - memset(dx1, 0, sizeof(T) * x1_indices_num); - memset(dx2, 0, sizeof(T) * x2_indices_num); + memset_s(dx1, sizeof(T) * x1_indices_num, 0, sizeof(T) * x1_indices_num); + memset_s(dx2, sizeof(T) * x2_indices_num, 0, sizeof(T) * x2_indices_num); int64_t i = 0; int64_t j = 0;