---
title: 功能介绍
description: "使用加速库中的EventOperation，该Operation有3种不同的OperatorType。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_0089.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_0089.html
indexId: e171ce540a0249e47ce9f5e3e15efcfe412e36b92398ceead85f64c0cb03a73761
---
# 功能介绍

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

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

- OperatorType=RECORD
  此时的EventOperation在Setup阶段不会做任何操作，在Execute阶段会调用aclrtRecordEvent(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0083.html)接口，将该Operation的Param中的event记录到Stream中。

- OperatorType=WAIT
  此时的EventOperation在Setup阶段不会做任何操作，在Execute阶段会按顺序调用aclrtStreamWaitEvent(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0091.html)接口和aclrtResetEvent(https://www.hiascend.com/document/detail/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0084.html)接口。会先阻塞这个Operation所执行的Stream的运行，直到该Operation的Param中的event被记录到Stream中，然后再复位该event使得该event可以反复被Record或者Wait（反复地被EventOperation所使用）。
