7#include <rmm/detail/export.hpp>
8#include <rmm/mr/detail/tracking_resource_adaptor_impl.hpp>
11#include <cuda/memory_resource>
35 :
public cuda::mr::shared_resource<detail::tracking_resource_adaptor_impl> {
36 using shared_base = cuda::mr::shared_resource<detail::tracking_resource_adaptor_impl>;
42 using read_lock_t = detail::tracking_resource_adaptor_impl::read_lock_t;
44 using write_lock_t = detail::tracking_resource_adaptor_impl::write_lock_t;
50 cuda::mr::device_accessible)
noexcept
61 bool capture_stacks =
false);
103 "tracking_resource_adaptor does not satisfy the cuda::mr::resource concept");
detail::tracking_resource_adaptor_impl::allocation_info allocation_info
Allocation info type (pointer, size, optional stack trace).
Definition tracking_resource_adaptor.hpp:40
void log_outstanding_allocations() const
Log any outstanding allocations via RMM_LOG_DEBUG.
std::map< void *, allocation_info > const & get_outstanding_allocations() const noexcept
Get the outstanding allocations map.
std::size_t get_allocated_bytes() const noexcept
Query the number of bytes currently allocated.
std::string get_outstanding_allocations_str() const
Gets a string describing all outstanding allocations (pointer, size, optional stack).
device_async_resource_ref get_upstream_resource() const noexcept
rmm::device_async_resource_ref to the upstream resource
detail::tracking_resource_adaptor_impl::read_lock_t read_lock_t
Shared-reader lock type used to protect the allocations map.
Definition tracking_resource_adaptor.hpp:42
friend void get_property(tracking_resource_adaptor const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition tracking_resource_adaptor.hpp:49
detail::tracking_resource_adaptor_impl::write_lock_t write_lock_t
Exclusive-writer lock type used to protect the allocations map.
Definition tracking_resource_adaptor.hpp:44
tracking_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, bool capture_stacks=false)
Construct a tracking resource adaptor using upstream to satisfy allocation requests.
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
Alias for a cuda::mr::resource_ref with the property cuda::mr::device_accessible.
Definition resource_ref.hpp:30
Memory Resource classes and adaptors.