"vscode:/vscode.git/clone" did not exist on "3e14649613132ec7f8c156ea8b262822fd97de17"
Unverified Commit 337c5ba1 authored by Shucai Xiao's avatar Shucai Xiao Committed by GitHub
Browse files

Trace eval segfault (#974)

 when running a model on GPU, migraphx tries to print out content from gpu memory, which causes a segfault. The solution is to copy the gpu memory content back to CPU before the print.
parent a14a4e64
......@@ -309,8 +309,11 @@ std::vector<argument> program::eval(parameter_map params) const
double t2 = t.record<milliseconds>();
std::cout << "Time: " << t1 << "ms, " << t2 << "ms" << std::endl;
if(trace_level > 1 and ins->name().front() != '@' and
ins->name() != "load")
std::cout << "Output: " << result << std::endl;
ins->name() != "load" and not result.empty())
{
target tgt = make_target(this->impl->target_name);
std::cout << "Output: " << tgt.copy_from(result) << std::endl;
}
return result;
}));
}
......
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