48 #ifndef DW_DNN_TENSOR_H_ 49 #define DW_DNN_TENSOR_H_ 63 #define DW_DNN_TENSOR_MAX_DIMENSIONS 9U 139 DW_DEPRECATED(
"WARNING: dwDNNTensor_create() will be removed in the next major release." 140 "Please use dwDNNTensor_createNew() instead.")
192 const uint32_t* indices, uint32_t numIndices,
193 uint32_t dimension, const dwConstDNNTensorHandle_t tensorHandle);
266 #endif // DW_DNN_TENSOR_H_ Exposes the content of a dwDNNTensorHandle_t.
dwTrivialDataType
Specifies a type indicator of the underlying trivial data type.
DW_API_PUBLIC dwStatus dwDNNTensor_tryLock(bool *isLocked, void **data, dwDNNTensorHandle_t tensorHandle)
Tries to lock the tensor.
DW_API_PUBLIC dwStatus dwDNNTensor_unlock(dwDNNTensorHandle_t tensorHandle)
Unlocks the tensor, enabling other threads to lock the tensor and modify the content.
bool isGPUMapped
Indicates whether the memory allocation should be mapped to GPU.
dwDNNTensorLayout tensorLayout
Tensor layout.
dwTrivialDataType dataType
Data type of elements of the tensor.
dwDNNTensorProperties prop
Defines the properties of the tensor.
NVIDIA DriveWorks API: Core Methods
DW_API_PUBLIC dwStatus dwDNNTensor_getLayoutView(size_t *offset, size_t *stride, size_t *numElements, const uint32_t *indices, uint32_t numIndices, uint32_t dimension, const dwConstDNNTensorHandle_t tensorHandle)
Returns coefficients to facilitate traversing the given dimension.
dwDNNTensorType
Speficies the type of a tensor.
DW_API_PUBLIC dwStatus dwDNNTensor_lock(void **data, dwDNNTensorHandle_t tensorHandle)
Locks the tensor and retrieves pointer to the data with write access.
dwStatus
Status definition.
DW_API_PUBLIC dwStatus dwDNNTensor_create(dwDNNTensorHandle_t *tensorHandle, dwDNNTensorProperties properties, dwContextHandle_t ctx)
Creates and allocates resources for a dwDNNTensorHandle_t based on the properties.
dwDNNTensorType tensorType
Tensor type.
#define DW_DEPRECATED(msg)
#define DW_DNN_TENSOR_MAX_DIMENSIONS
Maximum number of dimensions a tensor can have including batch dimension (N).
DW_API_PUBLIC dwStatus dwDNNTensor_getTensor(dwDNNTensor *tensor, dwDNNTensorHandle_t tensorHandle)
Retrieves the dwDNNTensor of a dwDNNTensorHandle_t.
uint32_t numDimensions
Number of dimensions of the tensor.
DW_API_PUBLIC dwStatus dwDNNTensor_getProperties(dwDNNTensorProperties *properties, dwConstDNNTensorHandle_t tensorHandle)
Retrieves the properties of a dwDNNTensorHandle_t.
struct dwDNNTensorObject const * dwConstDNNTensorHandle_t
Specifies DNNTensor properties.
Tensor with both interleaved and planar channels.
const void * ptr
Pointer to the tensor content on CPU/GPU or NvMedia.
struct dwContextObject * dwContextHandle_t
Context handle.
struct dwDNNTensorObject * dwDNNTensorHandle_t
Handles representing Deep Neural Network interface.
Planar tensor. This is the most common tensor layout.
DW_API_PUBLIC dwStatus dwDNNTensor_createNew(dwDNNTensorHandle_t *const tensorHandle, dwDNNTensorProperties const *const properties, dwContextHandle_t const ctx)
Creates and allocates resources for a dwDNNTensorHandle_t based on the properties.
dwDNNTensorLayout
Specifies the layout of a tensor Here the letters in the suffix define:
DW_API_PUBLIC dwStatus dwDNNTensor_destroy(dwDNNTensorHandle_t tensorHandle)
Destroys the tensor handle and frees any memory created by dwDNNTensor_create().