cuda.bindings._v2.driver.event_elapsed_time_v2#
- cuda.bindings._v2.driver.event_elapsed_time_v2(intptr_t h_start, intptr_t h_end) float#
Computes the elapsed time between two events.
Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). Note this API is not guaranteed to return the latest errors for pending work. As such this API is intended to serve as an elapsed time calculation only and any polling for completion on the events to be compared should be done with
cuEventQueryinstead. If either event was last recorded in a non-NULL stream, the resulting time may be greater than expected (even if both used the same stream handle). This happens because theevent_record()operation takes place asynchronously and there is no guarantee that the measured latency is actually just between the two events. Any number of other different stream operations could execute in between the two measured events, thus altering the timing in a significant way. Ifevent_record()has not been called on either event thenCUDA_ERROR_INVALID_HANDLEis returned. Ifevent_record()has been called on both events but one or both of them has not yet been completed (that is,event_query()would returnCUDA_ERROR_NOT_READYon at least one of the events),CUDA_ERROR_NOT_READYis returned. If either event was created with theCU_EVENT_DISABLE_TIMINGflag, then this function will returnCUDA_ERROR_INVALID_HANDLE.- Parameters:
h_start (intptr_t) – Starting event.
h_end (intptr_t) – Ending event.
- Returns:
Time between
h_startandh_endin ms.- Return type:
See also
cuEventElapsedTime_v2