NVIDIA DRIVE OS Linux SDK API Reference

5.1.9.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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   (0u)
 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 (NvMediaDevice *device, 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 nvSciBufObj, 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

#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   (0u)

Minor version number.

Definition at line 40 of file nvmedia_tensor_nvscibuf.h.

Function Documentation

NvMediaStatus NvMediaTensorCreateFromNvSciBuf ( NvMediaDevice device,
NvSciBufObj  nvSciBufObj,
NvMediaTensor **  nvmTensor 
)

Creates NvMediaTensor from an NvSciBuf handle.

This API assumes that nvscibufObj is a pointer to a valid NvSciBufObj.

You must allocate the nvscibufObj before you call this function, using the NvSciBufAttrList filled by NvMediaTensorGetNvSciBufAttrs().

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

Parameters
[in]deviceA pointer to the NvMediaDevice.
[in]nvSciBufObjAn 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:
  • NVMEDIA_STATUS_OK indicates that nvmTensor was successfully created from nvscibufObj.
  • NVMEDIA_STATUS_ERROR indicates that another error occurred, such as failure to create nvmTensor from nvscibufObj.
  • NVMEDIA_STATUS_BAD_PARAMETER indicates that one of the pointer parameters is NULL, or nvscibufObj was not allocated using the attributes filled by NvMediaTensorGetNvSciBufAttrs().
NvMediaStatus NvMediaTensorFillNvSciBufAttrs ( NvMediaDevice device,
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.

Parameters
[in]deviceA pointer to NvMediaDevice.
[in]attrsAn array of tensor alloc attributes for tensor creation.
[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:
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.

Parameters
[out]versionA pointer to a structure in which the function may store version information.
Returns
NvMediaStatus, the completion status of the operation:
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: