Function: process_report

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Sets the timeout interval and waits for the execution of the callback task delivered by acl.rt.launch_callback in asynchronous use cases.

This API must be work with the following APIs to implement the callback function in asynchronous scenarios:

  1. Create a thread. Call acl.rt.process_report in the thread function to set the timeout interval (cyclic calling is required), and wait for the function callback task delivered by acl.rt.launch_callback.
  2. Call acl.rt.subscribe_report to bind the thread created in step 1 to the stream. The callback task delivered by the stream is executed in the bound thread.
  3. Execute an asynchronous job (for example, an asynchronous inference job) on the specified stream.
  4. Define and implement the callback function, call acl.rt.launch_callback to deliver a callback task in the task queue of the stream, and trigger the thread to process the callback function subscribed by acl.rt.subscribe_report. Each time acl.rt.launch_callback is called, a callback task is delivered.
  5. Call acl.rt.unsubscribe_report to unsubscribe from threads and unbind threads from streams after all asynchronous tasks are executed.

Prototype

  • C Prototype

    aclError aclrtProcessReport(int32_t timeout)
    
  • Python Function

    ret = acl.rt.process_report(timeout)
    

Parameters

Parameter Description
timeout timeout: int, timeout interval, in milliseconds.
Value range:
–1: infinite waiting
Value greater than 0: the wait period.

Return Values

Return Value Description
ret Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails.