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

#### 产品支持情况

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


#### 功能说明

获取指定Stream的ID。


#### 函数原型

- C函数原型
  1 aclError aclrtStreamGetId(aclrtStream stream, int32_t *streamId)

- python函数
  1 stream_id, ret = acl.rt.stream_get_id(stream)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| stream | int，指定要查询的Stream指针地址，若传入0，则操作默认Stream。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| stream\_id | int，stream ID。 |
| ret | int，返回0表示成功，返回其他值表示失败，请参见17.1\-aclError。 |
