公有成员函数 | 公有静态属性 | 成员列表
rmm::cuda_stream_pool 类参考

一个 CUDA 流池。 更多...

#include <cuda_stream_pool.hpp>

公有成员函数

 cuda_stream_pool (std::size_t pool_size=default_size)
 构造一个给定非零大小的新 cuda 流池对象。 更多...
 
 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
 获取流池中某个流的 cuda_stream_view更多...
 
rmm::cuda_stream_view get_stream (std::size_t stream_id) const
 获取与 stream_id 关联的流的 cuda_stream_viewstream_id 的等效值返回指向同一底层流的 stream_view。 更多...
 
std::size_t get_pool_size () const noexcept
 获取流池中的流数量。 更多...
 

公有静态属性

static constexpr std::size_t default_size {16}
 默认流池大小。
 

详细描述

一个 CUDA 流池。

提供对 CUDA 流对象集合的有效访问。

连续调用可能会返回相同流的 cuda_stream_view。例如,一种可能的实现是维护一个 cuda_stream 对象的循环缓冲区。

构造函数和析构函数文档

◆ cuda_stream_pool()

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

构造一个给定非零大小的新 cuda 流池对象。

异常
logic_error如果 pool_size 为零
参数
pool_size流池中的流数量

成员函数文档

◆ get_pool_size()

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

获取流池中的流数量。

此函数相对于对同一函数的其他调用是线程安全的。

返回值
流池中的流数量

◆ get_stream() [1/2]

rmm::cuda_stream_view rmm::cuda_stream_pool::get_stream ( ) const
inlinenoexcept

获取流池中某个流的 cuda_stream_view

此函数相对于对同一函数的其他调用是线程安全的。

返回值
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

获取与 stream_id 关联的流的 cuda_stream_viewstream_id 的等效值返回指向同一底层流的 stream_view。

此函数相对于对同一函数的其他调用是线程安全的。

参数
stream_id所需流的唯一标识符
返回值
rmm::cuda_stream_view

此类的文档生成自以下文件