公有成员函数 | 静态公有成员函数 | 所有成员列表
rmm::mr::logging_resource_adaptor< Upstream > 类模板参考final

使用 Upstream 分配内存并记录请求的分配/解除分配信息的资源。 更多...

#include <logging_resource_adaptor.hpp>

rmm::mr::logging_resource_adaptor< Upstream > 的继承图
Inheritance graph
[图例]
rmm::mr::logging_resource_adaptor< Upstream > 的协作图
Collaboration graph
[图例]

公有成员函数

 logging_resource_adaptor (Upstream *upstream, std::string const &filename=get_default_filename(), bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 filename 指定的文件。 更多...
 
 logging_resource_adaptor (Upstream *upstream, std::ostream &stream, bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。 更多...
 
 logging_resource_adaptor (Upstream *upstream, std::initializer_list< rapids_logger::sink_ptr > sinks, bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。 更多...
 
 logging_resource_adaptor (device_async_resource_ref upstream, std::string const &filename=get_default_filename(), bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 filename 指定的文件。 更多...
 
 logging_resource_adaptor (device_async_resource_ref upstream, std::ostream &stream, bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。 更多...
 
 logging_resource_adaptor (device_async_resource_ref upstream, std::initializer_list< rapids_logger::sink_ptr > sinks, bool auto_flush=false)
 构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。 更多...
 
 logging_resource_adaptor (logging_resource_adaptor const &)=delete
 
logging_resource_adaptoroperator= (logging_resource_adaptor const &)=delete
 
 logging_resource_adaptor (logging_resource_adaptor &&) noexcept=default
 默认移动构造函数。
 
logging_resource_adaptoroperator= (logging_resource_adaptor &&) noexcept=default
 默认移动赋值运算符。 更多...
 
rmm::device_async_resource_ref get_upstream_resource () const noexcept
 到上游资源的 rmm::device_async_resource_ref。 更多...
 
void flush ()
 刷新日志记录器内容。
 
std::string header () const
 返回 CSV 头字符串。 更多...
 
- 继承自 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 *p, 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 *p, 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 *p, std::size_t bytes, std::size_t alignment, cuda_stream_view stream)
 解除分配 p 指向的内存。 更多...
 
void deallocate_async (void *p, 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 的比较运算符。 更多...
 

静态公有成员函数

static std::string get_default_filename ()
 返回环境变量 RMM_LOG_FILE 的值。 更多...
 

详细描述

template<typename Upstream>
class rmm::mr::logging_resource_adaptor< Upstream >

使用 Upstream 分配内存并记录请求的分配/解除分配信息的资源。

可以使用现有的上游资源构建此资源的实例,以满足分配请求并记录分配/解除分配活动。

模板参数
Upstream用于分配/解除分配的上游资源的类型。

构造函数与析构函数文档

◆ logging_resource_adaptor() [1/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( Upstream *  upstream,
std::string const &  filename = get_default_filename(),
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 filename 指定的文件。

日志文件将使用 CSV 格式写入。

如果 filename 已存在,则清除其内容。

创建多个使用相同 filenamelogging_resource_adaptor 将导致未定义行为。

异常
rmm::logic_error如果 upstream == nullptr
spdlog::spdlog_ex如果打开 filename 失败
参数
upstream用于分配/解除分配设备内存的资源
filename要写入日志信息的文件名。如果未指定,则从环境变量 "RMM_LOG_FILE" 中获取文件名。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

◆ logging_resource_adaptor() [2/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( Upstream *  upstream,
std::ostream &  stream,
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。

日志文件将使用 CSV 格式写入。

异常
rmm::logic_error如果 upstream == nullptr
参数
upstream用于分配/解除分配设备内存的资源
stream用于写入日志信息的输出流。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

◆ logging_resource_adaptor() [3/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( Upstream *  upstream,
std::initializer_list< rapids_logger::sink_ptr >  sinks,
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。

日志文件将使用 CSV 格式写入。

异常
rmm::logic_error如果 upstream == nullptr
参数
upstream用于分配/解除分配设备内存的资源
sinks将写入日志输出的日志记录接收器列表。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

◆ logging_resource_adaptor() [4/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( device_async_resource_ref  upstream,
std::string const &  filename = get_default_filename(),
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 filename 指定的文件。

日志文件将使用 CSV 格式写入。

如果 filename 已存在,则清除其内容。

创建多个使用相同 filenamelogging_resource_adaptor 将导致未定义行为。

异常
spdlog::spdlog_ex如果打开 filename 失败
参数
upstream用于分配/解除分配设备内存的 resource_ref。
filename要写入日志信息的文件名。如果未指定,则从环境变量 "RMM_LOG_FILE" 中获取文件名。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

◆ logging_resource_adaptor() [5/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( device_async_resource_ref  upstream,
std::ostream &  stream,
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。

日志文件将使用 CSV 格式写入。

参数
upstream用于分配/解除分配设备内存的 resource_ref。
stream用于写入日志信息的输出流。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

◆ logging_resource_adaptor() [6/6]

template<typename Upstream >
rmm::mr::logging_resource_adaptor< Upstream >::logging_resource_adaptor ( device_async_resource_ref  upstream,
std::initializer_list< rapids_logger::sink_ptr >  sinks,
bool  auto_flush = false 
)
inline

构建一个新的日志记录资源适配器,它使用 upstream 来满足分配请求,并将每次分配/解除分配的信息记录到 stream 指定的输出流。

日志文件将使用 CSV 格式写入。

参数
upstream用于分配/解除分配设备内存的 resource_ref。
sinks将写入日志输出的日志记录接收器列表。
auto_flush如果为 true,则对每次分配/解除分配都刷新日志。警告:这会降低性能。

成员函数文档

◆ get_default_filename()

template<typename Upstream >
static std::string rmm::mr::logging_resource_adaptor< Upstream >::get_default_filename ( )
inlinestatic

返回环境变量 RMM_LOG_FILE 的值。

异常
rmm::logic_error如果未设置 RMM_LOG_FILE
返回值
作为 std::string 的 RMM_LOG_FILE 值。

◆ get_upstream_resource()

template<typename Upstream >
rmm::device_async_resource_ref rmm::mr::logging_resource_adaptor< Upstream >::get_upstream_resource ( ) const
inlinenoexcept

到上游资源的 rmm::device_async_resource_ref

返回值
到上游资源的 rmm::device_async_resource_ref

◆ header()

template<typename Upstream >
std::string rmm::mr::logging_resource_adaptor< Upstream >::header ( ) const
inline

返回 CSV 头字符串。

返回值
列名的 CSV 格式头字符串

◆ operator=()

template<typename Upstream >
logging_resource_adaptor& rmm::mr::logging_resource_adaptor< Upstream >::operator= ( logging_resource_adaptor< Upstream > &&  )
defaultnoexcept

默认移动赋值运算符。

返回值
logging_resource_adaptor& 对被赋值对象的引用,类型为 logging_resource_adaptor&

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