Function get_host_timer

Source
pub fn get_host_timer(
    device: &WrappedMutablePointer<c_void>,
) -> Result<cl_ulong, OpenCLAPIError>
Expand description

clGetHostTimer returns the current value of the host clock as seen by device. This value is in the same timebase as the host_timestamp returned from clGetDeviceAndHostTimer. The implementation will return with as low a latency as possible to allow a correlation with a subsequent application sampled time. The host timestamp and device timestamp returned by this function and clGetDeviceAndHostTimer 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.

clGetHostTimer will return CL_SUCCESS with a time value in host_timestamp if provided. Otherwise, it returns one of the following errors:

  • CL_INVALID_DEVICE if device is not a valid device.

  • CL_INVALID_OPERATION if the platform associated with device does not support device and host timer synchronization.

  • CL_INVALID_VALUE if host_timestamp is NULL.

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.