pcl::gpu::DeviceMemory Class Reference

DeviceMemory class More...

`#include </build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/containers/include/pcl/gpu/containers/device_memory.h>`

Inheritance diagram for pcl::gpu::DeviceMemory:

## Public Member Functions

| DeviceMemory ()
| Empty constructor. More...
| ~DeviceMemory ()
| Destructor. More...
| DeviceMemory (size_t sizeBytes_arg)
| Allocates internal buffer in GPU memory. More...
| DeviceMemory (void *ptr_arg, size_t sizeBytes_arg)
| Initializes with user allocated buffer. More...
| DeviceMemory (const DeviceMemory &other_arg)
| Copy constructor. More...
DeviceMemory & | operator= (const DeviceMemory &other_arg)
| Assigment operator. More...
void | create (size_t sizeBytes_arg)
| Allocates internal buffer in GPU memory. More...
void | release ()
| Decrements reference counter and releases internal buffer if needed. More...
void | copyTo (DeviceMemory &other) const
| Performs data copying. More...
void | upload (const void *host_ptr_arg, size_t sizeBytes_arg)
| Uploads data to internal buffer in GPU memory. More...
void | download (void *host_ptr_arg) const
| Downloads data from internal buffer to CPU memory. More...
void | swap (DeviceMemory &other_arg)
| Performs swap of data pointed with another device memory. More...
template<class T >
T * | ptr ()
| Returns pointer for internal buffer in GPU memory. More...
template<class T >
const T * | ptr () const
| Returns constant pointer for internal buffer in GPU memory. More...
template<class U >
| operator PtrSz< U > () const
| Conversion to PtrSz for passing to kernel functions. More...
bool | empty () const
| Returns true if unallocated otherwise false. More...
size_t | sizeBytes () const

## Detailed Description

DeviceMemory class

Note
  This is a BLOB container class with reference counting for GPU memory.

Author
  Anatoly Baksheev

Definition at line 55 of file device_memory.h.

## Constructor & Destructor Documentation

## DeviceMemory() [1/4]

pcl::gpu::DeviceMemory::DeviceMemory | ( |  | ) |

Empty constructor.

## ~DeviceMemory()

pcl::gpu::DeviceMemory::~DeviceMemory | ( |  | ) |

Destructor.

## DeviceMemory() [2/4]

pcl::gpu::DeviceMemory::DeviceMemory | ( | size_t | sizeBytes_arg | ) |

Allocates internal buffer in GPU memory.

Parameters

  sizeBytes_arg | amount of memory to allocate

## DeviceMemory() [3/4]

pcl::gpu::DeviceMemory::DeviceMemory | ( | void * | ptr_arg,
|  | size_t | sizeBytes_arg
| ) |  |

Initializes with user allocated buffer.

Reference counting is disabled in this case.

Parameters

  ptr_arg | pointer to buffer
  sizeBytes_arg | buffer size

## DeviceMemory() [4/4]

pcl::gpu::DeviceMemory::DeviceMemory | ( | const DeviceMemory & | other_arg | ) |

Copy constructor.

Just increments reference counter.

## Member Function Documentation

## copyTo()

void pcl::gpu::DeviceMemory::copyTo | ( | DeviceMemory & | other | ) | const

Performs data copying.

If destination size differs it will be reallocated.

Parameters

  other | destination container

## create()

void pcl::gpu::DeviceMemory::create | ( | size_t | sizeBytes_arg | ) |

Allocates internal buffer in GPU memory.

If internal buffer was created before the function recreates it with new size. If new and old sizes are equal it does nothing.

Parameters

  sizeBytes_arg | buffer size

## download()

void pcl::gpu::DeviceMemory::download | ( | void * | host_ptr_arg | ) | const

Downloads data from internal buffer to CPU memory.

Parameters

  host_ptr_arg | pointer to buffer to download

## empty()

bool pcl::gpu::DeviceMemory::empty | ( |  | ) | const

Returns true if unallocated otherwise false.

Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh().

## operator PtrSz< U >()

template<class U >

pcl::gpu::DeviceMemory::operator PtrSz< U > | ( |  | ) | const

Conversion to PtrSz for passing to kernel functions.

## operator=()

DeviceMemory& pcl::gpu::DeviceMemory::operator= | ( | const DeviceMemory & | other_arg | ) |

Assigment operator.

Just increments reference counter.

## ptr() [1/2]

template<class T >

T * pcl::gpu::DeviceMemory::ptr | ( |  | ) |

inline

Returns pointer for internal buffer in GPU memory.

Definition at line 42 of file device_memory.hpp.

## ptr() [2/2]

template<class T >

const T * pcl::gpu::DeviceMemory::ptr | ( |  | ) | const

inline

Returns constant pointer for internal buffer in GPU memory.

Definition at line 43 of file device_memory.hpp.

References pcl::gpu::DevPtr< T >::data, and pcl::gpu::PtrSz< T >::size.

## release()

void pcl::gpu::DeviceMemory::release | ( |  | ) |

Decrements reference counter and releases internal buffer if needed.

## sizeBytes()

size_t pcl::gpu::DeviceMemory::sizeBytes | ( |  | ) | const

Referenced by pcl::gpu::AsyncCopy< T >::download(), and pcl::gpu::TextureBinder::TextureBinder().

## swap()

void pcl::gpu::DeviceMemory::swap | ( | DeviceMemory & | other_arg | ) |

Performs swap of data pointed with another device memory.

Parameters

  other_arg | device memory to swap with

## upload()

void pcl::gpu::DeviceMemory::upload | ( | const void * | host_ptr_arg,
|  | size_t | sizeBytes_arg
| ) |  |

Uploads data to internal buffer in GPU memory.

It calls create() inside to ensure that intenal buffer size is enough.

Parameters

  host_ptr_arg | pointer to buffer to upload
  sizeBytes_arg | buffer size

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

- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/containers/include/pcl/gpu/containers/device_memory.h
- /build/pcl-qv3n_B/pcl-1.8.1+dfsg1/gpu/containers/include/pcl/gpu/containers/impl/device_memory.hpp