Open3D (C++ API)  0.18.0+5c982c7
Public Member Functions | Static Public Member Functions | Protected Attributes
open3d::core::MemoryManagerCached Class Reference

#include <MemoryManager.h>

Inheritance diagram for open3d::core::MemoryManagerCached:

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
- Public Member Functions inherited from open3d::core::MemoryManagerDevice
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< MemoryManagerDevicedevice_mm_

Detailed Description

Generic cached memory manager. This class can be used to speed-up memory allocations and deallocations from arbitrary direct memory managers.

Constructor & Destructor Documentation

◆ MemoryManagerCached()

open3d::core::MemoryManagerCached::MemoryManagerCached ( const std::shared_ptr< MemoryManagerDevice > &  device_mm)

Constructs a cached memory manager instance that wraps the existing direct memory manager device_mm.

Member Function Documentation

◆ Free()

void open3d::core::MemoryManagerCached::Free ( void *  ptr,
const Device device 

Frees previously allocated memory at address ptr on device device.

Implements open3d::core::MemoryManagerDevice.

◆ Malloc()

void * open3d::core::MemoryManagerCached::Malloc ( size_t  byte_size,
const Device device 

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.

◆ Memcpy()

void open3d::core::MemoryManagerCached::Memcpy ( void *  dst_ptr,
const Device dst_device,
const void *  src_ptr,
const Device src_device,
size_t  num_bytes 

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.

◆ ReleaseCache() [1/2]

void open3d::core::MemoryManagerCached::ReleaseCache ( )

Frees all releasable memory blocks on all known devices. Note that this may also affect other instances of MemoryManagerCached.

◆ ReleaseCache() [2/2]

void open3d::core::MemoryManagerCached::ReleaseCache ( const Device device)

Frees all releasable memory blocks on device device.

Field Documentation

◆ device_mm_

std::shared_ptr<MemoryManagerDevice> open3d::core::MemoryManagerCached::device_mm_

The documentation for this class was generated from the following files: