NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
nvmedia_tensormetadata.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 - 2020, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
17 #ifndef NVM_TENSORMETADATA_H
18 #define NVM_TENSORMETADATA_H
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
41 #define NVMEDIA_TENSOR_MAX_DIMENSIONS (8u)
42 
45 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NHWC (0x00000001u)
46 
47 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCHW (0x00000002u)
48 
49 #define NVM_TENSOR_ATTR_DIMENSION_ORDER_NCxHWx (0x00000003u)
50 
51 #if (NV_IS_SAFETY == 0)
52 
53 #define NVM_TENSOR_ATTR_DATA_TYPE_UINT (0x00000001u)
54 #endif
55 
57 #define NVM_TENSOR_ATTR_DATA_TYPE_INT (0x00000002u)
58 
59 #define NVM_TENSOR_ATTR_DATA_TYPE_FLOAT (0x00000003u)
60 
61 #if (NV_IS_SAFETY == 0)
62 
63 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64 (64U)
64 
65 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32 (32U)
66 #endif /* (NV_IS_SAFETY == 0) */
67 
69 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16 (16U)
70 
71 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8 (8U)
72 
73 #if (NV_IS_SAFETY == 0)
74 
108 #define NVM_TENSOR_NHWC_E_STRIDE_INDEX 0U
109 
117 #define NVM_TENSOR_NHWC_C_STRIDE_INDEX NVM_TENSOR_NHWC_E_STRIDE_INDEX
118 
126 #define NVM_TENSOR_NHWC_W_STRIDE_INDEX 1U
127 
135 #define NVM_TENSOR_NHWC_H_STRIDE_INDEX 2U
136 
144 #define NVM_TENSOR_NHWC_N_STRIDE_INDEX 3U
145 
171 #define NVM_TENSOR_NCHW_E_STRIDE_INDEX 0U
172 
181 #define NVM_TENSOR_NCHW_W_STRIDE_INDEX NVM_TENSOR_NCHW_E_STRIDE_INDEX
182 
190 #define NVM_TENSOR_NCHW_H_STRIDE_INDEX 1U
191 
198 #define NVM_TENSOR_NCHW_C_STRIDE_INDEX 2U
199 
207 #define NVM_TENSOR_NCHW_N_STRIDE_INDEX 3U
208 
236 #define NVM_TENSOR_NCxHWx_E_STRIDE_INDEX 0U
237 
246 #define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX NVM_TENSOR_NCxHWx_E_STRIDE_INDEX
247 
255 #define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX 1U
256 
264 #define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX 2U
265 
273 #define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX 3U
274 
282 #define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX 4U
283 
299 #define NVM_TENSOR_NHWC_C_DIMSZ_INDEX 0U
300 
307 #define NVM_TENSOR_NHWC_W_DIMSZ_INDEX 1U
308 
315 #define NVM_TENSOR_NHWC_H_DIMSZ_INDEX 2U
316 
323 #define NVM_TENSOR_NHWC_N_DIMSZ_INDEX 3U
324 
340 #define NVM_TENSOR_NCHW_W_DIMSZ_INDEX 0U
341 
348 #define NVM_TENSOR_NCHW_H_DIMSZ_INDEX 1U
349 
356 #define NVM_TENSOR_NCHW_C_DIMSZ_INDEX 2U
357 
364 #define NVM_TENSOR_NCHW_N_DIMSZ_INDEX 3U
365 
381 #define NVM_TENSOR_NCxHWx_x_DIMSZ_INDEX 0U
382 
389 #define NVM_TENSOR_NCxHWx_W_DIMSZ_INDEX 1U
390 
397 #define NVM_TENSOR_NCxHWx_H_DIMSZ_INDEX 2U
398 
405 #define NVM_TENSOR_NCxHWx_Cx_DIMSZ_INDEX 3U
406 
413 #define NVM_TENSOR_NCxHWx_N_DIMSZ_INDEX 4U
414 
418 #endif /* (NV_IS_SAFETY == 0) */
419 
423 typedef struct {
429  uint32_t dimsNum;
431  uint32_t dimSizes[NVMEDIA_TENSOR_MAX_DIMENSIONS];
433  uint32_t dimstrides[NVMEDIA_TENSOR_MAX_DIMENSIONS];
435  uint32_t dimsOrder;
437  uint32_t bitsPerElement;
439  uint32_t dataType;
441  uint32_t attrib4D_N;
443  uint32_t attrib4D_C;
445  uint32_t attrib4D_H;
447  uint32_t attrib4D_W;
449  uint32_t attrib4D_X;
451 
452 #ifdef __cplusplus
453 }; /* extern "C" */
454 #endif
455 
456 #endif /* NVM_TENSORMETADATA_H */
NvMediaTensorMetaData::attrib4D_X
uint32_t attrib4D_X
Holds the 4D tensor attribute X.
Definition: nvmedia_tensormetadata.h:449
NVMEDIA_TENSOR_MAX_DIMENSIONS
#define NVMEDIA_TENSOR_MAX_DIMENSIONS
Defines the maximum number of tensor dimensions.
Definition: nvmedia_tensormetadata.h:41
NvMediaTensorMetaData::attrib4D_C
uint32_t attrib4D_C
Holds the 4D tensor attribute C.
Definition: nvmedia_tensormetadata.h:443
NvMediaTensorMetaData::attrib4D_W
uint32_t attrib4D_W
Holds the 4D tensor attribute W.
Definition: nvmedia_tensormetadata.h:447
NvMediaTensorMetaData::attrib4D_H
uint32_t attrib4D_H
Holds the 4D tensor attribute H.
Definition: nvmedia_tensormetadata.h:445
NvMediaTensorMetaData::dimsOrder
uint32_t dimsOrder
Holds the order of the dimensions.
Definition: nvmedia_tensormetadata.h:435
NvMediaTensorMetaData::bitsPerElement
uint32_t bitsPerElement
Holds the bitsPerElement such as NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8/16.
Definition: nvmedia_tensormetadata.h:437
NvMediaTensorMetaData::dataType
uint32_t dataType
Holds the tensor datatype, such as NVM_TENSOR_ATTR_DATA_TYPE_INT/FLOAT.
Definition: nvmedia_tensormetadata.h:439
NvMediaTensorMetaData::attrib4D_N
uint32_t attrib4D_N
Holds the 4D tensor attribute N.
Definition: nvmedia_tensormetadata.h:441
NvMediaTensorMetaData
Holds the tensor metadata.
Definition: nvmedia_tensormetadata.h:423
NvMediaTensorMetaData::dimsNum
uint32_t dimsNum
Holds the number of valid elements in dimSizes[] and dimstrides[].
Definition: nvmedia_tensormetadata.h:429