昇腾社区首页
中文
注册

torch_npu.npu.ExternalEvent().wait()

产品支持情况

产品 是否支持
[object Object]Atlas A3 训练系列产品[object Object]
[object Object]Atlas A3 推理系列产品[object Object]
[object Object]Atlas A2 训练系列产品[object Object]
[object Object]Atlas 800I A2 推理产品/A200I A2 Box 异构组件[object Object]
[object Object]Atlas 推理系列产品[object Object]
[object Object]Atlas 训练系列产品[object Object]

功能说明

阻塞指定Stream的运行,直到指定的Event完成,支持多个Stream等待同一个Event的场景。

函数原型

[object Object]

参数说明

stream (torch_npu.npu.Stream):必选参数,指定用于下发Event事件阻塞任务的流。

返回值说明

约束说明

  • 该接口是异步接口,调用接口成功仅表示任务下发成功,不表示任务执行成功。
  • 接口调用顺序:torch_npu.npu.ExternalEvent().wait()-->torch_npu.npu.ExternalEvent().reset()-->torch_npu.npu.ExternalEvent().record()或torch_npu.npu.ExternalEvent().record()-->torch_npu.npu.ExternalEvent().wait()-->torch_npu.npu.ExternalEvent().reset()。

调用示例

[object Object]