From 50e81568b502ea1c518db56e8c833a253b6f62ce Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Wed, 31 Mar 2021 15:07:22 +0800 Subject: [PATCH] cleaning codex warnings --- ...parse_softmax_cross_entropy_with_logits_unify_mindir.h | 1 - .../device/ascend/executor/tiling/op_tiling_calculater.cc | 2 +- .../runtime/device/ascend/profiling/profiling_manager.cc | 8 ++++---- .../runtime/device/ascend/profiling/profiling_manager.h | 6 ++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mindspore/ccsrc/backend/optimizer/ascend/mindir/sparse_softmax_cross_entropy_with_logits_unify_mindir.h b/mindspore/ccsrc/backend/optimizer/ascend/mindir/sparse_softmax_cross_entropy_with_logits_unify_mindir.h index 2a321a7a1f..18bd0a6143 100644 --- a/mindspore/ccsrc/backend/optimizer/ascend/mindir/sparse_softmax_cross_entropy_with_logits_unify_mindir.h +++ b/mindspore/ccsrc/backend/optimizer/ascend/mindir/sparse_softmax_cross_entropy_with_logits_unify_mindir.h @@ -68,7 +68,6 @@ class PynativeGradSparseSoftmaxCrossEntropyWithLogitsUnifyMindIR : public Patter const BaseRef DefinePattern() const override; const AnfNodePtr Process(const FuncGraphPtr &, const AnfNodePtr &, const EquivPtr &) const override; }; - } // namespace opt } // namespace mindspore #endif // MINDSPORE_SPARSE_SOFTMAX_CROSS_ENTROPY_WITH_LOGITS_UNIFY_MINDIR_H diff --git a/mindspore/ccsrc/runtime/device/ascend/executor/tiling/op_tiling_calculater.cc b/mindspore/ccsrc/runtime/device/ascend/executor/tiling/op_tiling_calculater.cc index bf271d6bcc..f39ee75979 100644 --- a/mindspore/ccsrc/runtime/device/ascend/executor/tiling/op_tiling_calculater.cc +++ b/mindspore/ccsrc/runtime/device/ascend/executor/tiling/op_tiling_calculater.cc @@ -160,7 +160,7 @@ std::string GetRealOpType(const std::string &op_type) { void OpTilingCalculater::CalculateTiling(const NotNull &cnode, const optiling::OpCompileInfo &op_compile_info, const std::map &depend_tensor_map, - NotNull op_run_info) { + const NotNull op_run_info) { optiling::TeOpParas op_param; std::string op_type = AnfAlgo::GetCNodeName(cnode.get()); MS_LOG(INFO) << "[DynamicShape] calculate tiling, op_type:" << op_type; diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc index 3f756f6699..df41af0cfd 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.cc @@ -110,10 +110,10 @@ void ProfilingManager::PluginUnInit() const { } } -Status ProfilingManager::GetProfConf(NotNull prof) { +Status ProfilingManager::GetProfConf(const NotNull prof) { string job_id = std::to_string(GetJobId()); - if (memcpy_s(prof->jobId, sizeof(prof->jobId), job_id.c_str(), sizeof(job_id.c_str())) != EOK) { + if (memcpy_s(prof->jobId, sizeof(prof->jobId), job_id.c_str(), strlen(job_id.c_str())) != EOK) { MS_LOG(ERROR) << "Copy job_id failed."; return PROF_FAILED; } @@ -168,7 +168,7 @@ uint32_t GetCurrentDeviceId() { return context->get_param(MS_CTX_DEVICE_ID); } -bool ProfilingManager::ProfStartUp(NotNull prof_conf) { +bool ProfilingManager::ProfStartUp(const NotNull prof_conf) const { MS_LOG(INFO) << "Prof start up. "; if (prof_cb_.msprofCtrlCallback == nullptr) { @@ -223,7 +223,7 @@ bool ProfilingManager::StopProfiling() { return true; } -Status ProfilingManager::CallMsprofReport(NotNull reporter_data) const { +Status ProfilingManager::CallMsprofReport(const NotNull reporter_data) const { if (prof_cb_.msprofReporterCallback == nullptr) { MS_LOG(ERROR) << "MsprofReporterCallback callback is nullptr."; return PROF_FAILED; diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h index 4ba26d8da9..0ca8d7971a 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_manager.h @@ -54,9 +54,7 @@ class ProfilingManager { Status PluginInit() const; void PluginUnInit() const; Status CallMsprofReport(NotNull reporter_data) const; - struct MsprofCallback &GetMsprofCallback() { - return prof_cb_; - } + const struct MsprofCallback &GetMsprofCallback() { return prof_cb_; } void SetMsprofCtrlCallback(MsprofCtrlCallback func) { prof_cb_.msprofCtrlCallback = func; } void SetMsprofReporterCallback(MsprofReporterCallback func) { prof_cb_.msprofReporterCallback = func; } void SetMsprofSetDeviceCallback(MsprofSetDeviceCallback func) { prof_cb_.msprofSetDeviceCallback = func; } @@ -68,7 +66,7 @@ class ProfilingManager { ~ProfilingManager() {} private: - bool ProfStartUp(NotNull prof_conf); + bool ProfStartUp(NotNull prof_conf) const; uint32_t device_id_; MsprofCallback prof_cb_; bool hccl_enabled_bef_profiling_enabled_;