Function rcudnn::cudaEventElapsedTime[][src]

pub unsafe extern "C" fn cudaEventElapsedTime(
    ms: *mut f32,
    start: *mut CUevent_st,
    end: *mut CUevent_st
) -> cudaError
Expand description

\brief Computes the elapsed time between events

Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds).

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 the ::cudaEventRecord() 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.

If ::cudaEventRecord() has not been called on either event, then ::cudaErrorInvalidResourceHandle is returned. If ::cudaEventRecord() has been called on both events but one or both of them has not yet been completed (that is, ::cudaEventQuery() would return ::cudaErrorNotReady on at least one of the events), ::cudaErrorNotReady is returned. If either event was created with the ::cudaEventDisableTiming flag, then this function will return ::cudaErrorInvalidResourceHandle.

\param ms - Time between \p start and \p end in ms \param start - Starting event \param end - Ending event

\return ::cudaSuccess, ::cudaErrorNotReady, ::cudaErrorInvalidValue, ::cudaErrorInvalidResourceHandle, ::cudaErrorLaunchFailure \notefnerr \note_init_rt \note_callback

\sa \ref ::cudaEventCreate(cudaEvent_t*) “cudaEventCreate (C API)”, ::cudaEventCreateWithFlags, ::cudaEventQuery, ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventRecord, ::cuEventElapsedTime