Loading [MathJax]/extensions/tex2jax.js
  • <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>

  • DriveWorks SDK Reference
    5.20.37 Release
    For Test and Development only

    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    Tensor.h
    Go to the documentation of this file.
    1
    2//
    3// Notice
    4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
    5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
    7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
    8//
    9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
    10// information or for any infringement of patents or other rights of third parties that may
    11// result from its use. No license is granted by implication or otherwise under any patent
    12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
    13// expressly authorized by NVIDIA. Details are subject to change without notice.
    14// This code supersedes and replaces all information previously supplied.
    15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
    16// components in life support devices or systems without express written approval of
    17// NVIDIA CORPORATION & AFFILIATES.
    18//
    19// SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
    20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
    21//
    22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
    23// property and proprietary rights in and to this material, related
    24// documentation and any modifications thereto. Any use, reproduction,
    25// disclosure or distribution of this material and related documentation
    26// without an express license agreement from NVIDIA CORPORATION or
    27// its affiliates is strictly prohibited.
    28//
    30
    46#ifndef DW_DNN_TENSOR_H_
    47#define DW_DNN_TENSOR_H_
    48
    50
    51#ifdef __cplusplus
    52extern "C" {
    53#endif
    54
    57typedef struct dwDNNTensorObject* dwDNNTensorHandle_t;
    58typedef struct dwDNNTensorObject const* dwConstDNNTensorHandle_t;
    59
    61#define DW_DNN_TENSOR_MAX_DIMENSIONS 8U
    62
    64typedef enum {
    70
    77typedef enum {
    87
    89typedef enum {
    94
    96typedef struct
    97{
    117 uint32_t dimensionSize[DW_DNN_TENSOR_MAX_DIMENSIONS];
    121 float32_t dynamicRange[2];
    123
    125typedef struct
    126{
    134 const void* ptr;
    136
    153 dwDNNTensorProperties const* const properties,
    154 dwContextHandle_t const ctx);
    155
    172 dwDNNTensorProperties const* const properties,
    173 uint8_t* const extMem,
    174 size_t const stride);
    175
    191
    216dwStatus dwDNNTensor_getLayoutView(size_t* const offset, size_t* const stride, size_t* const numElements,
    217 const uint32_t* const indices, uint32_t const numIndices,
    218 uint32_t const dimension, dwConstDNNTensorHandle_t const tensorHandle);
    219
    234
    252
    268
    284
    302dwStatus dwDNNTensor_lock(void** const data, dwDNNTensorHandle_t const tensorHandle);
    303
    323dwStatus dwDNNTensor_tryLock(bool* const isLocked, void** const data, dwDNNTensorHandle_t const tensorHandle);
    324
    338
    339#ifdef __cplusplus
    340}
    341#endif
    343#endif // DW_DNN_TENSOR_H_
    NVIDIA DriveWorks API: Core Methods
    dwStatus
    Status definition.
    Definition: ErrorDefs.h:44
    float float32_t
    Specifies POD types.
    Definition: BasicTypes.h:59
    int64_t dwTime_t
    Specifies a timestamp unit, in microseconds.
    Definition: BasicTypes.h:65
    struct dwContextObject * dwContextHandle_t
    Context handle.
    Definition: Context.h:85
    #define DW_API_PUBLIC
    Definition: Exports.h:56
    dwTrivialDataType
    Specifies a type indicator of the underlying trivial data type.
    Definition: TypesExtra.h:58
    dwTrivialDataType dataType
    Data type of elements of the tensor.
    Definition: Tensor.h:99
    const void * ptr
    Pointer to the tensor content on CPU/GPU or NvMedia.
    Definition: Tensor.h:134
    uint32_t numDimensions
    Number of dimensions of the tensor.
    Definition: Tensor.h:109
    dwTime_t timestamp_us
    Specifies a timestamp, in microseconds, corresponding to this tensor data.
    Definition: Tensor.h:130
    bool isGPUMapped
    Indicates whether the memory allocation should be mapped to GPU.
    Definition: Tensor.h:107
    dwDNNTensorType tensorType
    Tensor type.
    Definition: Tensor.h:101
    dwDNNTensorLayout tensorLayout
    Tensor layout.
    Definition: Tensor.h:103
    dwDNNTensorColorSpace colorSpace
    Color space of the data in the tensor.
    Definition: Tensor.h:119
    dwDNNTensorProperties prop
    Defines the properties of the tensor.
    Definition: Tensor.h:128
    DW_API_PUBLIC dwStatus dwDNNTensor_destroy(dwDNNTensorHandle_t const tensorHandle)
    Destroys the tensor handle and frees any memory created by dwDNNTensor_create() or dwDNNTensor_create...
    #define DW_DNN_TENSOR_MAX_DIMENSIONS
    Maximum number of dimensions a tensor can have including batch dimension (N).
    Definition: Tensor.h:61
    DW_API_PUBLIC dwStatus dwDNNTensor_unlock(dwDNNTensorHandle_t const tensorHandle)
    Unlocks the tensor, enabling other threads to lock the tensor and modify the content.
    DW_API_PUBLIC dwStatus dwDNNTensor_getTimestamp(dwTime_t *const time, dwDNNTensorHandle_t const tensorHandle)
    Retrieves the timestamp of a dwDNNTensorHandle_t.
    DW_API_PUBLIC dwStatus dwDNNTensor_createWithExtMem(dwDNNTensorHandle_t *const tensorHandle, dwDNNTensorProperties const *const properties, uint8_t *const extMem, size_t const stride)
    Creates a dwDNNTensorHandle_t with external memory resources based on the properties.
    dwDNNTensorType
    Speficies the type of a tensor.
    Definition: Tensor.h:64
    dwDNNTensorColorSpace
    Represents the color space the data is represented in. If unknown, then its custom or non color data.
    Definition: Tensor.h:89
    struct dwDNNTensorObject * dwDNNTensorHandle_t
    Handles representing Deep Neural Network interface.
    Definition: Tensor.h:57
    DW_API_PUBLIC dwStatus dwDNNTensor_getLayoutView(size_t *const offset, size_t *const stride, size_t *const numElements, const uint32_t *const indices, uint32_t const numIndices, uint32_t const dimension, dwConstDNNTensorHandle_t const tensorHandle)
    Returns coefficients to facilitate traversing the given dimension.
    dwDNNTensorLayout
    Specifies the layout of a tensor Here the letters in the suffix define:
    Definition: Tensor.h:77
    DW_API_PUBLIC dwStatus dwDNNTensor_getProperties(dwDNNTensorProperties *const properties, dwConstDNNTensorHandle_t const tensorHandle)
    Retrieves the properties of a dwDNNTensorHandle_t.
    struct dwDNNTensorObject const * dwConstDNNTensorHandle_t
    Definition: Tensor.h:58
    DW_API_PUBLIC dwStatus dwDNNTensor_lock(void **const data, dwDNNTensorHandle_t const tensorHandle)
    Locks the tensor and retrieves pointer to the data with write access.
    DW_API_PUBLIC dwStatus dwDNNTensor_create(dwDNNTensorHandle_t *const tensorHandle, dwDNNTensorProperties const *const properties, dwContextHandle_t const ctx)
    Creates and allocates resources for a dwDNNTensorHandle_t based on the properties.
    DW_API_PUBLIC dwStatus dwDNNTensor_tryLock(bool *const isLocked, void **const data, dwDNNTensorHandle_t const tensorHandle)
    Tries to lock the tensor.
    DW_API_PUBLIC dwStatus dwDNNTensor_getTensor(dwDNNTensor *const tensor, dwDNNTensorHandle_t const tensorHandle)
    Retrieves the dwDNNTensor of a dwDNNTensorHandle_t.
    DW_API_PUBLIC dwStatus dwDNNTensor_setTimestamp(dwTime_t time, dwDNNTensorHandle_t const tensorHandle)
    Set timestamp of a dwDNNTensorHandle_t.
    @ DW_DNN_TENSOR_TYPE_CUDA
    CUDA tensor.
    Definition: Tensor.h:68
    @ DW_DNN_TENSOR_TYPE_CPU
    CPU tensor.
    Definition: Tensor.h:66
    @ DW_DNN_TENSOR_COLORSPACE_RGB
    Definition: Tensor.h:91
    @ DW_DNN_TENSOR_COLORSPACE_UNKNOWN
    Definition: Tensor.h:90
    @ DW_DNN_TENSOR_COLORSPACE_YUV
    Definition: Tensor.h:92
    @ DW_DNN_TENSOR_LAYOUT_NHWC
    Interleaved tensor.
    Definition: Tensor.h:81
    @ DW_DNN_TENSOR_LAYOUT_NCHWx
    Tensor with both interleaved and planar channels.
    Definition: Tensor.h:85
    @ DW_DNN_TENSOR_LAYOUT_NCHW
    Planar tensor. This is the most common tensor layout.
    Definition: Tensor.h:79
    Exposes the content of a dwDNNTensorHandle_t.
    Definition: Tensor.h:126
    Specifies DNNTensor properties.
    Definition: Tensor.h:97
    人人超碰97caoporen国产