A pool of CUDA streams. More...
#include <cuda_stream_pool.hpp>
Public Member Functions | |
| cuda_stream_pool (std::size_t pool_size=default_size, cuda_stream::flags flags=cuda_stream::flags::sync_default) | |
| 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.
|
explicit |
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 |
| flags | Flags used when creating streams in the pool. |
|
noexcept |
Get the number of streams in the pool.
This function is thread safe with respect to other calls to the same function.
|
noexcept |
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.
| rmm::cuda_stream_view rmm::cuda_stream_pool::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.
This function is thread safe with respect to other calls to the same function.
| stream_id | Unique identifier for the desired stream |