aclrtCreateEvent

Applicability

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 products

Atlas training products

Description

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

Prototype

aclError aclrtCreateEvent(aclrtEvent *event)

Parameters

Parameter

Input/Output

Description

event

Output

Event pointer.

Returns

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

Restrictions

  • Events created with this API cannot be used in the aclrtResetEvent API. Otherwise, undefined behavior may occur.
  • After an event is created by calling this API, the system applies for event resources only when the aclrtRecordEvent API is called. Therefore, the number of events is limited. After the number of events reaches the upper limit, the system waits for resource release.

    The number of events supported varies depending on the hardware model, as shown in the following table.

    Model

    Maximum Number of Events Supported by a Device

    Atlas inference products

    1,023

    Atlas training products

    65,535

    Atlas A3 training products / Atlas A3 inference products

    Atlas A2 training products / Atlas A2 inference products

    Atlas 200I/500 A2 inference products

    65536

See Also

For details about the API call sequence and example, see Synchronous Wait of an Event and Synchronous Wait of Tasks Between Streams (Implemented Using Events).