Browse Source

clean task sink codex

tags/v0.3.0-alpha
caifubi 6 years ago
parent
commit
9a0d894b9d
3 changed files with 8 additions and 1 deletions
  1. +4
    -1
      mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc
  2. +3
    -0
      mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h
  3. +1
    -0
      mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h

+ 4
- 1
mindspore/ccsrc/device/ascend/profiling/reporter/desc_reporter.cc View File

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

+ 3
- 0
mindspore/ccsrc/device/ascend/profiling/reporter/profiling_desc.h View File

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


+ 1
- 0
mindspore/ccsrc/device/ascend/profiling/reporter/task_desc_reporter.h View File

@@ -29,6 +29,7 @@ class TaskDescReporter : public DescReporter {
public:
TaskDescReporter(int device_id, const std::string &file_name, std::vector<CNodePtr> cnode_list)
: DescReporter(device_id, file_name, std::move(cnode_list)) {}
~TaskDescReporter() override = default;
void ReportData() override;
void set_task_ids(const std::vector<uint32_t> &task_ids) { task_ids_ = task_ids; }



Loading…
Cancel
Save