Commit 12a82ff9 authored by Paul's avatar Paul
Browse files

ONly device time for code objects

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