RMM
23.12
RAPIDS Memory Manager
|
A pool of CUDA streams. More...
#include <cuda_stream_pool.hpp>
Public Member Functions | |
cuda_stream_pool (std::size_t pool_size=default_size) | |
Construct a new cuda stream pool object of the given non-zero size. More... | |
cuda_stream_pool (cuda_stream_pool &&)=delete | |
cuda_stream_pool (cuda_stream_pool const &)=delete | |
cuda_stream_pool & | operator= (cuda_stream_pool &&)=delete |
cuda_stream_pool & | operator= (cuda_stream_pool const &)=delete |
rmm::cuda_stream_view | get_stream () const noexcept |
Get a cuda_stream_view of a stream in the pool. More... | |
rmm::cuda_stream_view | get_stream (std::size_t stream_id) const |
Get a cuda_stream_view of the stream associated with stream_id . Equivalent values of stream_id return a stream_view to the same underlying stream. More... | |
std::size_t | get_pool_size () const noexcept |
Get the number of streams in the pool. More... | |
Static Public Attributes | |
static constexpr std::size_t | default_size {16} |
Default stream pool size. | |
A pool of CUDA streams.
Provides efficient access to collection of CUDA stream objects.
Successive calls may return a cuda_stream_view
of identical streams. For example, a possible implementation is to maintain a circular buffer of cuda_stream
objects.
|
inlineexplicit |
Construct a new cuda stream pool object of the given non-zero size.
logic_error | if pool_size is zero |
pool_size | The number of streams in the pool |
|
inlinenoexcept |
Get the number of streams in the pool.
This function is thread safe with respect to other calls to the same function.
|
inlinenoexcept |
Get a cuda_stream_view
of a stream in the pool.
This function is thread safe with respect to other calls to the same function.
|
inline |
Get a cuda_stream_view
of the stream associated with stream_id
. Equivalent values of stream_id
return a stream_view to the same underlying stream.
This function is thread safe with respect to other calls to the same function.
stream_id | Unique identifier for the desired stream |