Hi. I’m trying to measure time requested by some code written in C++ to get executed. Some part is executed on CPU and some has multiple kernel calls on GPU using OpenACC (10’000+). Trying to use std::chrono doesn’t return a reasonable time, since it requires about 2 mins of execution but the std::chrono function returns as result more than 15 minutes. My code looks something like this:
auto start = high_resolution_clock::now();
functionsCPU();
//has multiple functions inside that are executed on CPU
mixedFunctions();
//inside has some other functions executed on CPU and multiple calls to functions that run on the GPU using OpenACC (10’000+)
auto stop = high_resolution_clock::now();
auto duration = duration_cast(stop-start);
“duration” variable should return a time that converted to minutes should be about 2 mins but instead returns more than 15 minutes. What am I doing wrong?
Thanks in advance