NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.0 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 
52 #define NVM_TENSOR_ATTR_DATA_TYPE_UINT (0x00000001u)
53 
54 #define NVM_TENSOR_ATTR_DATA_TYPE_INT (0x00000002u)
55 
56 #define NVM_TENSOR_ATTR_DATA_TYPE_FLOAT (0x00000003u)
57 
58 #if (NV_IS_SAFETY == 0)
59 
60 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64 (64U)
61 #endif /* (NV_IS_SAFETY == 0) */
62 
64 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32 (32U)
65 
66 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16 (16U)
67 
68 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8 (8U)
69 
70 #if (NV_IS_SAFETY == 0)
71 
105 #define NVM_TENSOR_NHWC_E_STRIDE_INDEX 0U
106 
114 #define NVM_TENSOR_NHWC_C_STRIDE_INDEX NVM_TENSOR_NHWC_E_STRIDE_INDEX
115 
123 #define NVM_TENSOR_NHWC_W_STRIDE_INDEX 1U
124 
132 #define NVM_TENSOR_NHWC_H_STRIDE_INDEX 2U
133 
141 #define NVM_TENSOR_NHWC_N_STRIDE_INDEX 3U
142 
168 #define NVM_TENSOR_NCHW_E_STRIDE_INDEX 0U
169 
178 #define NVM_TENSOR_NCHW_W_STRIDE_INDEX NVM_TENSOR_NCHW_E_STRIDE_INDEX
179 
187 #define NVM_TENSOR_NCHW_H_STRIDE_INDEX 1U
188 
195 #define NVM_TENSOR_NCHW_C_STRIDE_INDEX 2U
196 
204 #define NVM_TENSOR_NCHW_N_STRIDE_INDEX 3U
205 
233 #define NVM_TENSOR_NCxHWx_E_STRIDE_INDEX 0U
234 
243 #define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX NVM_TENSOR_NCxHWx_E_STRIDE_INDEX
244 
252 #define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX 1U
253 
261 #define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX 2U
262 
270 #define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX 3U
271 
279 #define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX 4U
280 
296 #define NVM_TENSOR_NHWC_C_DIMSZ_INDEX 0U
297 
304 #define NVM_TENSOR_NHWC_W_DIMSZ_INDEX 1U
305 
312 #define NVM_TENSOR_NHWC_H_DIMSZ_INDEX 2U
313 
320 #define NVM_TENSOR_NHWC_N_DIMSZ_INDEX 3U
321 
337 #define NVM_TENSOR_NCHW_W_DIMSZ_INDEX 0U
338 
345 #define NVM_TENSOR_NCHW_H_DIMSZ_INDEX 1U
346 
353 #define NVM_TENSOR_NCHW_C_DIMSZ_INDEX 2U
354 
361 #define NVM_TENSOR_NCHW_N_DIMSZ_INDEX 3U
362 
378 #define NVM_TENSOR_NCxHWx_x_DIMSZ_INDEX 0U
379 
386 #define NVM_TENSOR_NCxHWx_W_DIMSZ_INDEX 1U
387 
394 #define NVM_TENSOR_NCxHWx_H_DIMSZ_INDEX 2U
395 
402 #define NVM_TENSOR_NCxHWx_Cx_DIMSZ_INDEX 3U
403 
410 #define NVM_TENSOR_NCxHWx_N_DIMSZ_INDEX 4U
411 
415 #endif /* (NV_IS_SAFETY == 0) */
416 
420 typedef struct {
426  uint32_t dimsNum;
428  uint32_t dimSizes[NVMEDIA_TENSOR_MAX_DIMENSIONS];
430  uint32_t dimstrides[NVMEDIA_TENSOR_MAX_DIMENSIONS];
432  uint32_t dimsOrder;
434  uint32_t bitsPerElement;
436  uint32_t dataType;
438  uint32_t attrib4D_N;
440  uint32_t attrib4D_C;
442  uint32_t attrib4D_H;
444  uint32_t attrib4D_W;
446  uint32_t attrib4D_X;
448 
449 #ifdef __cplusplus
450 }; /* extern "C" */
451 #endif
452 
453 #endif /* NVM_TENSORMETADATA_H */
NvMediaTensorMetaData::attrib4D_X
uint32_t attrib4D_X
Holds the 4D tensor attribute X.
Definition: nvmedia_tensormetadata.h:446
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:440
NvMediaTensorMetaData::attrib4D_W
uint32_t attrib4D_W
Holds the 4D tensor attribute W.
Definition: nvmedia_tensormetadata.h:444
NvMediaTensorMetaData::attrib4D_H
uint32_t attrib4D_H
Holds the 4D tensor attribute H.
Definition: nvmedia_tensormetadata.h:442
NvMediaTensorMetaData::dimsOrder
uint32_t dimsOrder
Holds the order of the dimensions.
Definition: nvmedia_tensormetadata.h:432
NvMediaTensorMetaData::bitsPerElement
uint32_t bitsPerElement
Holds the bitsPerElement such as NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8/16/32.
Definition: nvmedia_tensormetadata.h:434
NvMediaTensorMetaData::dataType
uint32_t dataType
Holds the tensor datatype, such as NVM_TENSOR_ATTR_DATA_TYPE_UINT/INT/FLOAT.
Definition: nvmedia_tensormetadata.h:436
NvMediaTensorMetaData::attrib4D_N
uint32_t attrib4D_N
Holds the 4D tensor attribute N.
Definition: nvmedia_tensormetadata.h:438
NvMediaTensorMetaData
Holds the tensor metadata.
Definition: nvmedia_tensormetadata.h:420
NvMediaTensorMetaData::dimsNum
uint32_t dimsNum
Holds the number of valid elements in dimSizes[] and dimstrides[].
Definition: nvmedia_tensormetadata.h:426