14namespace gtsam_points {
21 using Ptr = std::shared_ptr<OffloadableGPU>;
22 using ConstPtr = std::shared_ptr<const OffloadableGPU>;
41 virtual bool touch(CUstream_st* stream = 0);
An interface class for offloading data from GPU to CPU.
Definition offloadable.hpp:19
std::uint64_t last_access
Last access time of this object.
Definition offloadable.hpp:53
virtual bool touch(CUstream_st *stream=0)
Reload data from CPU to GPU (if necessary) and update the last access time.
virtual bool loaded_on_gpu() const =0
Check if the data is loaded on the GPU.
virtual bool reload_gpu(CUstream_st *stream=0)=0
Reload data from CPU to GPU.
static std::uint64_t current_access_time()
Current global access time counter.
virtual size_t memory_usage_gpu() const
Memory usage in bytes on the GPU.
Definition offloadable.hpp:34
virtual bool offload_gpu(CUstream_st *stream=0)=0
Offload data from GPU to CPU.
std::uint64_t last_accessed_time() const
Time of the last access to this object.
static std::atomic_uint64_t access_counter
Global counter for the last access time.
Definition offloadable.hpp:52