aclrtProcessReport
Applicable Products
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Function
Sets a timeout interval for executing the callback task delivered by the aclrtLaunchCallback API.
This API must be work with the following APIs to implement the callback function in asynchronous scenarios:
- Define and implement a callback function. Function prototype: typedef void (*aclrtCallback)(void *userData)
- Create a thread. Call aclrtProcessReport in the thread function to set the timeout interval (cyclic calling is required), and wait for the callback task execution.
- 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.
- Execute an asynchronous task (for example, an asynchronous inference job) on the specified stream.
- 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.
- After all asynchronous tasks are executed, call aclrtUnSubscribeReport to unsubscribe from the thread.
Prototype
1
|
aclError aclrtProcessReport(int32_t timeout) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
timeout |
Input |
Timeout interval (ms). Value range:
|
Returns
0 on success; otherwise, failure. For details, see aclError.
Parent topic: Execution Control