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

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| 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。


#### 函数原型

```
void SetStreamId(uint32_t stream_id)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| stream\_id | 输入 | 流id。 |


#### 返回值说明

无


#### 约束说明

无


#### 调用示例

```
graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context,
    std::vector<std::vector<uint8_t>> &tasks) {
  auto wait_task = KernelLaunchInfo::CreateHcomWaitTask(context);
  wait_task.SetStreamId(attach_stream_id);
}
```
