Returns a reasonably synchronized pair of timestamps from the device timer and the host timer as seen by device.
cl_int clGetDeviceAndHostTimer(cl_device_id device, cl_ulong * device_timestamp, cl_ulong * host_timestamp)
A device returned by
Will be updated with the value of the current timer in nanoseconds. The resolution of the timer is the same as the device profiling timer returned by
Will be updated with the value of the current timer in nanoseconds at the closest possible point in time to that at which
device_timerwas returned. The resolution of the timer may be queried via
clGetPlatformInfoand the flag
Returns a reasonably synchronized pair of timestamps from the device timer and the host timer as seen by
Implementations may need to execute this query with a high latency in order to provide reasonable synchronization of the timestamps.
The host timestamp and device timestamp returned by this function and
clGetHostTimer each have an implementation defined timebase.
The timestamps will always be in their respective timebases regardless of which query function is used.
The timestamp returned from
clGetEventProfilingInfo for an event on a device and a device timestamp queried from the same device will always be in the same timebase.
clGetDeviceAndHostTimer will return
CL_SUCCESS with a time value in
host_timestamp if provided.
Otherwise, it returns one of the following errors:
deviceis not a valid OpenCL device.
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.