---
title: 函数：query_event
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclpythondevg_01_0095.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclpythondevg_01_0095.html
indexId: b57847796937b0493a90d214093adf734784022099d098b160f7134abb0d296471
---
# 函数：query_event

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |


#### 功能说明

查询与本接口在同一线程中的acl.rt.record_event接口所记录的Event是否执行完成。

此接口后续版本会废弃，请使用函数：query_event_status接口。


#### 函数原型

- C函数原型
  1 aclError aclrtQueryEvent(aclrtEvent event, aclrtEventStatus *status)

- python函数
  1 status, ret = acl.rt.query_event(event)


#### 参数说明

| 参数名 | 说明 |
| --- | --- |
| event | int，指定待查询的Event对象指针地址。 |


#### 返回值说明

| 返回值 | 说明 |
| --- | --- |
| status | int，表示的是Event状态的指针地址。 ACL\_EVENT\_RECORDED\_STATUS\_NOT\_READY = 0，Event未被记录到Stream中，或记录到Stream中的Event未被执行或执行失败。 ACL\_EVENT\_RECORDED\_STATUS\_COMPLETE = 1，记录到Stream中的Event执行成功。 |
| ret | int，错误码，返回0表示成功，返回其它值表示失败。 |
