---
title: aclrtSwitchStream
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclcppdevg_03_1893.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_1893.html
indexId: 11a5712e5aee70d64a12f9195324c70641dfe513f5bdad45ffb15eb2031c5a2268
---
# aclrtSwitchStream

#### 产品支持情况

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


#### 功能说明

根据条件在Stream之间跳转。异步接口。

跳转成功后，只执行所跳转的Stream上的任务，当前Stream上的任务停止执行。


#### 函数原型

```
aclError aclrtSwitchStream(void *leftValue, aclrtCondition cond, void *rightValue, aclrtCompareDataType dataType, aclrtStream trueStream, aclrtStream falseStream, aclrtStream stream)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| leftValue | 输入 | 左值数据的Device内存地址。 |
| cond | 输入 | 左值数据与右值数据的比较条件。类型定义请参见aclrtCondition。 |
| rightValue | 输入 | 右值数据的Device内存地址。 |
| dataType | 输入 | 左值数据、右值数据的数据类型。类型定义请参见aclrtCompareDataType。 |
| trueStream | 输入 | 根据cond处指定的条件，条件成立时，则执行trueStream上的任务。类型定义请参见aclrtStream。 |
| falseStream | 输入 | 预留参数，当前固定传NULL。 |
| stream | 输入 | 执行跳转任务的Stream。类型定义请参见aclrtStream。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。
