函数:reset_event
产品支持情况
产品 |
是否支持 |
|---|---|
Atlas 350 加速卡 |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
复位一个Event。用户需确保等待Stream中的任务都完成后,再复位Event,异步接口。
函数原型
- C函数原型
1aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream)
- python函数
1ret = acl.rt.reset_event(event, stream)
参数说明
参数名 |
说明 |
|---|---|
event |
int,待复位的Event对象的指针地址。 |
stream |
int,指定Event所在的Stream的对象指针地址。 |
返回值说明
返回值 |
说明 |
|---|---|
ret |
int,错误码,返回0表示成功,返回其它值表示失败。 |
约束说明
仅支持复位由acl.rt.create_event_with_flag接口创建的、带有ACL_EVENT_SYNC标志的Event。
注意,在多个Stream中的任务需要等待同一个Event的情况下,不建议调用此接口来复位Event。如图所示,如果在stream2中的aclrtStreamWaitEvent接口之后调用aclrtResetEvent接口,Event将被复位,这会导致stream3中的aclrtStreamWaitEvent接口无法成功。

父主题: Event管理