Open3D (C++ API)
0.17.0+b7f9f3a
|
#include <MemoryManager.h>
Public Member Functions | |
MemoryManagerCached (const std::shared_ptr< MemoryManagerDevice > &device_mm) | |
void * | Malloc (size_t byte_size, const Device &device) override |
void | Free (void *ptr, const Device &device) override |
Frees previously allocated memory at address ptr on device device . More... | |
void | Memcpy (void *dst_ptr, const Device &dst_device, const void *src_ptr, const Device &src_device, size_t num_bytes) override |
![]() | |
virtual | ~MemoryManagerDevice ()=default |
Static Public Member Functions | |
static void | ReleaseCache (const Device &device) |
Frees all releasable memory blocks on device device . More... | |
static void | ReleaseCache () |
Protected Attributes | |
std::shared_ptr< MemoryManagerDevice > | device_mm_ |
Generic cached memory manager. This class can be used to speed-up memory allocations and deallocations from arbitrary direct memory managers.
ReleaseCache
or automatically if a direct allocation fails after observing a cache miss.
|
explicit |
Constructs a cached memory manager instance that wraps the existing direct memory manager device_mm
.
|
overridevirtual |
Frees previously allocated memory at address ptr
on device device
.
Implements open3d::core::MemoryManagerDevice.
|
overridevirtual |
Allocates memory of byte_size
bytes on device device
and returns a pointer to the beginning of the allocated memory block.
Implements open3d::core::MemoryManagerDevice.
|
overridevirtual |
Copies num_bytes
bytes of memory at address src_ptr
on device src_device
to address dst_ptr
on device dst_device
.
Implements open3d::core::MemoryManagerDevice.
|
static |
Frees all releasable memory blocks on all known devices. Note that this may also affect other instances of MemoryManagerCached.
|
static |
Frees all releasable memory blocks on device device
.
|
protected |