aclrtProcessReport

Applicability

Product

Supported

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Sets the timeout of waiting for the callback task delivered by aclrtLaunchCallback to be executed.

This API must be work with the following APIs to implement the callback function in asynchronous scenarios:
  1. Define and implement a callback function. Function prototype: typedef void (*aclrtCallback)(void *userData)
  2. Create a thread. Call aclrtProcessReport in the thread function to set the timeout interval (cyclic calling is required), and wait for the callback task to be executed.
  3. Call aclrtSubscribeReport to bind the thread created in Step 2 to the stream. The callback function delivered by the stream is executed in the bound thread.
  4. Execute an asynchronous task (for example, an asynchronous inference job) on the specified stream.
  5. Call aclrtLaunchCallback to deliver a callback task in the task queue of the stream and trigger the thread created in step 2 to process the callback function. Each time aclrtLaunchCallback is called, the callback function is executed.
  6. After all asynchronous tasks are executed, call aclrtUnSubscribeReport to unsubscribe from the thread.

Prototype

aclError aclrtProcessReport(int32_t timeout)

Parameters

Parameter

Input/Output

Description

timeout

Input

Timeout period (ms).

Value range:

  • –1: infinite wait.
  • Values greater than 0 (excluding 0): the wait period.

Returns

0 on success; else, failure. For details, see aclError.

See Also

For details about the API call sequence and sample code, see Asynchronous Model Inference.