Singleton cache that provides one CUDA stream per (context, thread) pair. More...
#include <stream.hpp>
Public Member Functions | |
| StreamCachePerThreadAndContext (StreamCachePerThreadAndContext const &)=delete | |
| StreamCachePerThreadAndContext & | operator= (StreamCachePerThreadAndContext const &)=delete |
| StreamCachePerThreadAndContext (StreamCachePerThreadAndContext &&o)=delete | |
| StreamCachePerThreadAndContext & | operator= (StreamCachePerThreadAndContext &&o)=delete |
Static Public Member Functions | |
| static KVIKIO_EXPORT CUstream | get () |
| Get or create a CUDA stream for the current context and thread. More... | |
Singleton cache that provides one CUDA stream per (context, thread) pair.
This class manages CUDA streams used for host-device memory transfers. Each unique combination of CUDA context and calling thread is assigned a dedicated stream, which is created lazily on first access and reused for subsequent calls.
The cache is thread-safe and handles concurrent access from multiple threads.
Definition at line 29 of file detail/stream.hpp.
|
static |
Get or create a CUDA stream for the current context and thread.
If a stream already exists for the current (context, thread) pair, it is returned. Otherwise, a new stream is created, cached, and returned.