Resource that adapts an upstream resource to be thread safe. More...
#include <thread_safe_resource_adaptor.hpp>


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. | |
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.
|
explicit |
Construct a new thread safe resource adaptor using upstream to satisfy allocation requests.
| upstream | The resource used for allocating/deallocating device memory. |
|
noexcept |
rmm::device_async_resource_ref to the upstream resource