DeviceMemory class
More...
#include </build/reproducible-path/pcl-1.15.1+dfsg/gpu/containers/include/pcl/gpu/containers/device_memory.h>
|
| | DeviceMemory () |
| | Empty constructor.
|
| | DeviceMemory (std::size_t sizeBytes_arg) |
| | Allocates internal buffer in GPU memory.
|
| | DeviceMemory (void *ptr_arg, std::size_t sizeBytes_arg) |
| | Initializes with user allocated buffer.
|
| | DeviceMemory (const DeviceMemory &other_arg) |
| | Copy constructor.
|
| | ~DeviceMemory () |
| | Destructor.
|
| DeviceMemory & | operator= (const DeviceMemory &other_arg) |
| | Assignment operator.
|
| void | create (std::size_t sizeBytes_arg) |
| | Allocates internal buffer in GPU memory.
|
| void | release () |
| | Decrements reference counter and releases internal buffer if needed.
|
| void | copyTo (DeviceMemory &other) const |
| | Performs data copying.
|
| void | upload (const void *host_ptr_arg, std::size_t sizeBytes_arg) |
| | Uploads data to internal buffer in GPU memory.
|
| bool | upload (const void *host_ptr_arg, std::size_t device_begin_byte_offset, std::size_t num_bytes) |
| | Uploads data from CPU memory to device array.
|
| void | download (void *host_ptr_arg) const |
| | Downloads data from internal buffer to CPU memory.
|
| bool | download (void *host_ptr_arg, std::size_t device_begin_byte_offset, std::size_t num_bytes) const |
| | Downloads data from internal buffer to CPU memory.
|
| void | swap (DeviceMemory &other_arg) |
| | Performs swap of data pointed with another device memory.
|
| template<class T> |
| T * | ptr () |
| | Returns pointer for internal buffer in GPU memory.
|
| template<class T> |
| const T * | ptr () const |
| | Returns constant pointer for internal buffer in GPU memory.
|
| template<class U> |
| | operator PtrSz< U > () const |
| | Conversion to PtrSz for passing to kernel functions.
|
| bool | empty () const |
| | Returns true if unallocated otherwise false.
|
| std::size_t | sizeBytes () const |
DeviceMemory class
- Note
- This is a BLOB container class with reference counting for GPU memory.
- Author
- Anatoly Baksheev
Definition at line 54 of file device_memory.h.
◆ DeviceMemory() [1/4]
| pcl::gpu::DeviceMemory::DeviceMemory |
( |
| ) |
|
◆ DeviceMemory() [2/4]
| pcl::gpu::DeviceMemory::DeviceMemory |
( |
std::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, |
|
|
std::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.
◆ ~DeviceMemory()
| pcl::gpu::DeviceMemory::~DeviceMemory |
( |
| ) |
|
◆ 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 |
( |
std::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
-
◆ download() [1/2]
| 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 |
◆ download() [2/2]
| bool pcl::gpu::DeviceMemory::download |
( |
void * | host_ptr_arg, |
|
|
std::size_t | device_begin_byte_offset, |
|
|
std::size_t | num_bytes ) const |
Downloads data from internal buffer to CPU memory.
- Returns
- true if download successful
- Parameters
-
| host_ptr_arg | pointer to buffer to download |
| device_begin_byte_offset | first byte position to download |
| num_bytes | number of bytes to download |
◆ empty()
| bool pcl::gpu::DeviceMemory::empty |
( |
| ) |
const |
Returns true if unallocated otherwise false.
◆ operator PtrSz< U >()
template<class U>
| pcl::gpu::DeviceMemory::operator PtrSz< U > |
( |
| ) |
const |
|
inline |
◆ operator=()
Assignment operator.
Just increments reference counter.
◆ ptr() [1/2]
Returns pointer for internal buffer in GPU memory.
Definition at line 47 of file device_memory.hpp.
◆ ptr() [2/2]
Returns constant pointer for internal buffer in GPU memory.
Definition at line 54 of file device_memory.hpp.
◆ release()
| void pcl::gpu::DeviceMemory::release |
( |
| ) |
|
Decrements reference counter and releases internal buffer if needed.
◆ sizeBytes()
| std::size_t pcl::gpu::DeviceMemory::sizeBytes |
( |
| ) |
const |
◆ 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() [1/2]
| bool pcl::gpu::DeviceMemory::upload |
( |
const void * | host_ptr_arg, |
|
|
std::size_t | device_begin_byte_offset, |
|
|
std::size_t | num_bytes ) |
Uploads data from CPU memory to device array.
- Note
- This overload never allocates memory in contrast to the other upload function.
- Returns
- true if upload successful
- Parameters
-
| host_ptr_arg | pointer to buffer to upload |
| device_begin_byte_offset | first byte position to upload to |
| num_bytes | number of bytes to upload |
◆ upload() [2/2]
| void pcl::gpu::DeviceMemory::upload |
( |
const void * | host_ptr_arg, |
|
|
std::size_t | sizeBytes_arg ) |
Uploads data to internal buffer in GPU memory.
It calls create() inside to ensure that internal 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/reproducible-path/pcl-1.15.1+dfsg/gpu/containers/include/pcl/gpu/containers/device_memory.h
- /build/reproducible-path/pcl-1.15.1+dfsg/gpu/containers/include/pcl/gpu/containers/impl/device_memory.hpp