Hi ,
You have two other options also to measure the time.
Method1:
cl_int status;
cl_ulong start, end, elapsed_time;
cl::Event myevent();
cl::CommandQueue myqueue(context, device, CL_QUEUE_PROFILING_ENABLE, &status);
myqueue.enqueue…(…, &myevent);
status = myevent.getProfilingInfo(CL_PROFILING_COMMAND_START, &start);
status = myevent.getProfilingInfo(CL_PROFILING_COMMAND_END, &end, NULL);
elapsed_time = end - start;//Time it took for the task to run in nanoseconds
Method2:
You can also use the dynamic profiler described here on this YouTube video. https://youtu.be/nyivIknJaV8?t=2437
Thanks and Regards
Anil