How to get stream index(such as 14) after call cudaStreamCreate function?

1 Like

I don’t believe there is a way to get the stream index programmatically using the CUDA runtime or driver API. It might be possible using one of the profiler APIs. For that, your question may be better suited on one of the profiler forums, and I can move your question there if you like.

thanks, please move to profiler forum.

As Robert mentions there is no CUDA runtime or driver API to get the stream Id. However CUPTI provides an API cuptiGetStreamIdEx to fetch this information.

CUptiResult CUPTIAPI cuptiGetStreamIdEx(CUcontext context, CUstream stream, uint8_t perThreadStream, uint32_t *streamId);