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

ONly device time for code objects

parent 25f0a80f
...@@ -64,15 +64,18 @@ time_op(context& ictx, operation op, const std::vector<shape>& inputs, int n) ...@@ -64,15 +64,18 @@ time_op(context& ictx, operation op, const std::vector<shape>& inputs, int n)
(void)i; (void)i;
host_time += time<milliseconds>(run); host_time += time<milliseconds>(run);
} }
// Measure device time // Measure device time only for code_object ops which support it
gctx.enable_perf_measurement();
run();
double device_time = 0.0; double device_time = 0.0;
for(auto i : range(n)) if (op.name() == "gpu::code_object")
{ {
(void)i; gctx.enable_perf_measurement();
run(); run();
device_time += gctx.get_elapsed_ms(); for(auto i : range(n))
{
(void)i;
run();
device_time += gctx.get_elapsed_ms();
}
} }
return std::make_pair(host_time / n, device_time / n); return std::make_pair(host_time / n, device_time / n);
} }
......
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