cuda.bindings._v2.driver.green_ctx_stream_create#

cuda.bindings._v2.driver.green_ctx_stream_create(
intptr_t green_ctx,
unsigned int flags,
int priority,
) → intptr_t#

Create a stream for use in the green context.

Creates a stream for use in the specified green context green_ctx and returns a handle in ph_stream. The stream can be destroyed by calling cuStreamDestroy(). Note that the API ignores the context that is current to the calling thread and creates a stream in the specified green context green_ctx. The supported values for flags are:.

  • CU_STREAM_NON_BLOCKING: This must be specified. It indicates that work running in the created stream may run concurrently with work in the default stream, and that the created stream should perform no implicit synchronization with the default stream.

Specifying priority 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. priority follows a convention where lower numbers represent higher priorities. ‘0’ represents default priority. The range of meaningful numerical priorities can be queried using cuCtxGetStreamPriorityRange. If the specified priority is outside the numerical range returned by cuCtxGetStreamPriorityRange, it will automatically be clamped to the lowest or the highest number in the range.

Parameters:
  • green_ctx (intptr_t) – Green context for which to create the stream for.

  • flags (unsigned int) – Flags for stream creation. CU_STREAM_NON_BLOCKING must be specified.

  • priority (int) – Stream priority. Lower numbers represent higher priorities. See cuCtxGetStreamPriorityRange for more information about meaningful stream priorities that can be passed.

Returns:

Returned newly created stream.

Return type:

intptr_t

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

cuGreenCtxStreamCreate