aclrtCreateEvent

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Description

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, as shown in the following table.

Model

Max. Events for a Device

Atlas inference product

1,023

Atlas training product

65,535

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

65536