aclrtCreateEventWithFlag
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Creates an event with a flag. Events with different flags provide different functions. When an event is created, multiple flags can be set (bitwise OR operation) to enable the corresponding functions.
Prototype
1 | aclError aclrtCreateEventWithFlag(aclrtEvent *event, uint32_t flag) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
event |
Output |
Event pointer. For details about the type definition, see aclrtEvent. |
flag |
Input |
Flag of the event pointer. flag is a bitmap. You can set the flag to a single macro or perform the OR operation on multiple macros. Currently, flag can be set to the following macros:
The macros are defined as follows: #define ACL_EVENT_TIME_LINE 0x00000008U #define ACL_EVENT_SYNC 0x00000001U #define ACL_EVENT_CAPTURE_STREAM_PROGRESS 0x00000002U #define ACL_EVENT_EXTERNAL 0x00000020U #define ACL_EVENT_DEVICE_USE_ONLY 0x00000010U |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
- The support for the ACL_EVENT_DEVICE_USE_ONLY macro varies depending on the product model.
Ascend 950PR /Ascend 950DT : supportedAtlas A3 training products /Atlas A3 inference products : supportedAtlas A2 training products /Atlas A2 inference products : supportedAtlas 200I/500 A2 inference products : not supportedAtlas inference products : supported - 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. 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, depending on the hardware model.
- For the following product models, a maximum of 65,536 events are supported by a single device is:
Atlas A3 training products /Atlas A3 inference products Atlas A2 training products /Atlas A2 inference products Atlas 200I/500 A2 inference products - For the
Atlas inference products , a maximum of 1,023 events are supported by a single device. - For the
Atlas training products , a maximum of 65,535 events are supported by a single device.
- For the following product models, a maximum of 65,536 events are supported by a single device is: