pub unsafe extern "C" fn cudaEventRecord(
event: cudaEvent_t,
stream: cudaStream_t,
) -> cudaError_tExpand description
Records an event.
Captures in event the contents of stream at the time of this call. event and stream must be on the same CUDA context. Calls such as cudaEventQuery or cudaStreamWaitEvent will then examine or wait for completion of the work that was captured. Uses of stream after this call do not modify event. See note on default stream behavior for what is captured in the default case.
cudaEventRecord can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as cudaStreamWaitEvent use the most recently captured state at the time of the API call, and are not affected by later calls to cudaEventRecord. Before the first call to cudaEventRecord, an event represents an empty set of work, so for example cudaEventQuery would return cudaError_t::CUDA_SUCCESS.
Note: This function uses standard default stream semantics.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
Note: Returns cudaError_t::CUDA_ERROR_INVALID_HANDLE in the event of being passed NULL as the input event.
§Parameters
event: Event to record.stream: Stream in which to record event.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_INVALID_HANDLEcudaError_t::CUDA_ERROR_LAUNCH_FAILED
See also: cudaEventCreate (C API), cudaEventCreateWithFlags, cudaEventQuery, cudaEventSynchronize, cudaEventDestroy, cudaEventElapsedTime, cudaStreamWaitEvent, cudaEventRecordWithFlags, cuEventRecord.