cuda.bindings._v2.driver.stream_get_id#

cuda.bindings._v2.driver.stream_get_id(intptr_t h_stream) → unsigned long long#

Returns the unique Id associated with the stream handle supplied.

Returns in stream_id the unique Id which is associated with the given stream handle. The Id is unique for the life of the program. The stream handle h_stream can refer to any of the following:.

  • a stream created via any of the CUDA driver APIs such as cuStreamCreate and cuStreamCreateWithPriority, or their runtime API equivalents such as cudaStreamCreate, cudaStreamCreateWithFlags and cudaStreamCreateWithPriority. Passing an invalid handle will result in undefined behavior.

  • any of the special streams such as the NULL stream, CU_STREAM_LEGACY and CU_STREAM_PER_THREAD. The runtime API equivalents of these are also accepted, which are NULL, cudaStreamLegacy and cudaStreamPerThread respectively.

Parameters:

h_stream (intptr_t) – Handle to the stream to be queried.

Returns:

Pointer to store the Id of the stream.

Return type:

unsigned long long

See also

cuStreamGetId