Host-Side Timing

The following code snippet is a host-side timing routine around a kernel call (error handling is omitted):

float start = …;//getting the first time-stamp
        clEnqueueNDRangeKernel(g_cmd_queue, …);
        clFinish(g_cmd_queue);// to make sure the kernel completed
float end = …;//getting the last time-stamp
float time = (end-start);

In this example, host-side timing is implemented using the following functions:

Remember to profile operations on memory objects separately.

See Also

Profiling Operations Using OpenCL™ Profiling Events