aclrtResetEvent
产品支持情况
产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
功能说明
复位Event,恢复Event初始状态,便于Event对象重复使用。异步接口。
对于多个Stream间任务同步的场景,通常在调用aclrtStreamWaitEvent接口之后再复位Event。
函数原型
aclError aclrtResetEvent(aclrtEvent event, aclrtStream stream)
参数说明
参数名 |
输入/输出 |
说明 |
|---|---|---|
event |
输入 |
待复位的Event。 |
stream |
输入 |
指定Stream。 多个Stream间任务同步的场景,例如,Stream2中的任务依赖Stream1中的任务时,此处配置为Stream2。 |
返回值说明
返回0表示成功,返回其他值表示失败,请参见aclError。
约束说明
仅支持复位由aclrtCreateEventWithFlag接口创建的、带有ACL_EVENT_SYNC标志的Event。
注意,在多个Stream中的任务需要等待同一个Event的情况下,不建议使用调用此接口来复位Event。如图所示,如果在stream2中的aclrtStreamWaitEvent接口之后调用aclrtResetEvent接口,Event将被复位,这会导致stream3中的aclrtStreamWaitEvent接口无法成功。

父主题: Event管理