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... | |
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.
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.
arrayData | [in] data |
flags | [in] flags |
array | [out] pointer to an array handle |
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.
hostData | [in] Pointer to structure with host memory to be wrapped. |
flags | [in] flags |
img | [out] pointer to an image handle |