Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • NVIDIA DRIVE OS Linux SDK API Reference

    6.0.4 Release
    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    nvmedia_tensormetadata.h
    Go to the documentation of this file.
    1 /*
    2  * Copyright (c) 2017 - 2022, 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;
    438  uint32_t dimSizes[NVMEDIA_TENSOR_MAX_DIMENSIONS];
    442  uint32_t dimstrides[NVMEDIA_TENSOR_MAX_DIMENSIONS];
    444  uint32_t dimsOrder;
    446  uint32_t bitsPerElement;
    448  uint32_t dataType;
    450  uint32_t attrib4D_N;
    452  uint32_t attrib4D_C;
    454  uint32_t attrib4D_H;
    456  uint32_t attrib4D_W;
    458  uint32_t attrib4D_X;
    460 
    461 #ifdef __cplusplus
    462 } /* extern "C" */
    463 #endif
    464 
    465 #endif /* NVM_TENSORMETADATA_H */
    NvMediaTensorMetaData::attrib4D_X
    uint32_t attrib4D_X
    Holds the tensor attribute X.
    Definition: nvmedia_tensormetadata.h:458
    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 tensor attribute C.
    Definition: nvmedia_tensormetadata.h:452
    NvMediaTensorMetaData::attrib4D_W
    uint32_t attrib4D_W
    Holds the tensor attribute W.
    Definition: nvmedia_tensormetadata.h:456
    NvMediaTensorMetaData::attrib4D_H
    uint32_t attrib4D_H
    Holds the tensor attribute H.
    Definition: nvmedia_tensormetadata.h:454
    NvMediaTensorMetaData::dimsOrder
    uint32_t dimsOrder
    Holds the order of the dimensions.
    Definition: nvmedia_tensormetadata.h:444
    NvMediaTensorMetaData::bitsPerElement
    uint32_t bitsPerElement
    Holds the bitsPerElement such as NVM_TENSOR_ATTR_BITS_PER_ELEMENT_8/16.
    Definition: nvmedia_tensormetadata.h:446
    NvMediaTensorMetaData::dataType
    uint32_t dataType
    Holds the tensor datatype, such as NVM_TENSOR_ATTR_DATA_TYPE_INT/FLOAT.
    Definition: nvmedia_tensormetadata.h:448
    NvMediaTensorMetaData::attrib4D_N
    uint32_t attrib4D_N
    Holds the tensor attribute N.
    Definition: nvmedia_tensormetadata.h:450
    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
    人人超碰97caoporen国产