Home
libkvikio
cucim
cudf-java
cudf
cugraph
cuml
cuproj
cuspatial
cuvs
cuxfilter
dask-cuda
dask-cudf
kvikio
libcudf
libcuml
libcuproj
libcuspatial
libkvikio
librapidsmpf
librmm
libucxx
nvforest
raft
rapids-cmake
rapidsmpf
rmm
ucxx
stable (26.04)
nightly (26.06)
stable (26.04)
legacy (26.02)
include
kvikio
detail
detail/stream.hpp
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
#pragma once
6
7
#include <map>
8
#include <mutex>
9
#include <thread>
10
11
#include <kvikio/shim/cuda.hpp>
12
13
namespace
kvikio::detail {
29
class
StreamCachePerThreadAndContext
{
30
private
:
31
std::map<std::pair<CUcontext, std::thread::id>, CUstream> _streams;
32
std::mutex
mutable
_mutex;
33
34
private
:
35
StreamCachePerThreadAndContext
() =
default
;
36
~
StreamCachePerThreadAndContext
() =
default
;
37
38
public
:
48
KVIKIO_EXPORT
static
CUstream
get
();
49
50
StreamCachePerThreadAndContext
(
StreamCachePerThreadAndContext
const
&) =
delete
;
51
StreamCachePerThreadAndContext
& operator=(
StreamCachePerThreadAndContext
const
&) =
delete
;
52
StreamCachePerThreadAndContext
(
StreamCachePerThreadAndContext
&& o) =
delete
;
53
StreamCachePerThreadAndContext
& operator=(
StreamCachePerThreadAndContext
&& o) =
delete
;
54
};
55
}
// namespace kvikio::detail
kvikio::detail::StreamCachePerThreadAndContext
Singleton cache that provides one CUDA stream per (context, thread) pair.
Definition:
detail/stream.hpp:29
kvikio::detail::StreamCachePerThreadAndContext::get
static KVIKIO_EXPORT CUstream get()
Get or create a CUDA stream for the current context and thread.
Generated by
1.9.1