aclrtCreateEventExWithFlag
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
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. Event resources are not restricted by hardware for the creation of events.
Prototype
1
|
aclError aclrtCreateEventExWithFlag(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. The supported macros are as follows:
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_IPC 0x00000040U |
Returns
0 on success; otherwise, failure. For details, see aclError.
Restrictions
Events created using this API cannot be used in the following APIs: aclrtResetEvent, aclrtQueryEvent, and aclrtQueryEventWaitStatus. Otherwise, an error will be reported.
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 does not contain ACL_EVENT_SYNC, the event created by this API cannot be used in the aclrtStreamWaitEvent API. If the value of flag contains the ACL_EVENT_SYNC macro, event resources are not actually allocated. 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 |
|---|---|
|
|
1,023 |
|
|
65,535 |
|
Atlas 350 Accelerator Card |
65536 |