aclrtCreateEvent

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Function

Creates an event, which can be used to compute the elapsed time between two events and synchronize tasks between streams.

Prototype

1
aclError aclrtCreateEvent(aclrtEvent *event)

Parameters

Parameter

Input/Output

Description

event

Output

Event pointer. For details about the type definition, see aclrtEvent.

Returns

0 on success; otherwise, failure. For details, see aclError.

Restrictions

  • Events created with this API cannot be used in the aclrtResetEvent API. Otherwise, undefined behavior may occur.
  • Calling this API to create an event does not allocate actual event resources. Resources are allocated only when aclrtRecordEvent is called; therefore, calling aclrtRecordEvent may cause the thread to block while waiting for event resources to be released.
  • The number of events supported varies depending on the hardware model.
    • For the following product models, a maximum of 65,536 events are supported by a single device is:

      Ascend 950PR/Ascend 950DT

      Atlas A3 training products/Atlas A3 inference products

      Atlas A2 training products/Atlas A2 inference products

      Atlas 200I/500 A2 inference products

    • For the Atlas inference products, a maximum of 1,023 events are supported by a single device.
    • For the Atlas training products, a maximum of 65,535 events are supported by a single device.