公共成员函数 | 所有成员列表
rmm::mr::cuda_async_view_memory_resource 类参考final

一个 `device_memory_resource` 派生类,使用 `cudaMallocAsync`/`cudaFreeAsync` 进行分配/释放。 更多...

#include <cuda_async_view_memory_resource.hpp>

rmm::mr::cuda_async_view_memory_resource 的继承图
Inheritance graph
[图例]
rmm::mr::cuda_async_view_memory_resource 的协作图
Collaboration graph
[图例]

公共成员函数

 cuda_async_view_memory_resource (cudaMemPool_t pool_handle)
 构造一个 cuda_async_view_memory_resource,它使用一个现有的 CUDA 内存池。提供的内存池不归 cuda_async_view_memory_resource 所有,必须在内存资源生命周期内保持有效。 更多...
 
cudaMemPool_t pool_handle () const noexcept
 返回到底层 CUDA 内存池的原生句柄。 更多...
 
 cuda_async_view_memory_resource (cuda_async_view_memory_resource const &)=default
 默认复制构造函数。
 
 cuda_async_view_memory_resource (cuda_async_view_memory_resource &&) noexcept=default
 默认移动构造函数。
 
cuda_async_view_memory_resourceoperator= (cuda_async_view_memory_resource const &)=default
 默认复制赋值运算符。 更多...
 
cuda_async_view_memory_resourceoperator= (cuda_async_view_memory_resource &&) noexcept=default
 默认移动赋值运算符。 更多...
 
- 继承自 rmm::mr::device_memory_resource 的公共成员函数
 device_memory_resource (device_memory_resource const &)=default
 默认复制构造函数。
 
 device_memory_resource (device_memory_resource &&) noexcept=default
 默认移动构造函数。
 
device_memory_resourceoperator= (device_memory_resource const &)=default
 默认复制赋值运算符。 更多...
 
device_memory_resourceoperator= (device_memory_resource &&) noexcept=default
 默认移动赋值运算符。 更多...
 
void * allocate (std::size_t bytes, cuda_stream_view stream=cuda_stream_view{})
 分配至少 `bytes` 大小的内存。 更多...
 
void deallocate (void *ptr, std::size_t bytes, cuda_stream_view stream=cuda_stream_view{})
 释放 `p` 指向的内存。 更多...
 
bool is_equal (device_memory_resource const &other) const noexcept
 将此资源与另一个资源进行比较。 更多...
 
void * allocate (std::size_t bytes, std::size_t alignment)
 分配至少 `bytes` 大小的内存。 更多...
 
void deallocate (void *ptr, std::size_t bytes, std::size_t alignment)
 释放 `p` 指向的内存。 更多...
 
void * allocate_async (std::size_t bytes, std::size_t alignment, cuda_stream_view stream)
 分配至少 `bytes` 大小的内存。 更多...
 
void * allocate_async (std::size_t bytes, cuda_stream_view stream)
 分配至少 `bytes` 大小的内存。 更多...
 
void deallocate_async (void *ptr, std::size_t bytes, std::size_t alignment, cuda_stream_view stream)
 释放 `p` 指向的内存。 更多...
 
void deallocate_async (void *ptr, std::size_t bytes, cuda_stream_view stream)
 释放 `p` 指向的内存。 更多...
 
bool operator== (device_memory_resource const &other) const noexcept
 与另一个 device_memory_resource 的比较运算符。 更多...
 
bool operator!= (device_memory_resource const &other) const noexcept
 与另一个 device_memory_resource 的比较运算符。 更多...
 

详细描述

一个 `device_memory_resource` 派生类,使用 `cudaMallocAsync`/`cudaFreeAsync` 进行分配/释放。

构造函数与析构函数文档

◆ cuda_async_view_memory_resource()

rmm::mr::cuda_async_view_memory_resource::cuda_async_view_memory_resource ( cudaMemPool_t  pool_handle)
inline

构造一个 cuda_async_view_memory_resource,它使用一个现有的 CUDA 内存池。提供的内存池不归 cuda_async_view_memory_resource 所有,必须在内存资源生命周期内保持有效。

异常
rmm::logic_error如果 CUDA 版本不支持 `cudaMallocAsync`
参数
pool_handle指向 CUDA 内存池的句柄,该内存池将用于处理分配请求。

成员函数文档

◆ operator=() [1/2]

cuda_async_view_memory_resource& rmm::mr::cuda_async_view_memory_resource::operator= ( cuda_async_view_memory_resource &&  )
default

默认移动赋值运算符。

返回值
cuda_async_view_memory_resource& 对被赋值对象的引用

◆ operator=() [2/2]

cuda_async_view_memory_resource& rmm::mr::cuda_async_view_memory_resource::operator= ( cuda_async_view_memory_resource const &  )
default

默认复制赋值运算符。

返回值
cuda_async_view_memory_resource& 对被赋值对象的引用

◆ pool_handle()

cudaMemPool_t rmm::mr::cuda_async_view_memory_resource::pool_handle ( ) const
inlinenoexcept

返回到底层 CUDA 内存池的原生句柄。

返回值
cudaMemPool_t 指向底层 CUDA 内存池的句柄

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