NvDsTensor Interface
This file specifies the NvDsTensor management API.
The NvDsTensor API provides methods to allocate / deallocate, map / unmap and copy batched buffers.
Definition in file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
Go to the source code of this file.
Data Structures | |
| struct | NvDsTensorCreateParams |
| Holds parameters required to allocate an NvDsTensor. More... | |
| struct | NvDsTensor |
| Holds information about a single buffer in a batch. More... | |
| struct | NvDsTensorArray |
| Holds information about batched buffers. More... | |
| #define STRUCTURE_PADDING 4 |
Defines the default padding length for reserved fields of structures.
Definition at line 47 of file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
| typedef struct NvDsTensor NvDsTensor |
Holds information about a single buffer in a batch.
| typedef struct NvDsTensorArray NvDsTensorArray |
Holds information about batched buffers.
| typedef struct NvDsTensorCreateParams NvDsTensorCreateParams |
Holds parameters required to allocate an NvDsTensor.
| enum NvDsTensorFormat |
| Enumerator | |
|---|---|
| NVDSTENSOR_NCHW | |
| NVDSTENSOR_NCHW | |
Definition at line 59 of file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
Specifies mapping types for NvDsTensor.
| Enumerator | |
|---|---|
| NVDSTENSOR_MAP_READ | Specifies NvDsTensor mapping type "read.". |
| NVDSTENSOR_MAP_WRITE | Specifies NvDsTensor mapping type "write.". |
| NVDSTENSOR_MAP_READ_WRITE | Specifies NvDsTensor mapping type "read/write.". |
| NVDSTENSOR_MAP_READ | Specifies NvDsTensor mapping type "read.". |
| NVDSTENSOR_MAP_WRITE | Specifies NvDsTensor mapping type "write.". |
| NVDSTENSOR_MAP_READ_WRITE | Specifies NvDsTensor mapping type "read/write.". |
Definition at line 52 of file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
| enum NvDsTensorMemType |
Specifies memory types for NvDsTensor.
Definition at line 67 of file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
| enum NvDsTensorPrecision |
| Enumerator | |
|---|---|
| NVDSTENSOR_FP32 | |
| NVDSTENSOR_FP16 | |
| NVDSTENSOR_INT32 | |
| NVDSTENSOR_INT16 | |
| NVDSTENSOR_INT8 | |
| NVDSTENSOR_FP32 | |
| NVDSTENSOR_FP16 | |
| NVDSTENSOR_INT32 | |
| NVDSTENSOR_INT16 | |
| NVDSTENSOR_INT8 | |
Definition at line 80 of file 9.2/sources/libs/gst-nvdstensor/nvdstensor.h.
| int NvDsTensorCreate | ( | NvDsTensorArray ** | tensor, |
| uint32_t | arraySize, | ||
| NvDsTensorCreateParams * | params | ||
| ) |
Allocates a batch of tensor.
Allocates memory for batchSize tensors and returns a pointer to an allocated NvDsTensorArray. The params structure must have the allocation parameters of a single buffer. If params.size is set, a buffer of that size is allocated, and all other parameters (width, height, tensor format, etc.) are ignored.
Call NvDsTensorDestroy() to free resources allocated by this function.
| [out] | tensor | array An indirect pointer to the allocated batched buffers. |
| [in] | arraySize | Batch size of buffers. |
| [in] | params | A pointer to an NvDsTensorCreateParams structure. |
| int NvDsTensorDestroy | ( | NvDsTensorArray * | tensor | ) |
Frees batched buffers previously allocated by NvDsTensorCreate().
| [in] | tensors | A pointer to an NvDsTensorArray to be freed. |
| int NvDsTensorMap | ( | NvDsTensorArray * | tensors, |
| int | index, | ||
| NvDsTensorMemMapFlags | type | ||
| ) |
Maps hardware batched buffers to the HOST or CPU address space.
This function fills an array of pointers at tensors->tensorArray->mappedAddr tensors is a pointer to an NvDsTensorArray. tensorArray is a pointer to an NvDsTensor. mappedAddr holds pointer to buffer.
Use NvDsTensorUnMap() to unmap buffer(s) and release any resource.
| [in,out] | tensors | A pointer to an NvDsTensorArray structure. The function stores pointers to the buffers in a descendant of this structure; see the notes above. |
| [in] | index | Index of a buffer in the batch. -1 refers to all buffers in the batch. |
| [in] | type | A flag for mapping type. |
| int NvDsTensorUnMap | ( | NvDsTensorArray * | tensors, |
| int | index | ||
| ) |
Unmaps previously mapped buffer(s).
| [in] | tensors | A pointer to an NvDsTensorArray structure. |
| [in] | index | Index of a buffer in the batch. -1 indicates all buffers in the batch. |