Creates an event. This API is synchronous.
Since only the ACL_EVENT_TIME_LINE flag is supported, the number of created events is not limited, but the created events can only be used to compute the elapsed time between events.
aclError aclrtCreateEventWithFlag(aclrtEvent *event, uint32_t flag)
Parameter |
Input/Output |
Description |
|---|---|---|
event |
Output |
Event pointer. |
flag |
Input |
Flag of the event pointer. The supported macros are as follows:
flag is a bitmap. You can set the flag to a single macro or perform the OR operation on multiple macros. When this API is used to create events, if the value of flag contains the ACL_EVENT_SYNC macro, the number of created events is limited. The details are as follows: For the Ascend 310 AI Processor, a single device supports a maximum of 1023 events. For the Ascend 910 AI Processor, a single device supports a maximum of 65535 events. For the Ascend 310P AI Processor, a single device supports a maximum of 1023 events. |
0 on success; else, failure.
aclrtCreateEvent: creates an event. Only a limited number of events can be created by using this API. The created events can be used to not only compute the elapsed time between two events, but also synchronize streams and synchronize on an event.