下载
中文
注册

HasTensorInQue

功能说明

查询Que中目前是否已有入队的Tensor。

函数原型

1
__aicore__ inline bool HasTensorInQue()

参数说明

支持的型号

Atlas 训练系列产品

Atlas推理系列产品AI Core

Atlas推理系列产品Vector Core

Atlas A2训练系列产品/Atlas 800I A2推理产品

Atlas 200I/500 A2推理产品

注意事项

返回值

  • true - 表示Queue中存在已入队的Tensor
  • false - 表示Queue为完全空闲

调用示例

1
2
3
4
5
6
7
// 根据VacantInQue判断当前que中是否有已入队的Tensor,当前que的深度为4,无内存Enque动作,返回为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();