Skip to main content

cudaDeviceRegisterAsyncNotification

Function cudaDeviceRegisterAsyncNotification 

Source
pub unsafe extern "C" fn cudaDeviceRegisterAsyncNotification(
    device: c_int,
    callbackFunc: cudaAsyncCallback,
    userData: *mut c_void,
    callback: *mut cudaAsyncCallbackHandle_t,
) -> cudaError_t
Expand description

Registers a callback function to receive async notifications.

Registers callbackFunc to receive async notifications.

The userData parameter is passed to the callback function at async notification time. Likewise, callback is also passed to the callback function to distinguish between multiple registered callbacks.

The callback function being registered should be designed to return quickly (~10ms). Any long running tasks should be queued for execution on an application thread.

Callbacks may not call cudaDeviceRegisterAsyncNotification or cudaDeviceUnregisterAsyncNotification. Doing so will result in cudaError_t::CUDA_ERROR_NOT_PERMITTED. Async notification callbacks execute in an undefined order and may be serialized.

Returns in *callback a handle representing the registered callback instance.

Note that this function may also return error codes from previous, asynchronous launches.

§Parameters

  • device: The device on which to register the callback.
  • callbackFunc: The function to register as a callback.
  • userData: A generic pointer to user data. This is passed into the callback function.
  • callback: A handle representing the registered callback instance.

§Return value

See also: cudaDeviceUnregisterAsyncNotification.