FreeAllEvent

Function Usage

Releases all events in a queue. It is an extra protection mechanism to prevent mismatch of synchronization events. You are advised to ensure that the AllocTensor/FreeTensor and EnQue/DeQue are used in pairs. If they are used in pairs, you do not need to call FreeAllEvent.

Prototype

1
__aicore__ inline void FreeAllEvent()

Parameters

None

Availability

Atlas Training Series Product

Precautions

None

Returns

None

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// API: DeQue Tensor
AscendC::TPipe pipe;
AscendC::TQueBind<AscendC::TPosition::VECOUT, AscendC::TPosition::GM, 4> que;
int num = 4;
int len = 1024;
pipe.InitBuffer(que, num, len);
AscendC::LocalTensor<half> tensor1 = que.AllocTensor<half>();
que.EnQue(tensor1);
tensor1 = que.DeQue<half>(); // Move the tensor out of the VECOUT queue.
que.FreeTensor<half>(tensor1);
que.FreeAllEvent();