Open
Description
I am trying to profile my code and I am getting different results each time I run the code.
auto start = std::chrono::steady_clock::now();
foo()
auto end = std::chrono::steady_clock::now();
time = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
why is this giving me different results than using
start_kernel_time = event.get_profiling_info<info::event_profiling::command_start>();
end_kernel_time = event.get_profiling_info<info::event_profiling::command_end>();
time_kernel = (end_kernel_time - start_kernel_time) / kNs; // kNs = 1e9
I run the code several times and interesting thing is steady_clock
version first printed out 6.7 seconds and then in the second run printed out 0.07 seconds ( unrealistic) then the event profiling was printed the ~0.64 seconds which made more sense. Why it is different ?
I am using oneapi 2023 with icpx compiler