MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / cuStreamGetIdFallback

Function cuStreamGetIdFallback

src/cvcuda/util/StreamId.cpp:57–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57CUresult cuStreamGetIdFallback(CUstream stream, unsigned long long *id)
58{
59 // If the stream handle is a pseudohandle, use some special treatment....
60 if (stream == 0 || stream == CU_STREAM_LEGACY || stream == CU_STREAM_PER_THREAD)
61 {
62 int dev = -1;
63 if (cudaGetDevice(&dev) != cudaSuccess)
64 return CUDA_ERROR_INVALID_CONTEXT;
65 // If we use a per-thread stream, get TID; otherwise use -1 as a pseudo-tid
66 *id = MakeLegacyStreamId(dev, stream == CU_STREAM_PER_THREAD ? getTID() : -1);
67 return CUDA_SUCCESS;
68 }
69 else
70 {
71 // Otherwise just use the handle - it's not perfactly safe, but should do.
72 *id = (uint64_t)stream;
73 return CUDA_SUCCESS;
74 }
75}
76
77cuStreamGetId_t *getRealStreamIdFunc()
78{

Callers

nothing calls this directly

Calls 2

MakeLegacyStreamIdFunction · 0.85
getTIDFunction · 0.85

Tested by

no test coverage detected