"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "1cbbb897f991174d151fba50f1eee99a242cb53d"
Commit dba5bc56 authored by Paul's avatar Paul
Browse files

Improve print out of trace eval

parent 6eb13d95
...@@ -97,9 +97,9 @@ struct program ...@@ -97,9 +97,9 @@ struct program
void perf_report(std::ostream& os, std::size_t n, parameter_map params) const; void perf_report(std::ostream& os, std::size_t n, parameter_map params) const;
void debug_print(); void debug_print() const;
void debug_print(instruction_ref ins); void debug_print(instruction_ref ins) const;
void debug_print(const std::vector<instruction_ref>& inss); void debug_print(const std::vector<instruction_ref>& inss) const;
friend std::ostream& operator<<(std::ostream& os, const program& p); friend std::ostream& operator<<(std::ostream& os, const program& p);
friend bool operator==(const program& x, const program& y); friend bool operator==(const program& x, const program& y);
......
...@@ -366,7 +366,8 @@ argument program::eval(std::unordered_map<std::string, argument> params) const ...@@ -366,7 +366,8 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
auto& ctx = this->impl->ctx; auto& ctx = this->impl->ctx;
return generic_eval(*this, this->impl->ctx, std::move(params), [&](auto& ins, auto f) { return generic_eval(*this, this->impl->ctx, std::move(params), [&](auto& ins, auto f) {
ctx.finish(); ctx.finish();
std::cout << "Run instruction: " << ins->name() << std::endl; std::cout << "Run instruction: ";
this->debug_print(ins);
return f(); return f();
}); });
} }
...@@ -473,8 +474,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params) ...@@ -473,8 +474,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
<< ", " << std::round(calculate_overhead_percent) << "%" << std::endl; << ", " << std::round(calculate_overhead_percent) << "%" << std::endl;
} }
void program::debug_print() { std::cout << *this << std::endl; } void program::debug_print() const { std::cout << *this << std::endl; }
void program::debug_print(instruction_ref ins) void program::debug_print(instruction_ref ins) const
{ {
std::stringstream ss; std::stringstream ss;
print_program(ss, *this, [&](auto x, auto&& names) { print_program(ss, *this, [&](auto x, auto&& names) {
...@@ -485,7 +486,7 @@ void program::debug_print(instruction_ref ins) ...@@ -485,7 +486,7 @@ void program::debug_print(instruction_ref ins)
} }
}); });
} }
void program::debug_print(const std::vector<instruction_ref>& inss) void program::debug_print(const std::vector<instruction_ref>& inss) const
{ {
for(auto ins : inss) for(auto ins : inss)
debug_print(ins); debug_print(ins);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment