# NVIDIA DRIVE OS Linux SDK API Reference

## Detailed Description

The NvMedia Tensor Metadata API encompasses all NvMedia Tensor metadata processing.

Tensor metadata processing follows the producer/consumer model:

• The producer must first populate the NvMediaTensorMetaData structure using producer metadata APIs.
• The producer posts the tensor.
• On the CUDA consumer side, the consumer acquires the metadata and the CUgraphicsResource, to form the tensor in the CUDA domain.

## Data Structures

Holds the tensor metadata. More...

## Modules

Stride and Dimension Indices
The application can use the stride and dimension indices defined below to access the strides and sizes from the corresponding arrays. For example, the stride indices are used to access dimstrides[] in the NvMediaTensorMetaData structure.

## Macros

#define NVMEDIA_TENSOR_MAX_DIMENSIONS   (8u)
Defines the maximum number of tensor dimensions. More...

#define NVM_TENSOR_ATTR_DIMENSION_ORDER_NHWC   (0x00000001u)
NVM_TENSOR_ATTR_DIMENSION_ORDER flags. More...

#define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCHW   (0x00000002u)
Specifies the NCHW dimension order for 4-D tensors. More...

#define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCxHWx   (0x00000003u)
Specifies the NCxHWCx dimension order for 4-D tensors. More...

#define NVM_TENSOR_ATTR_DATA_TYPE_UINT   (0x00000001u)
Specifies the unsigned integer tensor data type. More...

#define NVM_TENSOR_ATTR_DATA_TYPE_INT   (0x00000002u)
Specifies the integer tensor data type. More...

#define NVM_TENSOR_ATTR_DATA_TYPE_FLOAT   (0x00000003u)
Specifies the float tensor data type. More...

#define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64   (64U)
Indicates that each element is 64 bits wide. More...

#define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32   (32U)
Indicates that each element is 32 bits wide. More...

#define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16   (16U)
Indicates that each element is 16 bits wide. More...

#define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8   (8U)
Indicates that each element is 8 bits wide. More...

## ◆ NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16

 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16   (16U)

Indicates that each element is 16 bits wide.

Definition at line 69 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32

 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32   (32U)

Indicates that each element is 32 bits wide.

Definition at line 65 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64

 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64   (64U)

Indicates that each element is 64 bits wide.

Definition at line 63 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8

 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8   (8U)

Indicates that each element is 8 bits wide.

Definition at line 71 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DATA_TYPE_FLOAT

 #define NVM_TENSOR_ATTR_DATA_TYPE_FLOAT   (0x00000003u)

Specifies the float tensor data type.

Definition at line 59 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DATA_TYPE_INT

 #define NVM_TENSOR_ATTR_DATA_TYPE_INT   (0x00000002u)

Specifies the integer tensor data type.

Definition at line 57 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DATA_TYPE_UINT

 #define NVM_TENSOR_ATTR_DATA_TYPE_UINT   (0x00000001u)

Specifies the unsigned integer tensor data type.

Definition at line 53 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DIMENSION_ORDER_NCHW

 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCHW   (0x00000002u)

Specifies the NCHW dimension order for 4-D tensors.

Definition at line 47 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DIMENSION_ORDER_NCxHWx

 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCxHWx   (0x00000003u)

Specifies the NCxHWCx dimension order for 4-D tensors.

Definition at line 49 of file nvmedia_tensormetadata.h.

## ◆ NVM_TENSOR_ATTR_DIMENSION_ORDER_NHWC

 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NHWC   (0x00000001u)

NVM_TENSOR_ATTR_DIMENSION_ORDER flags.

Specifies the NHWC dimension order for 4-D tensors.

Definition at line 45 of file nvmedia_tensormetadata.h.

## ◆ NVMEDIA_TENSOR_MAX_DIMENSIONS

 #define NVMEDIA_TENSOR_MAX_DIMENSIONS   (8u)

Defines the maximum number of tensor dimensions.

Definition at line 41 of file nvmedia_tensormetadata.h.