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

#### 产品支持情况

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


#### 功能说明

阻塞应用程序运行，直到指定Stream中的所有任务都完成。


#### 函数原型

- C函数原型
  1 aclError aclrtSynchronizeStream(aclrtStream stream)

- python函数
  1 ret = acl.rt.synchronize_stream(stream)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| stream | int，指定需要完成所有任务的Stream对象的指针地址。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |


#### 资源参考

接口调用示例，参见关于Stream间任务的同步等待（通过Event实现）(https://www.hiascend.comdocument/detail/zh/canncommercial/900/programug/acldevg/aclpythondevg_0026.html)。
