API Log Format

The format of the API log is the following:

TID ‹thread ID› START TIME ‹processor time-stamp counter› DURATION ‹μseconds› [CMD ID ‹internal command ID›] ‹API call information›

Command IDs are attached to all OpenCL™ API calls that have an output parameter of the cl_event type in their signature (for example, enqueue APIs). The IDs are sequential numbers internally allocated by the OpenCL framework. IDs are used for referring to a specific command by other log lines (see example below).

The log may also include:

The start time is measured in clock ticks when the corresponding API is called.

The duration, measured in μseconds, is calculated from immediately after entering the API call until just before leaving it. Hence, not to be confused with the duration of asynchronous commands which can be measured by other means, like event profiling.

Example

TID      5780    START TIME 0x00038ec9f296ebb3    DURATION
0x0000000000000044                         
clGetDeviceInfo(cl_device_id device = 0000000000CF2050,
cl_device_info param_name = 4101, size_t param_value_size = 24,
void* param_value = 0000000000B6E038, size_t*
param_value_size_ret = 0000000000000000) = CL_SUCCESS,
*param_value_size_ret = NULL
Internally calculated local_work_size with for NDRangeKernel
command with ID 2: (100)
TID      5780    START TIME 0x00038ec9f2b404c3    DURATION
0x00000000000001e9    CMD ID 2
clEnqueueNDRangeKernel(cl_command_queue command_queue =
0000000009038E60, cl_kernel kernel = 0000000006DDC120, cl_uint
work_dim = 1, const size_t * global_work_offset =
0000000000000000, const size_t * global_work_size =
0000000000B6E620, const size_t * local_work_size =
0000000000B6E630, cl_uint num_events_in_wait_list = 0,
const cl_event * event_wait_list = 0000000000000000,
cl_event * event = 0000000000000000) = CL_SUCCESS,
*event = NULL
TID      5780    START TIME 0x00038ec9f2d3e7d7    DURATION
0x0000000000000225    CMD ID 3             
clEnqueueReadBuffer(cl_command_queue command_queue =
0000000009038E60, cl_mem buffer = 000000000709F6F0,
cl_bool blocking_read = 1, size_t offset = 0, size_t cb = 400,
void * ptr = 0000000000B6E44C, 
cl_uint num_events_in_wait_list = 0, const cl_event *
event_wait_list = 0000000000000000, cl_event * event =
0000000000000000) = CL_SUCCESS, *event = NULL
Internally calculated local_work_size with for 
NDRangeKernel command with ID 4: (50)
TID      5780    START TIME 0x00038ec9f2ed2e3f    DURATION
0x00000000000001d5    CMD ID 4             
clEnqueueNDRangeKernel(cl_command_queue command_queue =
0000000009038E60, cl_kernel kernel = 0000000006DDC120,
cl_uint work_dim = 1, const size_t * global_work_offset =
0000000000000000, const size_t * global_work_size =
0000000000B6E620, const size_t * local_work_size =
0000000000B6E630, cl_uint num_events_in_wait_list = 0,
const cl_event * event_wait_list = 0000000000000000,
cl_event * event = 0000000000000000) = CL_SUCCESS,
*event = NULL