Asynchronous stream queues#
Streams are NOT synchronous. Every async op (cudaMemcpyAsync/cudaMemsetAsync, LAUNCH_STREAM/LAUNCH_DYN_STREAM, cudaStreamAddCallback, cudaLaunchHostFunc, cudaEventRecord) is deferred into its stream’s queue and replayed only at a synchronisation point (cudaStreamSynchronize, cudaDeviceSynchronize, cudaEventSynchronize/Query, cudaStreamQuery, cudaStreamDestroy) or before any operation on the legacy default stream (a blocking cudaMemcpy/cudaMemset/ cudaFree, a plain LAUNCH, …) — the rule that stream 0 synchronises with every blocking stream.
Ops inside one stream replay in issue order; ACROSS streams the scheduler picks at random among the ops currently allowed to run, honouring cudaEventRecord / cudaStreamWaitEvent edges. So — exactly like the block and thread order randomisation — a program that omits a needed cross-stream dependency, or reads a result before synchronising, fails for some SIM_SEEDs instead of silently “working”.
Defined in code/simulator.h.
This page documents 5 symbols: 5 functions.
Functions#
Signature |
Description |
Availability |
Location |
Example |
|---|---|---|---|---|
|
sim only |
simulator.h:1389 |
||
|
sim only |
simulator.h:1390 |
||
|
sim only |
simulator.h:1387 |
||
|
sim only |
simulator.h:1319 |
||
|
Enqueue on |
sim only |
simulator.h:1396 |