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 ...@@ -309,8 +309,11 @@ std::vector<argument> program::eval(parameter_map params) const
double t2 = t.record<milliseconds>(); double t2 = t.record<milliseconds>();
std::cout << "Time: " << t1 << "ms, " << t2 << "ms" << std::endl; std::cout << "Time: " << t1 << "ms, " << t2 << "ms" << std::endl;
if(trace_level > 1 and ins->name().front() != '@' and if(trace_level > 1 and ins->name().front() != '@' and
ins->name() != "load") ins->name() != "load" and not result.empty())
std::cout << "Output: " << result << std::endl; {
target tgt = make_target(this->impl->target_name);
std::cout << "Output: " << tgt.copy_from(result) << std::endl;
}
return result; 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