cuda::experimental::places::get_stream_id#

inline unsigned long long cuda::experimental::places::get_stream_id(
cudaStream_t stream
)#

Returns the unique stream ID from the CUDA driver (cuStreamGetId).

When stream is participating in CUDA graph capture, querying the driver stream ID is not permitted (CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED). In that case this returns k_no_stream_id; callers that cache syncs treat unknown ids as never skip cudaStreamWaitEvent (see async_resources_handle).

Parameters:

stream – A valid CUDA stream, or nullptr.

Returns:

The stream’s unique ID, or k_no_stream_id if stream is nullptr.