cuda::experimental::stf::stream_pool#
-
class stream_pool#
A stream_pool object stores a set of streams associated to a specific CUDA context (device, green context, …)
This class uses a PIMPL idiom so that it is copyable and movable with shared semantics: copies refer to the same underlying pool of streams.
When a slot is empty, next(place) activates the place (RAII guard) and calls place.create_stream(). Defined in places.cuh.
Public Types
-
using iterator = ::std::vector<decorated_stream>::iterator#
Public Functions
-
stream_pool() = default#
-
inline explicit stream_pool(size_t n)#
-
inline explicit stream_pool(decorated_stream ds)#
-
stream_pool(const stream_pool&) = default#
-
stream_pool(stream_pool&&) = default#
-
stream_pool &operator=(const stream_pool&) = default#
-
stream_pool &operator=(stream_pool&&) = default#
-
inline decorated_stream next(const exec_place &place)#
Get the next stream in the pool; when a slot is empty, activate the place (RAII guard) and call place.create_stream().
Defined in places.cuh so the pool can use exec_place_guard and exec_place::create_stream().
-
inline size_t size() const#
Number of streams in the pool.
CUDA streams are initialized lazily, so this gives the number of slots available in the pool, not the number of streams initialized.
-
inline explicit operator bool() const#
-
inline bool operator==(const stream_pool &other) const#
-
inline bool operator<(const stream_pool &other) const#
-
using iterator = ::std::vector<decorated_stream>::iterator#