智能客服
你问我答,随时在线为你解决问题
用于申请HardEvent(硬件类型同步事件)的TEventID,必须与ReleaseEventID搭配使用,调用该接口后,会占用申请的TEventID,直至调用ReleaseEventID释放。
template <HardEvent evt> __aicore__ inline TEventID TPipe::AllocEventID()
| 参数名称 | 输入/输出 | 含义 |
|---|---|---|
| evt | 输入 | HardEvent硬件同步类型。 |
Kirin9020系列处理器
Kirin9030系列处理器
KirinX90系列处理器
TEventID有数量限制,使用结束应该立刻调用ReleaseEventID释放,防止TEventID耗尽。
TEventID
// 需要插入scalar与vector之间的同步,申请对应的HardEvent的ID AscendC::TEventID eventID = GetTPipePtr()->AllocEventID<AscendC::HardEvent::V_S>(); AscendC::SetFlag<AscendC::HardEvent::V_S>(eventID); // ... AscendC::WaitFlag<AscendC::HardEvent::V_S>(eventID); // 释放scalar等vector的同步HardEvent的ID GetTPipePtr()->ReleaseEventID<AscendC::HardEvent::V_S>(eventID); // ...