diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.cc b/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.cc index 9dee2e70d91..5faf1f83311 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.cc +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.cc @@ -91,7 +91,7 @@ bool AicpuOpKernelLoad::ReadBytesFromBinaryFile(const std::string &file_name, st return true; } -bool AicpuOpKernelLoad::GetSoNeedLoadPath(const std::string &so_name, std::string *file_path) const { +bool AicpuOpKernelLoad::GetSoNeedLoadPath(std::string *file_path) const { MS_EXCEPTION_IF_NULL(file_path); Dl_info dl_info; if (dladdr(reinterpret_cast(const_cast(this)), &dl_info) == 0) { @@ -106,7 +106,6 @@ bool AicpuOpKernelLoad::GetSoNeedLoadPath(const std::string &so_name, std::strin return false; } auto real_cust_kernel_so_path = cust_kernel_so_path.substr(0, pos) + "/"; - if (real_cust_kernel_so_path.size() > PATH_MAX) { MS_LOG(ERROR) << "Current path [" << real_cust_kernel_so_path << "] is too long."; return false; @@ -119,7 +118,7 @@ bool AicpuOpKernelLoad::GetSoNeedLoadPath(const std::string &so_name, std::strin bool AicpuOpKernelLoad::PackageBinaryFile(const std::string &so_name, std::map *so_name_with_bin_info) { std::string bin_folder_path; - bool ret = GetSoNeedLoadPath(so_name, &bin_folder_path); + bool ret = GetSoNeedLoadPath(&bin_folder_path); if (!ret) { MS_LOG(ERROR) << "GetSoNeedLoadPath failed."; return false; @@ -144,7 +143,7 @@ bool AicpuOpKernelLoad::PackageBinaryFile(const std::string &so_name, MS_LOG(ERROR) << "Create OpKernelBin object failed."; return false; } - so_name_with_bin_info->insert({so_name, cust_aicpu_kernel_ptr}); + so_name_with_bin_info->emplace(so_name, cust_aicpu_kernel_ptr); return true; } diff --git a/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.h b/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.h index 1dfe68078dc..61a5b836b7f 100644 --- a/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.h +++ b/mindspore/ccsrc/plugin/device/ascend/kernel/aicpu/aicpu_kernel_load.h @@ -62,7 +62,7 @@ class AicpuOpKernelLoad { private: bool GetBinaryFileName(const std::string &so_name, const std::string &bin_folder_path, std::string *bin_file_path); bool ReadBytesFromBinaryFile(const std::string &file_name, std::vector *buffer) const; - bool GetSoNeedLoadPath(const std::string &so_name, std::string *file_path) const; + bool GetSoNeedLoadPath(std::string *file_path) const; bool PackageBinaryFile(const std::string &so_name, std::map *so_name_with_bin_info); bool CacheBinaryFileToDevice(const uintptr_t &resource_id, std::vector *allocated_mem, void **batch_args); diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/cast_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/cast_gpu_kernel.cc index 7713d075b2f..0df91bfc20c 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/cast_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/cast_gpu_kernel.cc @@ -421,6 +421,5 @@ MS_REG_GPU_KERNEL_TWO(Cast, KernelAttr().AddInputAttr(kNumberTypeComplex128).Add CastGpuKernelMod, Complex, bool) MS_REG_GPU_KERNEL_TWO(Cast, KernelAttr().AddInputAttr(kNumberTypeComplex128).AddOutputAttr(kNumberTypeComplex64), CastGpuKernelMod, Complex, Complex) - } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/depthtospace_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/depthtospace_gpu_kernel.cc index 050b25385b6..62c1b2c0e5b 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/depthtospace_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/depthtospace_gpu_kernel.cc @@ -37,6 +37,5 @@ MS_REG_GPU_KERNEL_ONE(DepthToSpace, KernelAttr().AddInputAttr(kNumberTypeUInt32) DepthToSpaceFwdKernelMod, uint32_t) MS_REG_GPU_KERNEL_ONE(DepthToSpace, KernelAttr().AddInputAttr(kNumberTypeUInt64).AddOutputAttr(kNumberTypeUInt64), DepthToSpaceFwdKernelMod, uint64_t) - } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/reverse_sequence_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/reverse_sequence_gpu_kernel.cc index 0cb4851dfab..46b70771c1a 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/reverse_sequence_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/arrays/reverse_sequence_gpu_kernel.cc @@ -90,6 +90,5 @@ MS_REG_GPU_KERNEL_TWO( ReverseSequence, KernelAttr().AddInputAttr(kNumberTypeBool).AddInputAttr(kNumberTypeInt64).AddOutputAttr(kNumberTypeBool), ReverseSequenceFwdGpuKernelMod, bool, int64_t) - } // namespace kernel } // namespace mindspore diff --git a/mindspore/ccsrc/plugin/device/gpu/kernel/math/broadcast_complex_gpu_kernel.cc b/mindspore/ccsrc/plugin/device/gpu/kernel/math/broadcast_complex_gpu_kernel.cc index 1b6f1d2ee01..53fcc31afe9 100644 --- a/mindspore/ccsrc/plugin/device/gpu/kernel/math/broadcast_complex_gpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/gpu/kernel/math/broadcast_complex_gpu_kernel.cc @@ -18,7 +18,6 @@ namespace mindspore { namespace kernel { - #define MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(OPNAME, T0_MS_DTYPE, T1_MS_DTYPE, T0_DTYPE, T1_DTYPE) \ MS_REG_GPU_KERNEL_THREE(OPNAME, \ KernelAttr().AddInputAttr(T0_MS_DTYPE).AddInputAttr(T0_MS_DTYPE).AddOutputAttr(T0_MS_DTYPE), \ diff --git a/mindspore/core/ops/abs.cc b/mindspore/core/ops/abs.cc index 577a9c7381b..708654c2ec3 100644 --- a/mindspore/core/ops/abs.cc +++ b/mindspore/core/ops/abs.cc @@ -77,7 +77,6 @@ ValuePtr AbsInferValue(const PrimitivePtr &prim, const std::vectorcast(); - if (x_tensor == nullptr) { return nullptr; } diff --git a/mindspore/core/ops/complex.cc b/mindspore/core/ops/complex.cc index dbb055d24fb..7d7becc7d4f 100644 --- a/mindspore/core/ops/complex.cc +++ b/mindspore/core/ops/complex.cc @@ -82,7 +82,6 @@ ValuePtr ComplexInferValue(const PrimitivePtr &prim, const std::vectorcast(); - if (real_tensor == nullptr) { return nullptr; } @@ -92,7 +91,6 @@ ValuePtr ComplexInferValue(const PrimitivePtr &prim, const std::vectorcast(); - if (imag_tensor == nullptr) { return nullptr; } diff --git a/mindspore/core/ops/grad/einsum_grad.cc b/mindspore/core/ops/grad/einsum_grad.cc index 620c5582bc7..1aa47f0daac 100644 --- a/mindspore/core/ops/grad/einsum_grad.cc +++ b/mindspore/core/ops/grad/einsum_grad.cc @@ -32,7 +32,6 @@ std::string EinsumGrad::get_equation() const { auto value_ptr = this->GetAttr(kEquation); return GetValue(value_ptr); } -// REGISTER_PRIMITIVE_EVAL_IMPL(EinsumGrad, prim::kPrimEinsumGrad, EinsumGradInfer, nullptr, true); REGISTER_PRIMITIVE_C(kNameEinsumGrad, EinsumGrad); } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/grad/slice_grad.h b/mindspore/core/ops/grad/slice_grad.h index b2c1c3bb824..f724512f33e 100644 --- a/mindspore/core/ops/grad/slice_grad.h +++ b/mindspore/core/ops/grad/slice_grad.h @@ -29,7 +29,7 @@ class MIND_API SliceGrad : public BaseOperator { public: MIND_API_BASE_MEMBER(SliceGrad); SliceGrad() : BaseOperator(kNameSliceGrad) { InitIOName({"dy", "x", "begin", "size"}, {"output"}); } - void Init() {} + void Init() const {} }; abstract::AbstractBasePtr SliceGradInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args); diff --git a/mindspore/core/ops/index_add.cc b/mindspore/core/ops/index_add.cc index 1a37ab825ed..1a7d401f563 100644 --- a/mindspore/core/ops/index_add.cc +++ b/mindspore/core/ops/index_add.cc @@ -80,6 +80,5 @@ AbstractBasePtr IndexAddInfer(const abstract::AnalysisEnginePtr &, const Primiti return abstract::MakeAbstract(IndexAddInferShape(primitive, input_args), IndexAddInferType(primitive, input_args)); } REGISTER_PRIMITIVE_EVAL_IMPL(IndexAdd, prim::kPrimIndexAdd, IndexAddInfer, nullptr, true); - } // namespace ops } // namespace mindspore