Point Cloud Library (PCL)
1.14.1-dev
|
DeviceArray class More...
#include </__w/1/s/gpu/containers/include/pcl/gpu/containers/device_array.h>
Public Types | |
enum | { elem_size = sizeof(T) } |
Element size. More... | |
using | type = T |
Element type. More... | |
Public Member Functions | |
DeviceArray () | |
Empty constructor. More... | |
DeviceArray (std::size_t size) | |
Allocates internal buffer in GPU memory. More... | |
DeviceArray (T *ptr, std::size_t size) | |
Initializes with user allocated buffer. More... | |
DeviceArray (const DeviceArray &other) | |
Copy constructor. More... | |
DeviceArray & | operator= (const DeviceArray &other) |
Assignment operator. More... | |
void | create (std::size_t size) |
Allocates internal buffer in GPU memory. More... | |
void | release () |
Decrements reference counter and releases internal buffer if needed. More... | |
void | copyTo (DeviceArray &other) const |
Performs data copying. More... | |
void | upload (const T *host_ptr, std::size_t size) |
Uploads data to internal buffer in GPU memory. More... | |
bool | upload (const T *host_ptr, std::size_t device_begin_offset, std::size_t num_elements) |
Uploads data from CPU memory to internal buffer. More... | |
void | download (T *host_ptr) const |
Downloads data from internal buffer to CPU memory. More... | |
bool | download (T *host_ptr, std::size_t device_begin_offset, std::size_t num_elements) const |
Downloads data from internal buffer to CPU memory. More... | |
template<class A > | |
void | upload (const std::vector< T, A > &data) |
Uploads data to internal buffer in GPU memory. More... | |
template<typename A > | |
void | download (std::vector< T, A > &data) const |
Downloads data from internal buffer to CPU memory. More... | |
void | swap (DeviceArray &other_arg) |
Performs swap of data pointed with another device array. More... | |
T * | ptr () |
Returns pointer for internal buffer in GPU memory. More... | |
const T * | ptr () const |
Returns const pointer for internal buffer in GPU memory. More... | |
operator T* () | |
Returns pointer for internal buffer in GPU memory. More... | |
operator const T * () const | |
Returns const pointer for internal buffer in GPU memory. More... | |
std::size_t | size () const |
Returns size in elements. More... | |
Public Member Functions inherited from pcl::gpu::DeviceMemory | |
DeviceMemory () | |
Empty constructor. More... | |
~DeviceMemory () | |
Destructor. More... | |
DeviceMemory (std::size_t sizeBytes_arg) | |
Allocates internal buffer in GPU memory. More... | |
DeviceMemory (void *ptr_arg, std::size_t sizeBytes_arg) | |
Initializes with user allocated buffer. More... | |
DeviceMemory (const DeviceMemory &other_arg) | |
Copy constructor. More... | |
DeviceMemory & | operator= (const DeviceMemory &other_arg) |
Assignment operator. More... | |
void | create (std::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, std::size_t sizeBytes_arg) |
Uploads data to internal buffer in GPU memory. More... | |
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. More... | |
void | download (void *host_ptr_arg) const |
Downloads data from internal buffer to CPU memory. More... | |
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. 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... | |
std::size_t | sizeBytes () const |
DeviceArray class
Definition at line 54 of file device_array.h.
using pcl::gpu::DeviceArray< T >::type = T |
Element type.
Definition at line 57 of file device_array.h.
anonymous enum |
|
inline |
Empty constructor.
Definition at line 47 of file device_array.hpp.
|
inline |
Allocates internal buffer in GPU memory.
size | number of elements to allocate |
Definition at line 51 of file device_array.hpp.
|
inline |
Initializes with user allocated buffer.
Reference counting is disabled in this case.
ptr | pointer to buffer |
size | elements number |
Definition at line 55 of file device_array.hpp.
|
inline |
Copy constructor.
Just increments reference counter.
Definition at line 60 of file device_array.hpp.
|
inline |
Performs data copying.
If destination size differs it will be reallocated.
other | destination container |
Definition at line 87 of file device_array.hpp.
References pcl::gpu::DeviceMemory::copyTo().
|
inline |
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.
size | elements number |
Definition at line 73 of file device_array.hpp.
Referenced by pcl::gpu::copyFieldsEx(), pcl::gpu::NeighborIndices::create(), and pcl::gpu::extractEuclideanClusters().
|
inline |
Downloads data from internal buffer to CPU memory.
data | host vector to download to |
Definition at line 179 of file device_array.hpp.
|
inline |
Downloads data from internal buffer to CPU memory.
host_ptr | pointer to buffer to download |
Definition at line 112 of file device_array.hpp.
References pcl::gpu::DeviceMemory::download().
Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh(), pcl::gpu::extractEuclideanClusters(), and pcl::gpu::extractLabeledEuclideanClusters().
|
inline |
Downloads data from internal buffer to CPU memory.
host_ptr | pointer to buffer to download |
device_begin_offset | begin download location |
num_elements | number of elements from device_begin_offset |
Definition at line 119 of file device_array.hpp.
|
inline |
Returns const pointer for internal buffer in GPU memory.
Definition at line 142 of file device_array.hpp.
|
inline |
Returns pointer for internal buffer in GPU memory.
Definition at line 136 of file device_array.hpp.
|
inline |
Assignment operator.
Just increments reference counter.
Definition at line 65 of file device_array.hpp.
References pcl::gpu::DeviceMemory::operator=().
|
inline |
Returns pointer for internal buffer in GPU memory.
Definition at line 156 of file device_array.hpp.
Referenced by pcl::gpu::copyFieldsEx(), pcl::gpu::AsyncCopy< T >::download(), pcl::gpu::extractEuclideanClusters(), pcl::gpu::NeighborIndices::operator PtrStep< int >(), pcl::gpu::TextureBinder::TextureBinder(), and pcl::gpu::AsyncCopy< T >::upload().
|
inline |
Returns const pointer for internal buffer in GPU memory.
Definition at line 163 of file device_array.hpp.
|
inline |
Decrements reference counter and releases internal buffer if needed.
Definition at line 80 of file device_array.hpp.
|
inline |
Returns size in elements.
Definition at line 149 of file device_array.hpp.
Referenced by pcl::gpu::kinfuLS::StandaloneMarchingCubes< PointT >::convertTrianglesToMesh(), pcl::gpu::copyFieldsEx(), pcl::gpu::NeighborIndices::neighboors_size(), pcl::gpu::AsyncCopy< T >::upload(), and pcl::gpu::NeighborIndices::validate().
void pcl::gpu::DeviceArray< T >::swap | ( | DeviceArray< T > & | other_arg | ) |
Performs swap of data pointed with another device array.
other_arg | device array to swap with |
Definition at line 130 of file device_array.hpp.
References pcl::gpu::DeviceMemory::swap().
|
inline |
Uploads data to internal buffer in GPU memory.
It calls create() inside to ensure that internal buffer size is enough.
data | host vector to upload from |
Definition at line 171 of file device_array.hpp.
|
inline |
Uploads data from CPU memory to internal buffer.
host_ptr | pointer to buffer to upload |
device_begin_offset | begin upload |
num_elements | number of elements from device_bein_offset |
Definition at line 101 of file device_array.hpp.
References pcl::gpu::DeviceMemory::upload().
|
inline |
Uploads data to internal buffer in GPU memory.
It calls create() inside to ensure that internal buffer size is enough.
host_ptr | pointer to buffer to upload |
size | elements number |
Definition at line 94 of file device_array.hpp.
Referenced by pcl::gpu::extractEuclideanClusters(), and pcl::gpu::extractLabeledEuclideanClusters().