Open3D (C++ API)  0.18.0+252c867
Public Member Functions | Protected Attributes
open3d::core::Blob Class Reference

#include <Blob.h>

Public Member Functions

 Blob (int64_t byte_size, const Device &device)
 
 Blob (const Device &device, void *data_ptr, const std::function< void(void *)> &deleter)
 
 ~Blob ()
 
Device GetDevice () const
 
void * GetDataPtr ()
 
const void * GetDataPtr () const
 

Protected Attributes

std::function< void(void *)> deleter_ = nullptr
 For externally managed memory, deleter != nullptr. More...
 
void * data_ptr_ = nullptr
 Device data pointer. More...
 
Device device_
 Device context for the blob. More...
 

Detailed Description

Blob class refers to a blob of memory in device or host.

Usually a Blob is constructed by specifying the blob size and device, memory allocation happens during the Blob's construction.

A Blob's buffer can also be managed by an external memory manager. In this case, a deleter function is needed to notify the external memory manager that the memory is no longer needed. It does not make sense to infer the total buffer size. For example, if a Tensor has a negative stride size, it is necessary to access memory addresses smaller than Blob's beginning memory address. The only responsibility for Blob is to hold the beginning memory address and it's up to the user to access any addresses around it.

In summary:

Constructor & Destructor Documentation

◆ Blob() [1/2]

open3d::core::Blob::Blob ( int64_t  byte_size,
const Device device 
)
inline

Construct Blob on a specified device.

Parameters
byte_sizeSize of the blob in bytes.
deviceDevice where the blob resides.

◆ Blob() [2/2]

open3d::core::Blob::Blob ( const Device device,
void *  data_ptr,
const std::function< void(void *)> &  deleter 
)
inline

Construct Blob with externally managed memory.

Parameters
deviceDevice where the blob resides.
data_ptrPointer the blob's beginning.
deleterThe deleter function is called at Blob's destruction to notify the external memory manager that the memory is no longer needed. It's up to the external manager to free the memory.

◆ ~Blob()

open3d::core::Blob::~Blob ( )
inline

Member Function Documentation

◆ GetDataPtr() [1/2]

void* open3d::core::Blob::GetDataPtr ( )
inline

◆ GetDataPtr() [2/2]

const void* open3d::core::Blob::GetDataPtr ( ) const
inline

◆ GetDevice()

Device open3d::core::Blob::GetDevice ( ) const
inline

Field Documentation

◆ data_ptr_

void* open3d::core::Blob::data_ptr_ = nullptr
protected

Device data pointer.

◆ deleter_

std::function<void(void*)> open3d::core::Blob::deleter_ = nullptr
protected

For externally managed memory, deleter != nullptr.

◆ device_

Device open3d::core::Blob::device_
protected

Device context for the blob.


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