aclrtStreamWaitEvent
Applicability
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
Blocks the running of a specified stream or multiple streams until the specified event is complete. This API is asynchronous.
All subsequent tasks submitted to the stream can be executed only after all tasks captured by the event are complete. For more details, see aclrtRecordEvent.
Prototype
aclError aclrtStreamWaitEvent(aclrtStream stream, aclrtEvent event)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
stream |
Input |
Stream. For stream synchronization, for example, Stream2 waits for Stream1, set this parameter to Stream2. To specify the default stream, pass NULL. |
|
event |
Input |
Event to wait on. |
Returns
0 on success; else, failure. For details, see aclError.
Restrictions
After initialization by calling aclInit in a process, you can call aclrtSetOpWaitTimeout to set the timeout. Tasks delivered by calling aclrtStreamWaitEvent in the process can wait within the configured timeout. If the wait time exceeds the configured timeout, an error will be returned after a synchronization API (for example, aclrtSynchronizeStream) is called.