Function: create_event

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

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()
    

Parameter Description

None.

Return Value Description

Return Value

Description

event

Int, pointer address of the created event object.

ret

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

Restrictions

After an event is created by calling this API, the system applies for event resources only when the acl.rt.record_event 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.

Limit on the number of events:

For the Atlas inference products, a single device supports a maximum of 1023 events.

For the Atlas 200I/500 A2 inference products, a single device supports a maximum of 65536 events.

For the Atlas training products, a single device supports a maximum of 65535 events.

For the Atlas A2 training products/Atlas A2 inference products, a single device supports a maximum of 65536 events.

For the Atlas A3 training products/Atlas A3 inference products, a single device supports a maximum of 65536 events.