39 #include <pcl/gpu/containers/kernel_containers.h>
40 #include <pcl/pcl_exports.h>
105 upload(
const void* host_ptr_arg, std::size_t sizeBytes_arg);
117 std::size_t device_begin_byte_offset,
118 std::size_t num_bytes);
134 std::size_t device_begin_byte_offset,
135 std::size_t num_bytes)
const;
169 std::size_t sizeBytes_;
172 std::atomic<int>* refcount_;
204 DeviceMemory2D(
int rows_arg,
int colsBytes_arg,
void* data_arg, std::size_t step_arg);
241 std::size_t host_step_arg,
251 download(
void* host_ptr_arg, std::size_t host_step_arg)
const;
271 ptr(
int y_arg = 0)
const;
313 std::atomic<int>* refcount_;
323 #include <pcl/gpu/containers/impl/device_memory.hpp>
bool empty() const
Returns true if unallocated otherwise false.
void swap(DeviceMemory2D &other_arg)
Performs swap of data pointed with another device memory.
std::size_t step() const
Returns stride between two consecutive rows in bytes for internal buffer.
~DeviceMemory2D()
Destructor.
void download(void *host_ptr_arg, std::size_t host_step_arg) const
Downloads data from internal buffer to CPU memory.
void create(int rows_arg, int colsBytes_arg)
Allocates internal buffer in GPU memory.
DeviceMemory2D(int rows_arg, int colsBytes_arg)
Allocates internal buffer in GPU memory.
int colsBytes() const
Returns number of bytes in each row.
int rows() const
Returns number of rows.
void upload(const void *host_ptr_arg, std::size_t host_step_arg, int rows_arg, int colsBytes_arg)
Uploads data to internal buffer in GPU memory.
DeviceMemory2D(int rows_arg, int colsBytes_arg, void *data_arg, std::size_t step_arg)
Initializes with user allocated buffer.
DeviceMemory2D & operator=(const DeviceMemory2D &other_arg)
Assignment operator.
DeviceMemory2D(const DeviceMemory2D &other_arg)
Copy constructor.
void release()
Decrements reference counter and releases internal buffer if needed.
DeviceMemory2D()
Empty constructor.
void copyTo(DeviceMemory2D &other) const
Performs data copying.
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.
DeviceMemory()
Empty constructor.
DeviceMemory(std::size_t sizeBytes_arg)
Allocates internal buffer in GPU memory.
std::size_t sizeBytes() const
DeviceMemory(void *ptr_arg, std::size_t sizeBytes_arg)
Initializes with user allocated buffer.
void swap(DeviceMemory &other_arg)
Performs swap of data pointed with another device memory.
DeviceMemory(const DeviceMemory &other_arg)
Copy constructor.
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.
DeviceMemory & operator=(const DeviceMemory &other_arg)
Assignment operator.
void copyTo(DeviceMemory &other) const
Performs data copying.
~DeviceMemory()
Destructor.
void release()
Decrements reference counter and releases internal buffer if needed.
void download(void *host_ptr_arg) const
Downloads data from internal buffer to CPU memory.
bool empty() const
Returns true if unallocated otherwise false.
void upload(const void *host_ptr_arg, std::size_t sizeBytes_arg)
Uploads data to internal buffer in GPU memory.
void create(std::size_t sizeBytes_arg)
Allocates internal buffer in GPU memory.