NVIDIA DRIVE OS Linux SDK API Reference

6.0.6 Release
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   (7u)
 Minor version number. More...
 
#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_PATCH   (0u)
 Patch 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 43 of file nvmedia_tensor_nvscibuf.h.

◆ NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR

#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_MINOR   (7u)

Minor version number.

Definition at line 45 of file nvmedia_tensor_nvscibuf.h.

◆ NVMEDIA_TENSOR_NVSCIBUF_VERSION_PATCH

#define NVMEDIA_TENSOR_NVSCIBUF_VERSION_PATCH   (0u)

Patch version number.

Definition at line 47 of file nvmedia_tensor_nvscibuf.h.

Function Documentation

◆ NvMediaTensorCreateFromNvSciBuf()

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

Creates NvMediaTensor from an NvSciBuf handle.

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

Parameters
[in]deviceA pointer to NvMediaDevice which has been DEPRECATED. Should be set to NULL.
[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().
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ 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 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 which has been DEPRECATED. Should be set to NULL.
[in]attrsA valid, non-NULL pointer to NvMediaTensorAttr.
[in]numAttrsThe number of attributes in the array.
[in]flagsFlags for module hint (used in future).
[in,out]attr_hA valid non-NULL 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.
Precondition
  • This function assumes that attr_h is a valid NvSciBufAttrList created by the application.
  • NvSciBuf library must have been loaded and NvMediaTensor NvSciBuf interfaces must have been initialized.
  • This function must be called before allocation of NvSciBufObj.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvMediaTensorNvSciBufDeinit()

void NvMediaTensorNvSciBufDeinit ( void  )

De-initializes the NvMediaTensor NvSciBuf APIs.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: No
    • De-Init: Yes

◆ NvMediaTensorNvSciBufGetVersion()

NvMediaStatus NvMediaTensorNvSciBufGetVersion ( NvMediaVersion version)

Returns version information for the NvMediaTensor NvSciBuf API.

Parameters
[out]versionA valid, non-NULLpointer 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.
Precondition
None


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: Yes
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvMediaTensorNvSciBufInit()

NvMediaStatus NvMediaTensorNvSciBufInit ( void  )

Initializes the NvMediaTensor NvSciBuf APIs.

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.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No