Public Member Functions | Static Public Attributes | List of all members
rmm::cuda_stream_pool Class Reference

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_pooloperator= (cuda_stream_pool &&)=delete
 
cuda_stream_pooloperator= (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ cuda_stream_pool()

rmm::cuda_stream_pool::cuda_stream_pool ( std::size_t  pool_size = default_size)
inlineexplicit

Construct a new cuda stream pool object of the given non-zero size.

Exceptions
logic_errorif pool_size is zero
Parameters
pool_sizeThe number of streams in the pool

Member Function Documentation

◆ get_pool_size()

std::size_t rmm::cuda_stream_pool::get_pool_size ( ) const
inlinenoexcept

Get the number of streams in the pool.

This function is thread safe with respect to other calls to the same function.

Returns
the number of streams in the pool

◆ get_stream() [1/2]

rmm::cuda_stream_view rmm::cuda_stream_pool::get_stream ( ) const
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.

Returns
rmm::cuda_stream_view

◆ get_stream() [2/2]

rmm::cuda_stream_view rmm::cuda_stream_pool::get_stream ( std::size_t  stream_id) const
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.

Parameters
stream_idUnique identifier for the desired stream
Returns
rmm::cuda_stream_view

The documentation for this class was generated from the following file: