I have a bunch of events which I wait for with clWaitForEvents(). Not always, but quite frequently, the end time for the events is before the start time. Is this perhaps an SDK bug?
A simplified version of what I have is something like this (all functions return without error, i.e CL_SUCCESS)
for (i = 0; i < n; ++i) { cl_event event; memset(&event, 0, sizeof(event)); clEnqueueNDRangeKernel(...., &event); clWaitForEvents(1, &event); cl_ulong start, end; clGetEventProfilingInfo(ev, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, NULL); clGetEventProfilingInfo(ev, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, NULL); assert(end >= start); // not always true! clReleaseEvent(event); }