pub unsafe extern "C" fn cudaExecutionCtxRecordEvent(
ctx: cudaExecutionContext_t,
event: cudaEvent_t,
) -> cudaError_tExpand description
Records an event for the specified execution context.
Captures in event all the activities of the execution context ctx at the time of this call. event and ctx must be from the same CUDA device, otherwise cudaErrorInvalidHandle will be returned. Calls such as cudaEventQuery or cudaExecutionCtxWaitEvent will then examine or wait for completion of the work that was captured. Uses of ctx after this call do not modify event. If the execution context passed to ctx is the device (primary) context obtained via cudaDeviceGetExecutionCtx, event will capture all the activities of the green contexts created on the device as well.
Note: The API will return cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED if the specified execution context ctx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
Note that this function may also return error codes from previous, asynchronous launches.
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: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return cudaError_t::CUDA_ERROR_INVALID_VALUE.
§Parameters
ctx: Execution context to record event for (required parameter, see note below).event: Event to record.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_DEINITIALIZEDcudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED
See also: cudaEventRecord, cudaExecutionCtxWaitEvent, cuCtxRecordEvent, cuGreenCtxRecordEvent.