---
title: aclrtCreateEvent
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/runtimeapi/aclcppdevg_03_0079.html
sourcePath: /source/zh/canncommercial/900/API/runtimeapi/aclcppdevg_03_0079.html
indexId: d3a9e8937dd39f0c643ceda5d7a1c5d1b6ba961153b5d9ffb8cb24b46c73bc5b68
---
# aclrtCreateEvent

#### 产品支持情况

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


#### 功能说明

创建Event，创建出来的Event可用于统计两个Event之间的耗时、多Stream之间的任务同步等场景。


#### 函数原型

```
aclError aclrtCreateEvent(aclrtEvent *event)
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| event | 输出 | Event的指针。类型定义请参见aclrtEvent。 |


#### 返回值说明

返回0表示成功，返回其他值表示失败，请参见aclError。


#### 约束说明

采用本API创建的Event不支持在aclrtResetEvent接口中使用，否则会导致未定义的行为。

调用本接口创建Event时，并不会实际申请Event资源，只有在调用aclrtRecordEvent接口时，才会进行资源申请，因此在调用aclrtRecordEvent时，可能会出现线程阻塞，等待Event资源的释放。

不同型号的硬件支持的Event数量不同，如下表所示：

| 型号 | 单个Device支持的Event最大数 |
| --- | --- |
| Atlas 推理系列产品 | 1023 |
| Atlas 训练系列产品 | 65535 |
| Atlas 350 加速卡 Atlas A3 训练系列产品 / Atlas A3 推理系列产品 Atlas A2 训练系列产品 / Atlas A2 推理系列产品 Atlas 200I/500 A2 推理产品 | 65536 |
