45 const char*
what()
const noexcept final;
57 size_t maxBytes = std::numeric_limits<size_t>::max());
68 [[nodiscard]]
size_t getAllocationCount() const noexcept {
return mAllocations.load(std::memory_order_relaxed); }
69 [[nodiscard]]
size_t getAllocatedBytes() const noexcept {
return mAllocatedBytes.load(std::memory_order_relaxed); }
72#if !defined(__HIPCC__) && !defined(__CUDACC__)
78 void* do_allocate(
size_t bytes,
size_t alignment)
final;
79 void do_deallocate(
void* p,
size_t bytes,
size_t alignment)
final;
82 std::atomic<size_t> mMaxMemory{std::numeric_limits<size_t>::max()};
83 std::atomic<size_t> mCountThrow{0};
84 std::atomic<size_t> mUsedMemory{0};
85 std::atomic<size_t> mAllocations{0};
86 std::atomic<size_t> mAllocatedBytes{0};
87 std::atomic<size_t> mPeakUsedMemory{0};
88 std::atomic<size_t> mPeakBaselineMemory{0};
89 std::unique_ptr<std::pmr::memory_resource> mOwnedUpstream;
92#ifdef BOUNDED_MR_STATS
94 std::atomic<size_t> peak{0};
95 std::atomic<size_t> live{0};
96 std::atomic<size_t> nAlloc{0};
97 std::atomic<size_t> nFree{0};
98 std::atomic<size_t> totalAlloc{0};
99 std::atomic<size_t> totalFreed{0};
100 std::atomic<size_t> maxAlign{0};
101 std::atomic<size_t> upstreamFailures{0};