The NvMedia Tensor NvSciSync API encompasses all NvMedia Tensor Buffer Allocation processing.
Macros | |
#define | NVMEDIA_TENSOR_NVSCIBUF_VERSION_MAJOR (1u) |
Major version number. More... | |
#define | NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR (3u) |
Minor version number. More... | |
Functions | |
NvMediaStatus | NvMediaTensorNvSciBufInit (void) |
Initializes the NvMediaTensor NvSciBuf APIs. More... | |
void | NvMediaTensorNvSciBufDeinit (void) |
De-initializes the NvMediaTensor NvSciBuf APIs. More... | |
NvMediaStatus | NvMediaTensorFillNvSciBufAttrs (const NvMediaDevice *device, const NvMediaTensorAttr *attrs, uint32_t numAttrs, uint32_t flags, NvSciBufAttrList attr_h) |
Fills the NvSciBuf attributes used to allocate a tensor. More... | |
NvMediaStatus | NvMediaTensorCreateFromNvSciBuf (NvMediaDevice *device, NvSciBufObj nvSciBufObjInstance, NvMediaTensor **nvmTensor) |
Creates NvMediaTensor from an NvSciBuf handle. More... | |
NvMediaStatus | NvMediaTensorNvSciBufGetVersion (NvMediaVersion *version) |
Returns version information for the NvMediaTensor NvSciBuf API. More... | |
#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_MAJOR (1u) |
Major version number.
Definition at line 38 of file nvmedia_tensor_nvscibuf.h.
#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR (3u) |
Minor version number.
Definition at line 40 of file nvmedia_tensor_nvscibuf.h.
NvMediaStatus NvMediaTensorCreateFromNvSciBuf | ( | NvMediaDevice * | device, |
NvSciBufObj | nvSciBufObjInstance, | ||
NvMediaTensor ** | nvmTensor | ||
) |
Creates NvMediaTensor from an NvSciBuf handle.
This API assumes that nvSciBufObjInstance is a pointer to a valid NvSciBufObj.
You must allocate the nvSciBufObjInstance before you call this function, using the NvSciBufAttrList filled by NvMediaTensorGetNvSciBufAttrs().
When the application is done using nvmTensor, it must call NvMediaTensorDestroy() with nvmTensor.
[in] | device | A pointer to the NvMediaDevice. |
[in] | nvSciBufObjInstance | An NvSciBufObj for which an NvMediaTensor is to be imported. |
[in,out] | nvmTensor | A pointer to a location in which a pointer to an imported NvMediaTensor in stored. |
NvMediaStatus NvMediaTensorFillNvSciBufAttrs | ( | const NvMediaDevice * | device, |
const NvMediaTensorAttr * | attrs, | ||
uint32_t | numAttrs, | ||
uint32_t | flags, | ||
NvSciBufAttrList | attr_h | ||
) |
Fills the NvSciBuf attributes used to allocate a tensor.
This function assumes that attr_h is a valid NvSciBufAttrList created by the application.
This API maps the information in attrs and flags to NvSciBuf attributes and fills them into NvSciBufAttrList referenced by attr_h.
After calling this function, the application can call NvSciBufAllocate() with attr_h as input and get an NvSciBufObj as output. Then it can call NvMediaTensorCreateFromNvSciBuf() to create an NvMediaTensor from the NvSciBufObj.
[in] | device | A pointer to NvMediaDevice. |
[in] | attrs | An array of tensor alloc attributes for tensor creation. |
[in] | numAttrs | The number of attributes in the array. |
[in] | flags | Flags for module hint (used in future). |
[in,out] | attr_h | A handle to NvSciBufAttrlist to hold the NvSciBuf attributes for the requested NvMediaTensor. |
void NvMediaTensorNvSciBufDeinit | ( | void | ) |
De-initializes the NvMediaTensor NvSciBuf APIs.
NvMediaTensorFillNvSciBufAttrs() and NvMediaTensorCreateFromNvSciBuf() cannot be called after calling this function.
NvMediaStatus NvMediaTensorNvSciBufGetVersion | ( | NvMediaVersion * | version | ) |
Returns version information for the NvMediaTensor NvSciBuf API.
[out] | version | A pointer to a structure in which the function may store version information. |
NvMediaStatus NvMediaTensorNvSciBufInit | ( | void | ) |
Initializes the NvMediaTensor NvSciBuf APIs.
This function must be called before calling NvMediaTensorFillNvSciBufAttrs() and NvMediaTensorCreateFromNvSciBuf().