HasTensorInQue

Product Support

Product

Supported

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product 's AI Core

Atlas inference product 's Vector Core

x

Atlas training products

Function

Queries whether there are enqueued tensors in the queue.

Prototype

1
__aicore__ inline bool HasTensorInQue()

Parameters

None

Restrictions

This API does not support inplace tensor operations, that is, the scenario where the depth of TQue is set to 0.

Returns

  • true: Enqueued tensors exist in the queue.
  • false: The queue is completely idle.

Example

1
2
3
4
5
6
7
// Determine whether there are enqueued tensors in the current queue based on VacantInQue. The depth of the current queue is 4. If there is no memory enqueuing action, the return is false.
AscendC::TPipe pipe;
AscendC::TQue<AscendC::TPosition::VECOUT, 4> que;
int num = 4;
int len = 1024;
pipe.InitBuffer(que, num, len);
bool ret = que.HasTensorInQue();