diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc index 10cbb77964..bf61471827 100644 --- a/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc @@ -48,6 +48,10 @@ void DescReporter::ReportByLine(const std::string &data, const std::string &file if (report_ret != 0) { MS_LOG(EXCEPTION) << "report data failed"; } + if (report_size == 0) { + MS_LOG(WARNING) << "report_size is 0"; + break; + } cur_size += report_size; } } @@ -58,7 +62,6 @@ void DescReporter::ReportData() { ReportByLine(data, file_name_); } } - } // namespace ascend } // namespace device } // namespace mindspore diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h index 2da56ceb93..852bcf116b 100644 --- a/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h @@ -27,6 +27,7 @@ namespace ascend { class ProfDesc { public: explicit ProfDesc(std::string op_name) : op_name_(std::move(op_name)) {} + virtual ~ProfDesc() = default; virtual std::string ToString() = 0; protected: @@ -37,6 +38,7 @@ class TaskDesc : public ProfDesc { public: TaskDesc(std::string op_name, uint32_t task_id, uint32_t block_dim, uint32_t stream_id) : ProfDesc(std::move(op_name)), task_id_(task_id), block_dim_(block_dim), stream_id_(stream_id) {} + ~TaskDesc() override = default; std::string ToString() override; private: @@ -60,6 +62,7 @@ class GraphDesc : public ProfDesc { op_type_(std::move(op_type)), input_data_list_(std::move(input_data_list)), output_data_list_(std::move(output_data_list)) {} + ~GraphDesc() override = default; std::string ToString() override; private: diff --git a/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h index 7fed990840..c1f70cacaf 100644 --- a/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h +++ b/mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h @@ -29,6 +29,7 @@ class TaskDescReporter : public DescReporter { public: TaskDescReporter(int device_id, const std::string &file_name, std::vector cnode_list) : DescReporter(device_id, file_name, std::move(cnode_list)) {} + ~TaskDescReporter() override = default; void ReportData() override; void set_task_ids(const std::vector &task_ids) { task_ids_ = task_ids; }