pub unsafe extern "C" fn cudaStreamGetId(
hStream: cudaStream_t,
streamId: *mut c_ulonglong,
) -> cudaError_tExpand description
Query the Id of a stream.
Query the Id of a stream. The Id is returned in streamId. The Id is unique for the life of the program.
The stream handle hStream can refer to any of the following:
- a stream created via any of the CUDA runtime APIs such as
cudaStreamCreate,cudaStreamCreateWithFlagsandcudaStreamCreateWithPriority, or their driver API equivalents such ascuStreamCreateorcuStreamCreateWithPriority. Passing an invalid handle will result in undefined behavior. - any of the special streams such as the NULL stream, cudaStreamLegacy and cudaStreamPerThread respectively. The driver API equivalents of these are also accepted which are NULL,
CU_STREAM_LEGACYandCU_STREAM_PER_THREAD.
Note: This function uses standard default stream semantics.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
§Parameters
hStream: Handle to the stream to be queried.streamId: Pointer to an unsigned long long in which the stream Id is returned.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_INVALID_HANDLE
See also: cudaStreamCreateWithPriority, cudaStreamCreateWithFlags, cudaStreamGetPriority, cudaStreamGetFlags, cuStreamGetId.