Reusable Events#

Warning

Experimental features:

  • May be replaced, updated, or removed at any time.

  • Do not require maintaining API/ABI stability of their own additions over time.

  • Do not require conformance testing of their own additions.

Motivation#

Some applications need to create event objects independently of queue submission and then reuse those events for synchronization and profiling across multiple submissions. This extension introduces explicit event creation for that use case and allows :ref:`urEnqueueEventsWaitWithBarrierExt` to signal a caller-provided event instead of always creating a new one.

Changelog#

Revision

Changes

1.0

Initial Draft

Support#

Adapters which support this experimental feature must return true for the new :ref:`UR_DEVICE_INFO_REUSABLE_EVENTS_SUPPORT_EXP <ur-device-info-t>`\ device info query. A reusable event may only be passed to :ref:`urEnqueueEventsWaitWithBarrierExt` for a queue whose device reports this query as true.

For this extension, signaling reusable events is supported through :ref:`urEnqueueEventsWaitWithBarrierExt` by passing a non-NULL phEvent that points to a reusable event created by :ref:`urEventCreateExp`.

Waiting on reusable events is supported by passing those events as dependencies in wait lists to enqueue commands.

Reusable events follow the standard event lifetime rules. An event created through :ref:`urEventCreateExp` must eventually be released with :ref:`urEventRelease`, and applications may use :ref:`urEventRetain` and :ref:`urEventGetInfo` (with :ref:`UR_EVENT_INFO_REFERENCE_COUNT <ur-event-info-t>`) for explicit reference-count management.

Contributors#