RMM
23.12
RAPIDS Memory Manager
|
Classes | |
class | rmm::mr::aligned_resource_adaptor< Upstream > |
Resource that adapts Upstream memory resource to allocate memory in a specified alignment size. More... | |
class | rmm::mr::failure_callback_resource_adaptor< Upstream, ExceptionType > |
A device memory resource that calls a callback function when allocations throw a specified exception type. More... | |
class | rmm::mr::limiting_resource_adaptor< Upstream > |
Resource that uses Upstream to allocate memory and limits the total allocations possible. More... | |
class | rmm::mr::logging_resource_adaptor< Upstream > |
Resource that uses Upstream to allocate memory and logs information about the requested allocation/deallocations. More... | |
class | rmm::mr::owning_wrapper< Resource, Upstreams > |
Resource adaptor that maintains the lifetime of upstream resources. More... | |
class | rmm::mr::statistics_resource_adaptor< Upstream > |
Resource that uses Upstream to allocate memory and tracks statistics on memory allocations. More... | |
class | rmm::mr::thread_safe_resource_adaptor< Upstream > |
Resource that adapts Upstream memory resource adaptor to be thread safe. More... | |
class | rmm::mr::thrust_allocator< T > |
An allocator compatible with Thrust containers and algorithms using a device_memory_resource for memory (de)allocation. More... | |
class | rmm::mr::tracking_resource_adaptor< Upstream > |
Resource that uses Upstream to allocate memory and tracks allocations. More... | |
Typedefs | |
using | rmm::mr::failure_callback_t = std::function< bool(std::size_t, void *)> |
Callback function type used by failure_callback_resource_adaptor. More... | |
Functions | |
template<typename Upstream > | |
limiting_resource_adaptor< Upstream > | rmm::mr::make_limiting_adaptor (Upstream *upstream, std::size_t allocation_limit) |
Convenience factory to return a limiting_resource_adaptor around the upstream resource upstream . More... | |
template<typename Upstream > | |
logging_resource_adaptor< Upstream > | rmm::mr::make_logging_adaptor (Upstream *upstream, std::string const &filename=logging_resource_adaptor< Upstream >::get_default_filename(), bool auto_flush=false) |
Convenience factory to return a logging_resource_adaptor around the upstream resource upstream . More... | |
template<typename Upstream > | |
logging_resource_adaptor< Upstream > | rmm::mr::make_logging_adaptor (Upstream *upstream, std::ostream &stream, bool auto_flush=false) |
Convenience factory to return a logging_resource_adaptor around the upstream resource upstream . More... | |
template<template< typename... > class Resource, typename... Upstreams, typename... Args> | |
auto | rmm::mr::make_owning_wrapper (std::tuple< std::shared_ptr< Upstreams >... > upstreams, Args &&... args) |
Constructs a resource of type Resource wrapped in an owning_wrapper using upstreams as the upstream resources and args as the additional parameters for the constructor of Resource . More... | |
template<template< typename > class Resource, typename Upstream , typename... Args> | |
auto | rmm::mr::make_owning_wrapper (std::shared_ptr< Upstream > upstream, Args &&... args) |
Additional convenience factory for owning_wrapper when Resource has only a single upstream resource. More... | |
template<typename Upstream > | |
statistics_resource_adaptor< Upstream > | rmm::mr::make_statistics_adaptor (Upstream *upstream) |
Convenience factory to return a statistics_resource_adaptor around the upstream resource upstream . More... | |
template<typename Upstream > | |
tracking_resource_adaptor< Upstream > | rmm::mr::make_tracking_adaptor (Upstream *upstream) |
Convenience factory to return a tracking_resource_adaptor around the upstream resource upstream . More... | |
using rmm::mr::failure_callback_t = typedef std::function<bool(std::size_t, void*)> |
Callback function type used by failure_callback_resource_adaptor.
The resource adaptor calls this function when a memory allocation throws a specified exception type. The function decides whether the resource adaptor should try to allocate the memory again or re-throw the exception.
The callback function signature is: bool failure_callback_t(std::size_t bytes, void* callback_arg)
The callback function is passed two parameters: bytes
is the size of the failed memory allocation and arg
is the extra argument passed to the constructor of the failure_callback_resource_adaptor
. The callback function returns a Boolean where true means to retry the memory allocation and false means to re-throw the exception.
limiting_resource_adaptor<Upstream> rmm::mr::make_limiting_adaptor | ( | Upstream * | upstream, |
std::size_t | allocation_limit | ||
) |
Convenience factory to return a limiting_resource_adaptor
around the upstream resource upstream
.
Upstream | Type of the upstream device_memory_resource . |
upstream | Pointer to the upstream resource |
allocation_limit | Maximum amount of memory to allocate |
logging_resource_adaptor<Upstream> rmm::mr::make_logging_adaptor | ( | Upstream * | upstream, |
std::ostream & | stream, | ||
bool | auto_flush = false |
||
) |
Convenience factory to return a logging_resource_adaptor
around the upstream resource upstream
.
Upstream | Type of the upstream device_memory_resource . |
upstream | Pointer to the upstream resource |
stream | The ostream to write log info. |
auto_flush | If true, flushes the log for every (de)allocation. Warning, this will degrade performance. |
logging_resource_adaptor<Upstream> rmm::mr::make_logging_adaptor | ( | Upstream * | upstream, |
std::string const & | filename = logging_resource_adaptor<Upstream>::get_default_filename() , |
||
bool | auto_flush = false |
||
) |
Convenience factory to return a logging_resource_adaptor
around the upstream resource upstream
.
Upstream | Type of the upstream device_memory_resource . |
upstream | Pointer to the upstream resource |
filename | Name of the file to write log info. If not specified, retrieves the log file name from the environment variable "RMM_LOG_FILE". |
auto_flush | If true, flushes the log for every (de)allocation. Warning, this will degrade performance. |
auto rmm::mr::make_owning_wrapper | ( | std::shared_ptr< Upstream > | upstream, |
Args &&... | args | ||
) |
Additional convenience factory for owning_wrapper
when Resource
has only a single upstream resource.
When a resource has only a single upstream, it can be inconvenient to construct a std::tuple
of the upstream resource. This factory allows specifying the single upstream as just a std::shared_ptr
.
Resource | Type of the wrapped resource to construct |
Upstream | Type of the single upstream resource |
Args | Types of the arguments used in Resource s constructor |
upstream | std::shared_ptr to the upstream resource |
args | Function parameter pack of arguments to forward to the wrapped resource's constructor |
owning_wrapper
wrapping a newly construct Resource<Upstream>
and upstream
. auto rmm::mr::make_owning_wrapper | ( | std::tuple< std::shared_ptr< Upstreams >... > | upstreams, |
Args &&... | args | ||
) |
Constructs a resource of type Resource
wrapped in an owning_wrapper
using upstreams
as the upstream resources and args
as the additional parameters for the constructor of Resource
.
Resource | Template template parameter specifying the type of the wrapped resource to construct |
Upstreams | Types of the upstream resources |
Args | Types of the arguments used in Resource s constructor |
upstreams | Tuple of std::shared_ptr s to the upstreams used by the wrapped resource, in the same order as expected by Resource s constructor. |
args | Function parameter pack of arguments to forward to the wrapped resource's constructor |
owning_wrapper
wrapping a newly constructed Resource<Upstreams...>
and upstreams
. statistics_resource_adaptor<Upstream> rmm::mr::make_statistics_adaptor | ( | Upstream * | upstream | ) |
Convenience factory to return a statistics_resource_adaptor
around the upstream resource upstream
.
Upstream | Type of the upstream device_memory_resource . |
upstream | Pointer to the upstream resource |
tracking_resource_adaptor<Upstream> rmm::mr::make_tracking_adaptor | ( | Upstream * | upstream | ) |
Convenience factory to return a tracking_resource_adaptor
around the upstream resource upstream
.
Upstream | Type of the upstream device_memory_resource . |
upstream | Pointer to the upstream resource |