产品 |
是否支持 |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
x |
|
√ |
|
x |
1 2 | __aicore__ inline void SetFlag(TEventID id) __aicore__ inline void WaitFlag(TEventID id) |
参数名 |
输入/输出 |
描述 |
||
|---|---|---|---|---|
id |
输入 |
事件ID,由用户自己指定,推荐通过AllocEventID或者FetchEventID来获取。定义如下:
|
无
SetFlag/WaitFlag必须成对出现。
如DataCopy需要等待SetValue执行完成后才能执行,需要插入PIPE_S到PIPE_MTE3的同步。
1 2 3 4 5 6 7 | AscendC::GlobalTensor<half> dstGlobal; AscendC::LocalTensor<half> dstLocal; dstLocal.SetValue(0, 0); AscendC::TQueSync<PIPE_S, PIPE_MTE3> sync; sync.SetFlag(0); sync.WaitFlag(0); AscendC::DataCopy(dstGlobal, dstLocal, dataSize); |