Skip to main content

cudaExecutionCtxSynchronize

Function cudaExecutionCtxSynchronize 

Source
pub unsafe extern "C" fn cudaExecutionCtxSynchronize(
    ctx: cudaExecutionContext_t,
) -> cudaError_t
Expand description

Block for the specified execution context’s tasks to complete.

Blocks until the specified execution context has completed all preceding requested tasks. If the specified execution context is the device (primary) context obtained via cudaDeviceGetExecutionCtx, green contexts that have been created on the device will also be synchronized.

The API returns an error if one of the preceding tasks failed.

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 synchronize (required parameter, see note below)

§Return value

See also: cudaGreenCtxCreate, cudaExecutionCtxDestroy, cudaDeviceSynchronize, cuCtxSynchronize_v2.