cuda.bindings._v2.driver.stream_create_with_priority#
- cuda.bindings._v2.driver.stream_create_with_priority(
- unsigned int flags,
- int priority,
Create a stream with the given priority.
Creates a stream with the specified priority and returns a handle in
ph_stream. This affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order.priorityfollows a convention where lower numbers represent higher priorities. ‘0’ represents default priority. The range of meaningful numerical priorities can be queried usingcuCtxGetStreamPriorityRange. If the specified priority is outside the numerical range returned bycuCtxGetStreamPriorityRange, it will automatically be clamped to the lowest or the highest number in the range.- Parameters:
flags (unsigned int) – Flags for stream creation. See
cuStreamCreatefor a list of valid flags.priority (int) – Stream priority. Lower numbers represent higher priorities. See
cuCtxGetStreamPriorityRangefor more information about meaningful stream priorities that can be passed.
- Returns:
Returned newly created stream.
- Return type:
intptr_t
Note
Stream priorities are supported only on GPUs with compute capability 3.5 or higher.
Note
In the current implementation, only compute kernels launched in priority streams are affected by the stream’s priority. Stream priorities have no effect on host-to-device and device-to-host memory operations.
See also
cuStreamCreateWithPriority