Function: create_event

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

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

Prototype

  • C Prototype
    1
    aclError aclrtCreateEvent(aclrtEvent *event)
    
  • Python Function
    1
    event, ret = acl.rt.create_event()
    

Parameters

None

Return Value

Return Value

Description

event

Int, pointer address of the created event object.

ret

Int, error code. 0 on success; else, failure.

Restrictions

The event created using this API cannot be used in the acl.rt.reset_event API. Otherwise, undefined behavior may occur.

After an event is created by calling this API, the system allocates event resources only when acl.rt.record_event is called. Therefore, the number of events is limited. After the number of events reaches the upper limit, the system waits for resource release.

Limit on the number of events:

For the Atlas inference product, a single device supports a maximum of 1,023 events.

For the Atlas 200I/500 A2 inference product, a single device supports a maximum of 65,536 events.

For the Atlas training product, a single device supports a maximum of 65,535 events.

For the Atlas A2 training product/Atlas A2 inference product, a single device supports a maximum of 65,536 events.

For the Atlas A3 training product/Atlas A3 inference product, a single device supports a maximum of 65,536 events.