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
nvmedia_tensormetadata.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 - 2019, 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 
59 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_64 (64U)
60 
61 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_32 (32U)
62 
63 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_16 (16U)
64 
65 #define NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8 (8U)
66 
67 
100 #define NVM_TENSOR_NHWC_E_STRIDE_INDEX 0U
101 
109 #define NVM_TENSOR_NHWC_C_STRIDE_INDEX NVM_TENSOR_NHWC_E_STRIDE_INDEX
110 
118 #define NVM_TENSOR_NHWC_W_STRIDE_INDEX 1U
119 
127 #define NVM_TENSOR_NHWC_H_STRIDE_INDEX 2U
128 
136 #define NVM_TENSOR_NHWC_N_STRIDE_INDEX 3U
137 
160 #define NVM_TENSOR_NCHW_E_STRIDE_INDEX 0U
161 
170 #define NVM_TENSOR_NCHW_W_STRIDE_INDEX NVM_TENSOR_NCHW_E_STRIDE_INDEX
171 
179 #define NVM_TENSOR_NCHW_H_STRIDE_INDEX 1U
180 
187 #define NVM_TENSOR_NCHW_C_STRIDE_INDEX 2U
188 
196 #define NVM_TENSOR_NCHW_N_STRIDE_INDEX 3U
197 
222 #define NVM_TENSOR_NCxHWx_E_STRIDE_INDEX 0U
223 
232 #define NVM_TENSOR_NCxHWx_X_STRIDE_INDEX NVM_TENSOR_NCxHWx_E_STRIDE_INDEX
233 
241 #define NVM_TENSOR_NCxHWx_W_STRIDE_INDEX 1U
242 
250 #define NVM_TENSOR_NCxHWx_H_STRIDE_INDEX 2U
251 
259 #define NVM_TENSOR_NCxHWx_Cx_STRIDE_INDEX 3U
260 
268 #define NVM_TENSOR_NCxHWx_N_STRIDE_INDEX 4U
269 
270 
283 #define NVM_TENSOR_NHWC_C_DIMSZ_INDEX 0U
284 
290 #define NVM_TENSOR_NHWC_W_DIMSZ_INDEX 1U
291 
297 #define NVM_TENSOR_NHWC_H_DIMSZ_INDEX 2U
298 
304 #define NVM_TENSOR_NHWC_N_DIMSZ_INDEX 3U
305 
317 #define NVM_TENSOR_NCHW_W_DIMSZ_INDEX 0U
318 
324 #define NVM_TENSOR_NCHW_H_DIMSZ_INDEX 1U
325 
331 #define NVM_TENSOR_NCHW_C_DIMSZ_INDEX 2U
332 
338 #define NVM_TENSOR_NCHW_N_DIMSZ_INDEX 3U
339 
352 #define NVM_TENSOR_NCxHWx_x_DIMSZ_INDEX 0U
353 
359 #define NVM_TENSOR_NCxHWx_W_DIMSZ_INDEX 1U
360 
366 #define NVM_TENSOR_NCxHWx_H_DIMSZ_INDEX 2U
367 
373 #define NVM_TENSOR_NCxHWx_Cx_DIMSZ_INDEX 3U
374 
380 #define NVM_TENSOR_NCxHWx_N_DIMSZ_INDEX 4U
381 
387 typedef struct {
393  uint32_t dimsNum;
395  uint32_t dimSizes[NVMEDIA_TENSOR_MAX_DIMENSIONS];
397  uint32_t dimstrides[NVMEDIA_TENSOR_MAX_DIMENSIONS];
399  uint32_t dimsOrder;
401  uint32_t bitsPerElement;
403  uint32_t dataType;
405  uint32_t attrib4D_N;
407  uint32_t attrib4D_C;
409  uint32_t attrib4D_H;
411  uint32_t attrib4D_W;
413  uint32_t attrib4D_X;
414 
415 
417 
418 
419 #ifdef __cplusplus
420 }; /* extern "C" */
421 #endif
422 
423 #endif /* NVM_TENSORMETADATA_H */
uint32_t dimsOrder
Holds the order of the dimensions.
#define NVMEDIA_TENSOR_MAX_DIMENSIONS
Defines the maximum number of tensor dimensions.
uint32_t bitsPerElement
Holds the bitsPerElement such as NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8/16/32.
uint32_t dataType
Holds the tensor datatype, such as NVM_TENSOR_ATTR_DATA_TYPE_UINT/INT/FLOAT.
uint32_t attrib4D_N
Holds the 4D tensor attribute N.
uint32_t dimsNum
Holds the number of valid elements in dimSizes[] and dimstrides[].
Holds the tensor metadata.
uint32_t attrib4D_C
Holds the 4D tensor attribute C.
uint32_t attrib4D_X
Holds the 4D tensor attribute X.
uint32_t attrib4D_W
Holds the 4D tensor attribute W.
uint32_t attrib4D_H
Holds the 4D tensor attribute H.