pub unsafe extern "C" fn cudaDeviceGetExecutionCtx(
ctx: *mut cudaExecutionContext_t,
device: c_int,
) -> cudaError_tExpand description
Returns the execution context for a device.
Returns in ctx the execution context for the specified device. This is the device’s primary context. The returned context can then be passed to APIs that take in a cudaExecutionContext_t enabling explicit context-based programming without relying on thread-local state.
Passing the returned execution context to cudaExecutionCtxDestroy is not allowed and will result in undefined behavior.
§Parameters
ctx: Returns the device execution context.device: Device to get the execution context for.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_INVALID_DEVICE
See also: cudaExecutionCtxGetDevice, cudaExecutionCtxGetId.