|
|
VisionWorks Toolkit ReferenceApril 8, 2016 | 1.4 Release |
This section demonstrates data object creation in NVX CUDA API.
The NVX CUDA API uses transparent data objects with memory allocation controlled by the application.
The image data object is represented by abstract base structure nvxcu_image_t and its inheritors. To create the image, data object application must use one of the specific image classes, for example, nvxcu_pitch_linear_image_t. The nvxcu_pitch_linear_image_t represents image data in pitch linear format in row-major order (like 2D memory allocated via cudaMallocPitch). To create nvxcu_pitch_linear_image_t, object application must provide CUDA device pointers with strides for all planes, as well as image format and dimensions.
The array data object is represented by abstract base class nvxcu_array_t and its inheritors. To create array data object application must use one of the specific array classes, for example, nvxcu_plain_array_t. The nvxcu_plain_array_t represents array data in plain CUDA device memory. To create nvxcu_plain_array_t, application must provide CUDA device pointers to array's data and to array's number of items, as well as item type and the capacity of data buffer in the elements.
The pyramid data object is represented by abstract base class nvxcu_pyramid_t and its inheritors. To create the array, data object application must use one of the specific array classes, for example, nvxcu_pitch_linear_pyramid_t. nvxcu_pitch_linear_pyramid_t represents pyramid objects as plain C arrays of nvxcu_pitch_linear_image_t objects. Application must initialize all levels of the pyramid and must provide scale factor. It is application's responsibility to ensure size and format coherency between pyramid levels.