diff --git a/mindspore/ccsrc/profiler/device/data_saver.h b/mindspore/ccsrc/profiler/device/data_saver.h index 759a85b04de..33a48577037 100644 --- a/mindspore/ccsrc/profiler/device/data_saver.h +++ b/mindspore/ccsrc/profiler/device/data_saver.h @@ -111,6 +111,8 @@ class DataSaver { void ParseOpInfo(const OpInfoMap &op_info_maps); + OpTimestampInfo op_timestamps_map_; + protected: void AddOpDetailInfoForType(const OpDetailInfo &op_detail_info); @@ -126,7 +128,6 @@ class DataSaver { OpTypeInfos op_type_infos_; OpDetailInfos op_detail_infos_; - OpTimestampInfo op_timestamps_map_; std::string op_side_; std::string device_id_; }; diff --git a/mindspore/ccsrc/profiler/device/profiling.cc b/mindspore/ccsrc/profiler/device/profiling.cc index 2f056696dc0..a13aedb91cc 100644 --- a/mindspore/ccsrc/profiler/device/profiling.cc +++ b/mindspore/ccsrc/profiler/device/profiling.cc @@ -95,7 +95,7 @@ std::shared_ptr &ProfilerManager::GetInstance() { return profiler_manager_inst_; } -bool ProfilerManager::GetProfilingEnableFlag() { +bool ProfilerManager::GetProfilingEnableFlag() const { #if ENABLE_GPU return profiler::gpu::GPUProfiler::GetInstance()->GetEnableFlag(); #endif @@ -107,7 +107,7 @@ bool ProfilerManager::GetProfilingEnableFlag() { return false; } -void ProfilerManager::RecordOneStepStartEndInfo() { +void ProfilerManager::RecordOneStepStartEndInfo() const { #if ENABLE_GPU auto gpu_profiler_inst = profiler::gpu::GPUProfiler::GetInstance(); if (gpu_profiler_inst->GetEnableFlag()) { diff --git a/mindspore/ccsrc/profiler/device/profiling.h b/mindspore/ccsrc/profiler/device/profiling.h index 7a43aaeb98e..c4af655fd01 100644 --- a/mindspore/ccsrc/profiler/device/profiling.h +++ b/mindspore/ccsrc/profiler/device/profiling.h @@ -59,8 +59,8 @@ class ProfilerManager { ~ProfilerManager() = default; ProfilerManager(const ProfilerManager &) = delete; ProfilerManager &operator=(const ProfilerManager &) = delete; - bool GetProfilingEnableFlag(); - void RecordOneStepStartEndInfo(); + bool GetProfilingEnableFlag() const; + void RecordOneStepStartEndInfo() const; std::string GetProfilingOptions() const; private: