Importing a NvSciSync Object into cuDLA

  1. Query NvSciSyncObj attributes (for waiting or signaling) from cuDLA.

    Use cudlaGetNvSciSyncAttributes API to query the NvSciSync attributes from cuDLA for a given cuDLA device. NvSciSyncAttrLists passed to this API must be created and managed by the application.

  2. NvSciSync objects registration/unregistration with cuDLA.
    • Use cudlaImportExternalSemaphore API to register/import an NvSciSync object into the DLA address space. This API accepts a valid NvSciSyncObject as a parameter to cudlaExternalSemaphoreHandleDesc.
    • On completion, the pointer returned by the above API internally holds a reference to the NvSciSyncObject passed earlier and can be used during DLA task submission to create wait events or signal events accordingly.
    • Use cudlaMemUnregister to unregister/destroy an already registered/imported NvSciSync Object from the DLA address space.
  3. Wait for an NvSciSyncFence.

    All events that the application wishes to wait on must be specified in the waitEvents field for a particular task. The corresponding task would wait for all the wait dependencies to be met before beginning execution on the DLA HW. Such wait happens asynchronously on the DLA (i.e., the calling thread returns immediately).

  4. Get an NvSciSyncFence.
    • cudlaSignalEvents takes a valid NvSciSyncFence. This is passed in cudlaTask when the task is triggered.
    • Upon return, the fence tracks the completion of all work submitted on that cuDLA task.
    • Waiting on a fence is equivalent to waiting for the completion of that cuDLA task. The NvSciSyncFence is ignaled by the DLA when the task finishes, and any potential waiters waiting on the NvSciSyncFence are unblocked.
Note: Previous content of the passed NvSciSyncFence will be overwritten.