Commit 239322e0 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Robert Kimball

IntelGPU backend: Profile data improved (#1932)

* IntelGPU backend: Profile data improved

* PR1932. Comments addressed
parent ffa20eee
......@@ -1665,17 +1665,17 @@ vector<runtime::PerformanceCounter>
return rc;
}
static Shape get_shape_by_name(const shared_ptr<Function> func, const string& name)
static Node* get_node_by_name(const shared_ptr<Function> func, const string& name)
{
for (shared_ptr<Node> node : func->get_ops())
{
if (node->get_name() == name)
{
return node->get_output_shape(0);
return node.get();
}
}
return Shape();
return nullptr;
}
void runtime::intelgpu::IntelGPUBackend::print_call_performance(
......@@ -1748,7 +1748,7 @@ void runtime::intelgpu::IntelGPUBackend::print_call_performance(
for (auto it = data.rbegin(); (it != data.rend()) && (limit_count > 0); ++it, --limit_count)
{
const string ngraph_node_name = convert_cldnn_names(func, it->second.item_name);
const Shape ngraph_node_shape = get_shape_by_name(func, ngraph_node_name);
const Node* ngraph_node = get_node_by_name(func, ngraph_node_name);
cout << func_name << delim << setw(max_item_name_size) << it->second.item_name << delim
<< "time(ms)" << delim << scientific << setprecision(2) << it->first;
......@@ -1756,7 +1756,30 @@ void runtime::intelgpu::IntelGPUBackend::print_call_performance(
{
cout << delim << item.first << "(ms)" << delim << item.second;
}
cout << delim << ngraph_node_name << delim << ngraph_node_shape << "\n";
cout << delim << ngraph_node_name;
if (ngraph_node) // it might be initialized by nullptr
{
// print all input shapes for the Node
size_t arg_idx = 0;
for (const descriptor::Input& op_input : ngraph_node->get_inputs())
{
cout << delim << op_input.get_element_type().c_type_string() << " input"
<< arg_idx << vector_to_string(op_input.get_shape());
++arg_idx;
}
// print all output shapes for the Node
arg_idx = 0;
for (const descriptor::Output& op_output : ngraph_node->get_outputs())
{
cout << delim << op_output.get_element_type().c_type_string() << " output"
<< arg_idx << vector_to_string(op_output.get_shape());
++arg_idx;
}
}
cout << "\n";
}
// Print bottom line summary
......
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