7 #include <rmm/detail/export.hpp>
8 #include <rmm/mr/detail/statistics_resource_adaptor_impl.hpp>
11 #include <cuda/memory_resource>
16 namespace RMM_NAMESPACE {
33 :
public cuda::mr::shared_resource<detail::statistics_resource_adaptor_impl> {
34 using shared_base = cuda::mr::shared_resource<detail::statistics_resource_adaptor_impl>;
38 using counter = detail::statistics_resource_adaptor_impl::counter;
40 using read_lock_t = detail::statistics_resource_adaptor_impl::read_lock_t;
42 using write_lock_t = detail::statistics_resource_adaptor_impl::write_lock_t;
48 cuda::mr::device_accessible) noexcept
58 cuda::mr::any_resource<cuda::mr::device_accessible> upstream);
72 [[nodiscard]]
counter get_bytes_counter() const noexcept;
79 [[nodiscard]]
counter get_allocations_counter() const noexcept;
Resource that uses an upstream resource to allocate memory and tracks allocation statistics (current,...
Definition: statistics_resource_adaptor.hpp:33
detail::statistics_resource_adaptor_impl::read_lock_t read_lock_t
Shared-reader lock type used to protect the counter stack.
Definition: statistics_resource_adaptor.hpp:40
detail::statistics_resource_adaptor_impl::write_lock_t write_lock_t
Exclusive-writer lock type used to protect the counter stack.
Definition: statistics_resource_adaptor.hpp:42
statistics_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream)
Construct a statistics resource adaptor using upstream to satisfy allocation requests.
detail::statistics_resource_adaptor_impl::counter counter
Counter type tracking current, peak, and total bytes or allocations.
Definition: statistics_resource_adaptor.hpp:38
friend void get_property(statistics_resource_adaptor const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition: statistics_resource_adaptor.hpp:47
device_async_resource_ref get_upstream_resource() const noexcept
rmm::device_async_resource_ref to the upstream resource
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