NVIDIA DRIVE OS Linux SDK API Reference

5.2.0 Release
For Test and Development only
Tensor Handling Buffer Allocation API

Detailed Description

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   (6u)
 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...
 

Macro Definition Documentation

◆ NVMEDIA_TENSOR_NVSCIBUF_VERSION_MAJOR

#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_MAJOR   (1u)

Major version number.

Definition at line 38 of file nvmedia_tensor_nvscibuf.h.

◆ NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR

#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR   (6u)

Minor version number.

Definition at line 40 of file nvmedia_tensor_nvscibuf.h.

Function Documentation

◆ NvMediaTensorCreateFromNvSciBuf()

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.

Application must allocate the nvSciBufObjInstance before this function called, using the NvSciBufAttrList filled by NvMediaTensorFillNvSciBufAttrs().

When the application is done using NvMediaTensor, it must call NvMediaTensorDestroy() with NvMediaTensor.

Parameters
[in]deviceA pointer to the NvMediaDevice.
[in]nvSciBufObjInstanceAn NvSciBufObj for which an NvMediaTensor is to be imported.
[in,out]nvmTensorA pointer to a location in which a pointer to an imported NvMediaTensor in stored.
Returns
NvMediaStatus, the completion status of the operation:
Return values
NVMEDIA_STATUS_OKindicates that NvMediaTensor was successfully created from NvSciBufObj.
NVMEDIA_STATUS_NOT_SUPPORTEDindicates that overflow/underflow occured.
NVMEDIA_STATUS_ERRORindicates that another error occurred, such as failure to create NvMediaTensor from NvSciBufObj.
NVMEDIA_STATUS_BAD_PARAMETERindicates that one of the pointer parameters is NULL, or NvSciBufObj was not allocated using the attributes filled by NvMediaTensorGetNvSciBufAttrs().

◆ NvMediaTensorFillNvSciBufAttrs()

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 NvSciBufObjAlloc() with attr_h as input and get an NvSciBufObj as output. Then it can call NvMediaTensorCreateFromNvSciBuf() to create an NvMediaTensor from the NvSciBufObj.

Parameters
[in]deviceA pointer to NvMediaDevice.
[in]attrsA pointer to NvMediaTensorAttr.
[in]numAttrsThe number of attributes in the array.
[in]flagsFlags for module hint (used in future).
[in,out]attr_hA handle to NvSciBufAttrlist to hold the NvSciBuf attributes for the requested NvMediaTensor.
Returns
NvMediaStatus, the completion status of the operation:
Return values
NVMEDIA_STATUS_OKif the function is successful.
NVMEDIA_STATUS_NOT_SUPPORTEDindicates that overflow/underflow occured.
NVMEDIA_STATUS_BAD_PARAMETERif any argument is NULL or invalid or out of range.
NVMEDIA_STATUS_OUT_OF_MEMORYif there is a failure to allocate an internal struct.
NVMEDIA_STATUS_ERRORif any other error occurred.

◆ NvMediaTensorNvSciBufDeinit()

void NvMediaTensorNvSciBufDeinit ( void  )

De-initializes the NvMediaTensor NvSciBuf APIs.

◆ NvMediaTensorNvSciBufGetVersion()

NvMediaStatus NvMediaTensorNvSciBufGetVersion ( NvMediaVersion version)

Returns version information for the NvMediaTensor NvSciBuf API.

Parameters
[out]versionA pointer to a structure in which the function may store version information.
Returns
NvMediaStatus, the completion status of the operation:
Return values
NVMEDIA_STATUS_OKif the function call is successful.
NVMEDIA_STATUS_BAD_PARAMETERif version is invalid.

◆ NvMediaTensorNvSciBufInit()

NvMediaStatus NvMediaTensorNvSciBufInit ( void  )

Initializes the NvMediaTensor NvSciBuf APIs.

This function must be called before calling NvMediaTensorFillNvSciBufAttrs() and NvMediaTensorCreateFromNvSciBuf().

Returns
NvMediaStatus, the completion status of the operation:
Return values
NVMEDIA_STATUS_OKif the initialization is successful.
NVMEDIA_STATUS_ERRORif there is an error in the initialization.