Public Types | Public Member Functions | Friends | List of all members
rmm::mr::thread_safe_resource_adaptor Class Reference

Resource that adapts an upstream resource to be thread safe. More...

#include <thread_safe_resource_adaptor.hpp>

Inheritance diagram for rmm::mr::thread_safe_resource_adaptor:
Inheritance graph
[legend]
Collaboration diagram for rmm::mr::thread_safe_resource_adaptor:
Collaboration graph
[legend]

Public Types

using lock_t = std::lock_guard< std::mutex >
 Type of lock used to synchronize access.
 

Public Member Functions

 thread_safe_resource_adaptor (cuda::mr::any_resource< cuda::mr::device_accessible > upstream)
 Construct a new thread safe resource adaptor using upstream to satisfy allocation requests. More...
 
device_async_resource_ref get_upstream_resource () const noexcept
 rmm::device_async_resource_ref to the upstream resource More...
 

Friends

void get_property (thread_safe_resource_adaptor const &, cuda::mr::device_accessible) noexcept
 Enables the cuda::mr::device_accessible property.
 

Detailed Description

Resource that adapts an upstream resource to be thread safe.

An instance of this resource can be constructed with an existing, upstream resource in order to satisfy allocation requests. This adaptor wraps allocations and deallocations from the upstream in a mutex lock.

This class is copyable and shares ownership of its internal state via cuda::mr::shared_resource.

Constructor & Destructor Documentation

◆ thread_safe_resource_adaptor()

rmm::mr::thread_safe_resource_adaptor::thread_safe_resource_adaptor ( cuda::mr::any_resource< cuda::mr::device_accessible >  upstream)
explicit

Construct a new thread safe resource adaptor using upstream to satisfy allocation requests.

Parameters
upstreamThe resource used for allocating/deallocating device memory.

Member Function Documentation

◆ get_upstream_resource()

device_async_resource_ref rmm::mr::thread_safe_resource_adaptor::get_upstream_resource ( ) const
noexcept

rmm::device_async_resource_ref to the upstream resource

Returns
rmm::device_async_resource_ref to the upstream resource

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