---
title: 函数：process_report
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0106.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0106.html
indexId: e8865ee011d330e21222d9805b840cca8a1120798ba99da01d6231663760497971
---
# 函数：process_report

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

异步任务场景下，调用本接口设置超时时间，等待acl.rt.launch_callback接口下发的回调任务执行。

本接口需与以下其它接口配合使用，以便实现异步场景下的Callback功能：1. 新建线程，在线程函数内，调用  acl.rt.process_report
接口设置超时时间（需循环调用），等待  acl.rt.launch_callback
接口下发的函数回调任务。
2. 调用  acl.rt.subscribe_report
接口建立第1步中的线程和Stream的绑定关系，该Stream下发的函数回调任务将在绑定的线程中执行。
3. 在指定Stream上执行异步任务（例如异步推理任务）。
4. 定义并实现回调函数，调用acl.rt.launch_callback接口在Stream的任务队列中下发函数回调任务，触发acl.rt.subscribe_report订阅的线程处理回调函数，每调用一次acl.rt.launch_callback接口，就会下发一个回调函数任务。
5. 异步任务全部执行完成后，调用  acl.rt.unsubscribe_report
接口取消线程订阅，解除线程和Stream的绑定关系。


#### 函数原型

- C函数原型
  1 aclError aclrtProcessReport(int32_t timeout)

- python函数
  1 ret = acl.rt.process_report(timeout)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| timeout | timeout：int，指定超时时间，单位为ms。 取值范围为： \-1：表示无限等待。 大于0（不包含0）：表示等待的时间。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 资源参考

- 接口调用流程，参见  接口调用流程(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0037.html)
。
- 接口调用示例，参见  示例代码(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0038.html)
。
