Function cuCtxRecordEvent

Source
pub unsafe extern "C" fn cuCtxRecordEvent(
    hCtx: CUcontext,
    hEvent: CUevent,
) -> CUresult
Expand description

\brief Records an event.

Captures in \p hEvent all the activities of the context \p hCtx at the time of this call. \p hEvent and \p hCtx must be from the same CUDA context, otherwise ::CUDA_ERROR_INVALID_HANDLE will be returned. Calls such as ::cuEventQuery() or ::cuCtxWaitEvent() will then examine or wait for completion of the work that was captured. Uses of \p hCtx after this call do not modify \p hEvent. If the context passed to \p hCtx is the primary context, \p hEvent will capture all the activities of the primary context and its green contexts. If the context passed to \p hCtx is a context converted from green context via ::cuCtxFromGreenCtx(), \p hEvent will capture only the activities of the green context.

\note The API will return ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED if the specified context \p hCtx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.

\param hCtx - Context to record event for \param hEvent - Event to record

\return ::CUDA_SUCCESS ::CUDA_ERROR_DEINITIALIZED, ::CUDA_ERROR_NOT_INITIALIZED, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_INVALID_HANDLE, ::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED

\sa ::cuCtxWaitEvent, ::cuGreenCtxRecordEvent, ::cuGreenCtxWaitEvent, ::cuEventRecord