cuda.bindings._v2.driver.device_register_async_notification#

cuda.bindings._v2.driver.device_register_async_notification(
int device,
intptr_t callback_func,
intptr_t user_data,
) → intptr_t#

Registers a callback function to receive async notifications.

Registers callback_func to receive async notifications. The user_data 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 cuDeviceRegisterAsyncNotification or cuDeviceUnregisterAsyncNotification. Doing so will result in 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.

Parameters:
  • device (int) – The device on which to register the callback.

  • callback_func (intptr_t) – The function to register as a callback.

  • user_data (intptr_t) – A generic pointer to user data. This is passed into the callback function.

Returns:

A handle representing the registered callback instance.

Return type:

intptr_t

See also

cuDeviceRegisterAsyncNotification