pulsatrix 1.1.0
Loading...
Searching...
No Matches
caching_allocator.hpp File Reference

A caching device-memory allocator (roadmap HIP-3): freed blocks are kept and reused for later requests of the same size class instead of going back to the driver. More...

#include <cstddef>
#include <functional>
#include <mutex>
#include <unordered_map>
#include <vector>
Include dependency graph for caching_allocator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pulsatrix::CachingAllocator
 
struct  pulsatrix::CachingAllocator::Stats
 

Namespaces

namespace  pulsatrix
 

Detailed Description

A caching device-memory allocator (roadmap HIP-3): freed blocks are kept and reused for later requests of the same size class instead of going back to the driver.

Note
Device-independent: it is given the raw allocate, free and synchronize operations, so HIPBackend can use it and its logic is tested in CPU-only builds.
Safe on a single in-order stream: a block freed by the host was last used by work already queued on that stream, and its next user's work is queued after it. Memory is only returned to the driver after synchronizing.