cubecl_hip_sys

Function hipEventElapsedTime

Source
pub unsafe extern "C" fn hipEventElapsedTime(
    ms: *mut f32,
    start: hipEvent_t,
    stop: hipEvent_t,
) -> hipError_t
Expand description

@brief Return the elapsed time between two events.

@param[out] ms : Return time between start and stop in ms. @param[in] start : Start event. @param[in] stop : Stop event. @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotReady, #hipErrorInvalidHandle, #hipErrorNotInitialized, #hipErrorLaunchFailure

Computes the elapsed time between two events. Time is computed in ms, with a resolution of approximately 1 us.

Events which are recorded in a NULL stream will block until all commands on all other streams complete execution, and then record the timestamp.

Events which are recorded in a non-NULL stream will record their timestamp when they reach the head of the specified stream, after all previous commands in that stream have completed executing. Thus the time that the event recorded may be significantly after the host calls hipEventRecord().

If hipEventRecord() has not been called on either event, then #hipErrorInvalidHandle is returned. If hipEventRecord() has been called on both events, but the timestamp has not yet been recorded on one or both events (that is, hipEventQuery() would return #hipErrorNotReady on at least one of the events), then #hipErrorNotReady is returned.

@see hipEventCreate, hipEventCreateWithFlags, hipEventQuery, hipEventDestroy, hipEventRecord, hipEventSynchronize