DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Point Cloud Memory Management

This tutorial demonstrates how point cloud processing creates and destroys CPU/CUDA memory.

Point cloud processing provides APIs to create either CPU or CUDA memory.

For example, specify a CUDA memory type:

dwPointCloud pointcloud;
pointcloud.type = DW_MEMORY_TYPE_CUDA;
pointcloud.coordSystem = DW_POINTCLOUD_COORDINATE_SYSTEM_CARTESIAN;
@ DW_MEMORY_TYPE_CUDA
CUDA memory.
Definition: Types.h:191
dwMemoryType type
Defines type of a memory GPU or CPU.
Definition: PointCloud.h:100
Defines point cloud data structure.
Definition: PointCloud.h:99

Set .type = DW_MEMORY_TYPE_CPU if CPU memory is intended. Initialize capacity in dwPointCloud to indicate the maximum storage,

pointcloud.capacity = 20000;
uint32_t capacity
numLayers * maxPointsPerLayer
Definition: PointCloud.h:107

Create CUDA memory holding up to 20000 cloud of points:

DW_API_PUBLIC dwStatus dwPointCloud_createBuffer(dwPointCloud *buffer)
Allocates memory for point cloud data structure.

The created memory holds points. Format of a point is specified with dwPointCloudFormat enum. .size will be zero upon successful memory creation. As it indicates there is currently no active point in the memory. dwPointCloud_createBuffer() will set .organized to false. To understand the difference between .organized = true and .organized = false, see Point Cloud Accumulator

To destroy the allocated CUDA memory:

DW_API_PUBLIC dwStatus dwPointCloud_destroyBuffer(dwPointCloud *buffer)
Destroys allocated memory for point cloud data structure.
Note
Point cloud buffers are owned by the application, user can waive the memory copy from the module.

For more details see Point Cloud Processing Sample.