aclrtCreateEvent
Description
Creates an event, which can be used to compute the elapsed time between two events and synchronize streams.
Restrictions
After an event is created by calling this API, the system applies for event resources only when the aclrtRecordEvent API is called. Therefore, the number of events is limited. After the number of events reaches the upper limit, the system waits for resource release.
The number of events supported varies depending on the hardware model, as shown in the following table.
|
Model |
Maximum Number of Events Supported by a Device |
|---|---|
|
|
1,023 |
|
|
65,535 |
Prototype
aclError aclrtCreateEvent(aclrtEvent *event)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
event |
Output |
Event pointer. |
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.
Related APIs
You can also use the aclrtCreateEventWithFlag or aclrtCreateEventExWithFlag API to create an event with an identifier. Events with different identifiers are used for different functions.