在Stream中记录一个Event。本接口被调用时,AscendCL会捕获当前Stream上已下发的任务,并记录到Event事件中,因此后续若调用aclrtQueryEventStatus或aclrtStreamWaitEvent接口时,会检查或等待该Event事件中所捕获的任务都已经完成。
对于使用aclrtCreateEventExWithFlag创建的Event:
接口调用顺序:aclrtCreateEvent-->aclrtRecordEvent-->aclrtStreamWaitEvent-->aclrtResetEvent
aclError aclrtRecordEvent(aclrtEvent event, aclrtStream stream)
参数名 |
输入/输出 |
说明 |
---|---|---|
event |
输入 |
待记录的Event。 |
stream |
输入 |
将指定Event记录在指定的Stream中。 如果使用默认Stream,此处设置为NULL。 |
返回0表示成功,返回其它值表示失败。
接口调用流程及调用示例,参见Event的同步等待示例代码、Stream间任务的同步等待接口调用流程及示例代码。