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

#### 产品支持情况

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


#### 功能说明

查询指定Stream上的所有任务的执行状态。


#### 函数原型

- C函数原型
  1 aclError aclrtStreamQuery(aclrtStream stream, aclrtStreamStatus *status)

- python函数
  1 status, ret = acl.rt.stream_query(stream)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| stream | int，待操作Stream的指针地址。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| status | Stream上的任务状态，具体请参见aclrtStreamStatus。 |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 约束说明

本接口支持在以下场景使用：

- 昇腾虚拟化实例（Ascend Virtual Instance）场景下支持使用该接口查询任务的执行状态。
