---
title: GetStreamId
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0364.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0364.html
indexId: 2979d03c3e4d5b9509430bd21687d7d8197aad88ce6ec2f28cc75606b87cb85972
---
# GetStreamId

#### 产品支持情况

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


#### 头文件/库文件

- 头文件：#include <graph/kernel_launch_info.h>
- 库文件：libregister.so


#### 功能说明

获取当前Task所在流的id。


#### 函数原型

```
uint32_t GetStreamId() const
```


#### 参数说明

无


#### 返回值说明

返回当前Task所在流的id，默认值为0。

异常时，返回int32_max。


#### 约束说明

无


#### 调用示例

```
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  auto aicore_task = KernelLaunchInfo::LoadFromData(context, tasks.back());
  auto stream_id = aicore_task.GetStreamId();
}
```
