提交 6e12fb16 编写于 作者: C caifubi

set prof_handle_ to nullptr after release

上级 71d27c68
......@@ -169,7 +169,7 @@ bool ProfilingManager::StartupProfiling(uint32_t device_id) {
return true;
}
bool ProfilingManager::StopProfiling() const {
bool ProfilingManager::StopProfiling() {
MS_LOG(INFO) << "StopProfiling";
if (!IsProfiling()) {
MS_LOG(INFO) << "No need profiling. please export PROFILING_MODE and in train mode.";
......@@ -184,8 +184,10 @@ bool ProfilingManager::StopProfiling() const {
int result = ProfMgrStop(prof_handle_);
if (result != 0) {
MS_LOG(ERROR) << "ProfMgr stop return fail:" << result << ".";
prof_handle_ = nullptr;
return false;
}
prof_handle_ = nullptr;
}
return true;
......
......@@ -39,7 +39,7 @@ class ProfilingManager {
uint64_t GetJobId() const;
bool ReportProfilingData(const map<uint32_t, string> &op_taskId_map) const;
bool StartupProfiling(uint32_t device_id);
bool StopProfiling() const;
bool StopProfiling();
inline bool IsProfiling() const {
auto context = MsContext::GetInstance();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册