昇腾社区首页
中文
注册

功能介绍

使用加速库中的EventOperation,该Operation有3种不同的OperatorType。

  • OperatorType=UNDEFINED

    此时的EventOperation在Setup和Execute阶段不会做任何操作,作为GraphOp中的一个Node时提供一种跳过机制。

  • OperatorType=RECORD

    此时的EventOperation在Setup阶段不会做任何操作,在Execute阶段会调用aclrtRecordEvent接口,将该Operation的Param中的event记录到Stream中。

  • OperatorType=WAIT

    此时的EventOperation在Setup阶段不会做任何操作,在Execute阶段会顺序调用aclrtStreamWaitEvent接口和aclrtResetEvent接口。会先阻塞这个Operation所执行的Stream的运行,直到该Operation的Param中的event被记录到Stream中,然后再复位该event使得该event可以反复被Record或者Wait(反复的被EventOperation所使用)。