Browse Source

fix pclint in profiler

tags/v1.5.0-rc1
yanghaitao1 4 years ago
parent
commit
56fd6f57e7
3 changed files with 6 additions and 5 deletions
  1. +2
    -1
      mindspore/ccsrc/profiler/device/data_saver.h
  2. +2
    -2
      mindspore/ccsrc/profiler/device/profiling.cc
  3. +2
    -2
      mindspore/ccsrc/profiler/device/profiling.h

+ 2
- 1
mindspore/ccsrc/profiler/device/data_saver.h View File

@@ -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_;
};


+ 2
- 2
mindspore/ccsrc/profiler/device/profiling.cc View File

@@ -95,7 +95,7 @@ std::shared_ptr<ProfilerManager> &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()) {


+ 2
- 2
mindspore/ccsrc/profiler/device/profiling.h View File

@@ -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:


Loading…
Cancel
Save