cleaning codex warnings

pull/14466/head
yanghaoran 4 years ago
parent b27333ba35
commit 50e81568b5

@ -68,7 +68,6 @@ class PynativeGradSparseSoftmaxCrossEntropyWithLogitsUnifyMindIR : public Patter
const BaseRef DefinePattern() const override; const BaseRef DefinePattern() const override;
const AnfNodePtr Process(const FuncGraphPtr &, const AnfNodePtr &, const EquivPtr &) const override; const AnfNodePtr Process(const FuncGraphPtr &, const AnfNodePtr &, const EquivPtr &) const override;
}; };
} // namespace opt } // namespace opt
} // namespace mindspore } // namespace mindspore
#endif // MINDSPORE_SPARSE_SOFTMAX_CROSS_ENTROPY_WITH_LOGITS_UNIFY_MINDIR_H #endif // MINDSPORE_SPARSE_SOFTMAX_CROSS_ENTROPY_WITH_LOGITS_UNIFY_MINDIR_H

@ -160,7 +160,7 @@ std::string GetRealOpType(const std::string &op_type) {
void OpTilingCalculater::CalculateTiling(const NotNull<CNodePtr> &cnode, const optiling::OpCompileInfo &op_compile_info, void OpTilingCalculater::CalculateTiling(const NotNull<CNodePtr> &cnode, const optiling::OpCompileInfo &op_compile_info,
const std::map<uint32_t, tensor::TensorPtr> &depend_tensor_map, const std::map<uint32_t, tensor::TensorPtr> &depend_tensor_map,
NotNull<optiling::OpRunInfo *> op_run_info) { const NotNull<optiling::OpRunInfo *> op_run_info) {
optiling::TeOpParas op_param; optiling::TeOpParas op_param;
std::string op_type = AnfAlgo::GetCNodeName(cnode.get()); std::string op_type = AnfAlgo::GetCNodeName(cnode.get());
MS_LOG(INFO) << "[DynamicShape] calculate tiling, op_type:" << op_type; MS_LOG(INFO) << "[DynamicShape] calculate tiling, op_type:" << op_type;

@ -110,10 +110,10 @@ void ProfilingManager::PluginUnInit() const {
} }
} }
Status ProfilingManager::GetProfConf(NotNull<MsprofGeOptions *> prof) { Status ProfilingManager::GetProfConf(const NotNull<MsprofGeOptions *> prof) {
string job_id = std::to_string(GetJobId()); 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."; MS_LOG(ERROR) << "Copy job_id failed.";
return PROF_FAILED; return PROF_FAILED;
} }
@ -168,7 +168,7 @@ uint32_t GetCurrentDeviceId() {
return context->get_param<uint32_t>(MS_CTX_DEVICE_ID); return context->get_param<uint32_t>(MS_CTX_DEVICE_ID);
} }
bool ProfilingManager::ProfStartUp(NotNull<MsprofGeOptions *> prof_conf) { bool ProfilingManager::ProfStartUp(const NotNull<MsprofGeOptions *> prof_conf) const {
MS_LOG(INFO) << "Prof start up. "; MS_LOG(INFO) << "Prof start up. ";
if (prof_cb_.msprofCtrlCallback == nullptr) { if (prof_cb_.msprofCtrlCallback == nullptr) {
@ -223,7 +223,7 @@ bool ProfilingManager::StopProfiling() {
return true; return true;
} }
Status ProfilingManager::CallMsprofReport(NotNull<ReporterData *> reporter_data) const { Status ProfilingManager::CallMsprofReport(const NotNull<ReporterData *> reporter_data) const {
if (prof_cb_.msprofReporterCallback == nullptr) { if (prof_cb_.msprofReporterCallback == nullptr) {
MS_LOG(ERROR) << "MsprofReporterCallback callback is nullptr."; MS_LOG(ERROR) << "MsprofReporterCallback callback is nullptr.";
return PROF_FAILED; return PROF_FAILED;

@ -54,9 +54,7 @@ class ProfilingManager {
Status PluginInit() const; Status PluginInit() const;
void PluginUnInit() const; void PluginUnInit() const;
Status CallMsprofReport(NotNull<ReporterData *> reporter_data) const; Status CallMsprofReport(NotNull<ReporterData *> reporter_data) const;
struct MsprofCallback &GetMsprofCallback() { const struct MsprofCallback &GetMsprofCallback() { return prof_cb_; }
return prof_cb_;
}
void SetMsprofCtrlCallback(MsprofCtrlCallback func) { prof_cb_.msprofCtrlCallback = func; } void SetMsprofCtrlCallback(MsprofCtrlCallback func) { prof_cb_.msprofCtrlCallback = func; }
void SetMsprofReporterCallback(MsprofReporterCallback func) { prof_cb_.msprofReporterCallback = func; } void SetMsprofReporterCallback(MsprofReporterCallback func) { prof_cb_.msprofReporterCallback = func; }
void SetMsprofSetDeviceCallback(MsprofSetDeviceCallback func) { prof_cb_.msprofSetDeviceCallback = func; } void SetMsprofSetDeviceCallback(MsprofSetDeviceCallback func) { prof_cb_.msprofSetDeviceCallback = func; }
@ -68,7 +66,7 @@ class ProfilingManager {
~ProfilingManager() {} ~ProfilingManager() {}
private: private:
bool ProfStartUp(NotNull<MsprofGeOptions *> prof_conf); bool ProfStartUp(NotNull<MsprofGeOptions *> prof_conf) const;
uint32_t device_id_; uint32_t device_id_;
MsprofCallback prof_cb_; MsprofCallback prof_cb_;
bool hccl_enabled_bef_profiling_enabled_; bool hccl_enabled_bef_profiling_enabled_;

Loading…
Cancel
Save