Event profiling

Profiling is an important tool, which must be used for tuning any high performance application. OpenCL provides this mechanism by making the cl_event objects to hold the timing information. This timing information can be captured using the clGetEventProfilingInfo function. The command_queue queue should be created with CL_QUEUE_PROFILING_ENABLE flag set as properties argument in clCreateCommandQueue.

If the queue is enabled for profiling then the following function returns profiling information for the enqueued task associated with the event object:

cl_int clGetEventProfilingInfo (cl_event event,cl_profiling_info param_name,size_t param_value_size,void *param_value,size_t *param_value_size_ret)

All the timestamps CL_PROFILING_COMMAND_[QUEUED|SUBMIT|START|END] ...

Get OpenCL Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.