aclrtCreateEventWithFlag
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Description
Creates an event with a flag. Events with different flags are used for different functions. When an event is created, multiple flags can be carried (bitwise OR operation) to enable the corresponding flag function.
Prototype
aclError aclrtCreateEventWithFlag(aclrtEvent *event, uint32_t flag)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
event |
Output |
Event pointer. |
flag |
Input |
Flag of the event pointer. The supported macros are as follows:
|
Returns
0 on success; else, failure. For details, see aclError.
Restrictions
When this API is called to create an event, the flag is a bitmap. You can set the flag to a single macro or perform the OR operation on multiple macros.
- If the value of flag contains the ACL_EVENT_SYNC macro or is set to ACL_EVENT_EXTERNAL, the number of created events is limited. For details, see the limits 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
- If the value of flag does not contain the ACL_EVENT_SYNC macro, events created by this API cannot be used in the following APIs: aclrtResetEvent, aclrtStreamWaitEvent, and aclrtQueryEventWaitStatus.