33 #include <unordered_map> 39 class DeviceMemoryManager;
43 static void*
Malloc(
size_t byte_size,
const Device& device);
44 static void Free(
void* ptr,
const Device& device);
45 static void Memcpy(
void* dst_ptr,
68 virtual void*
Malloc(
size_t byte_size,
const Device& device) = 0;
69 virtual void Free(
void* ptr,
const Device& device) = 0;
70 virtual void Memcpy(
void* dst_ptr,
74 size_t num_bytes) = 0;
80 void*
Malloc(
size_t byte_size,
const Device& device)
override;
81 void Free(
void* ptr,
const Device& device)
override;
86 size_t num_bytes)
override;
89 #ifdef BUILD_CUDA_MODULE 93 void*
Malloc(
size_t byte_size,
const Device& device)
override;
94 void Free(
void* ptr,
const Device& device)
override;
99 size_t num_bytes)
override;
102 bool IsCUDAPointer(
const void* ptr);
static void MemcpyToHost(void *host_ptr, const void *src_ptr, const Device &src_device, size_t num_bytes)
Same as Memcpy, but with host (CPU:0) as default dst_device.
Definition: MemoryManager.cpp:87
static std::shared_ptr< DeviceMemoryManager > GetDeviceMemoryManager(const Device &device)
Definition: MemoryManager.cpp:95
Definition: MemoryManager.h:41
Definition: MemoryManager.h:66
static void MemcpyFromHost(void *dst_ptr, const Device &dst_device, const void *host_ptr, size_t num_bytes)
Same as Memcpy, but with host (CPU:0) as default src_device.
Definition: MemoryManager.cpp:79
Definition: MemoryManager.h:77
Definition: Open3DViewer.h:29
static void * Malloc(size_t byte_size, const Device &device)
Definition: MemoryManager.cpp:39
static void Free(void *ptr, const Device &device)
Definition: MemoryManager.cpp:43
static void Memcpy(void *dst_ptr, const Device &dst_device, const void *src_ptr, const Device &src_device, size_t num_bytes)
Definition: MemoryManager.cpp:47