VPI - Vision Programming Interface

0.3.7 Release

CPU Interoperability

Declaration of functions for CPU/host interoperability. More...

Functions

VPIStatus vpiArrayWrapHostMem (const VPIArrayData *arrayData, uint32_t flags, VPIArray *array)
 Create an array object by wrapping around an existing host-memory block. More...
 
VPIStatus vpiImageWrapHostMem (const VPIImageData *hostData, uint32_t flags, VPIImage *img)
 Create an image object by wrapping around an existing host-memory block. More...
 

Detailed Description

Declaration of functions for CPU/host interoperability.

The provided methods allows wrapping CPU/host objects external to VPI, e.g., allocated by malloc or new. They can then be used efficiently in VPI compute pipelines.

Function Documentation

◆ vpiArrayWrapHostMem()

VPIStatus vpiArrayWrapHostMem ( const VPIArrayData arrayData,
uint32_t  flags,
VPIArray array 
)

#include <vpi/Array.h>

Create an array object by wrapping around an existing host-memory block.

Stride between elements has to be at least as large as the element structure size. It also has to respect alignment requirements of the element data structure.

Parameters
arrayData[in] data
flags[in] flags
array[out] pointer to an array handle
Returns
an error code on failure else VPI_SUCCESS

◆ vpiImageWrapHostMem()

VPIStatus vpiImageWrapHostMem ( const VPIImageData hostData,
uint32_t  flags,
VPIImage img 
)

#include <vpi/Image.h>

Create an image object by wrapping around an existing host-memory block.

Only pitch-linear format is supported. The underlying image object does not own/claim the memory block.

Parameters
hostData[in] Pointer to structure with host memory to be wrapped.
flags[in] flags
img[out] pointer to an image handle
Returns
an error code on failure else VPI_SUCCESS