forked from huawei/mindspore2022
Profiler memory could not collect data.
This commit is contained in:
parent
05237582c3
commit
2a9a968f7f
|
|
@ -46,6 +46,7 @@ void MemoryProfiling::StartMemoryProfiling() {
|
|||
is_enabled_ = true;
|
||||
if (NeedSaveMemoryProfiling()) {
|
||||
SaveMemoryProfiling();
|
||||
has_save_memory_data_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +144,6 @@ void MemoryProfiling::SaveMemoryProfiling() {
|
|||
}
|
||||
handle.close();
|
||||
|
||||
has_save_memory_data_ = true;
|
||||
MS_LOG(INFO) << "Start save memory profiling data to " << file << " end";
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class MemoryProfiling {
|
|||
bool IsMemoryProfilingInitialized() const { return is_initialized_; }
|
||||
bool IsMemoryProfilingEnabled() const { return is_enabled_; }
|
||||
void SetMemoryProfilingInitialize(const std::string &profiling_options);
|
||||
bool NeedSaveMemoryProfiling() { return (is_enabled_) && (!has_save_memory_data_); }
|
||||
bool NeedSaveMemoryProfiling() { return (is_enabled_) && (graph_memory_.size() != 0) && (!has_save_memory_data_); }
|
||||
void StartMemoryProfiling();
|
||||
void StopMemoryProfiling();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue