Defines Deep Neural Network (DNN) module for performing inference using NVIDIA® TensorRT™ models.
Data Structures | |
| struct | dwDNNMetaData |
| Specifies TensorRT model header. More... | |
Modules | |
| DNN Plugin | |
| Provides an interface for supporting non-standard DNN layers. | |
Typedefs | |
| typedef struct dwDNNObject const * | dwConstDNNHandle_t |
| typedef struct dwDNNObject * | dwDNNHandle_t |
| Handles representing Deep Neural Network interface. More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwDNN_getCUDAStream (cudaStream_t *const stream, dwDNNHandle_t const network) |
| Gets the CUDA stream used by the feature list. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getInputBlobCount (uint32_t *const count, dwDNNHandle_t const network) |
| Gets the input blob count. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getInputIndex (uint32_t *const blobIndex, const char8_t *const blobName, dwDNNHandle_t const network) |
| Gets the index of an input blob with a given blob name. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getInputSize (dwBlobSize *const blobSize, uint32_t const blobIndex, dwDNNHandle_t const network) |
| Gets the input blob size at blobIndex. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getInputTensorProperties (dwDNNTensorProperties *const tensorProps, uint32_t const blobIndex, dwDNNHandle_t const network) |
| Gets the input tensor properties at blobIndex. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getMetaData (dwDNNMetaData *const metaData, dwDNNHandle_t const network) |
| Returns the metadata for the associated network model. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getOutputBlobCount (uint32_t *const count, dwDNNHandle_t const network) |
| Gets the output blob count. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getOutputIndex (uint32_t *const blobIndex, const char8_t *const blobName, dwDNNHandle_t const network) |
| Gets the index of an output blob with a given blob name. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getOutputSize (dwBlobSize *const blobSize, uint32_t const blobIndex, dwDNNHandle_t const network) |
| Gets the output blob size at blobIndex. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_getOutputTensorProperties (dwDNNTensorProperties *const tensorProps, uint32_t const blobIndex, dwDNNHandle_t const network) |
| Gets the output tensor properties at blobIndex. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_infer (dwDNNTensorHandle_t *const outputTensors, uint32_t const outputTensorCount, dwConstDNNTensorHandle_t *const inputTensors, uint32_t const inputTensorCount, dwDNNHandle_t const network) |
| Runs inference pipeline on the given input. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_inferRaw (float32_t *const *const dOutput, const float32_t *const *const dInput, uint32_t const batchsize, dwDNNHandle_t const network) |
| Forwards pass from all input blobs to all output blobs. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_inferSIO (float32_t *const dOutput, const float32_t *const dInput, uint32_t const batchsize, dwDNNHandle_t const network) |
| Forwards pass from the first input blob to the first output blob (a shortcut for a single input - single output network). More... | |
| DW_API_PUBLIC dwStatus | dwDNN_initializeTensorRTFromFile (dwDNNHandle_t *const network, const char8_t *const modelFilename, const dwDNNPluginConfiguration *const pluginConfiguration, dwProcessorType const processorType, dwContextHandle_t const context) |
| Creates and initializes a TensorRT Network from file. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_initializeTensorRTFromFileWithEngineId (dwDNNHandle_t *const network, const char8_t *const modelFilename, const dwDNNPluginConfiguration *const pluginConfiguration, dwProcessorType const processorType, uint32_t engineId, dwContextHandle_t const context) |
| Creates and initializes a TensorRT Network from file with DLA Engine ID. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_initializeTensorRTFromMemory (dwDNNHandle_t *const network, const char8_t *const modelContent, uint32_t const modelContentSize, const dwDNNPluginConfiguration *const pluginConfiguration, dwProcessorType const processorType, dwContextHandle_t const context) |
| Creates and initializes a TensorRT Network from memory. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_initializeTensorRTFromMemoryWithEngineId (dwDNNHandle_t *const network, const char8_t *const modelContent, uint32_t const modelContentSize, const dwDNNPluginConfiguration *const pluginConfiguration, dwProcessorType const processorType, uint32_t engineId, dwContextHandle_t const context) |
| Creates and initializes a TensorRT Network from memory with DLA Engine ID. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_release (dwDNNHandle_t const network) |
| Releases a given network. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_reset (dwDNNHandle_t const network) |
| Resets a given network. More... | |
| DW_API_PUBLIC dwStatus | dwDNN_setCUDAStream (cudaStream_t const stream, dwDNNHandle_t const network) |
| Sets the CUDA stream for infer operations. More... | |
| struct dwDNNMetaData |
| Data Fields | ||
|---|---|---|
| dwDataConditionerParams | dataConditionerParams | DataConditioner parameters for running this network. |
| typedef struct dwDNNObject const* dwConstDNNHandle_t |
| typedef struct dwDNNObject* dwDNNHandle_t |
| DW_API_PUBLIC dwStatus dwDNN_getCUDAStream | ( | cudaStream_t *const | stream, |
| dwDNNHandle_t const | network | ||
| ) |
Gets the CUDA stream used by the feature list.
| [out] | stream | The CUDA stream currently used. |
| [in] | network | A handle to the DNN module. |
| DW_API_PUBLIC dwStatus dwDNN_getInputBlobCount | ( | uint32_t *const | count, |
| dwDNNHandle_t const | network | ||
| ) |
Gets the input blob count.
| [out] | count | A pointer to the number of input blobs. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getInputIndex | ( | uint32_t *const | blobIndex, |
| const char8_t *const | blobName, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the index of an input blob with a given blob name.
| [out] | blobIndex | A pointer to the index of the blob with the given name. |
| [in] | blobName | A pointer to the name of an input blob. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getInputSize | ( | dwBlobSize *const | blobSize, |
| uint32_t const | blobIndex, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the input blob size at blobIndex.
| [out] | blobSize | A pointer to the where the input blob size is returned. |
| [in] | blobIndex | Specifies the blob index; must be in the range [0 dwDNN_getInputBlobCount()-1]. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getInputTensorProperties | ( | dwDNNTensorProperties *const | tensorProps, |
| uint32_t const | blobIndex, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the input tensor properties at blobIndex.
| [out] | tensorProps | Tensor properties. |
| [in] | blobIndex | Specifies the blob index; must be in the range [0 dwDNN_getInputBlobCount()-1]. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getMetaData | ( | dwDNNMetaData *const | metaData, |
| dwDNNHandle_t const | network | ||
| ) |
Returns the metadata for the associated network model.
| [out] | metaData | A pointer to a metadata structure. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getOutputBlobCount | ( | uint32_t *const | count, |
| dwDNNHandle_t const | network | ||
| ) |
Gets the output blob count.
| [out] | count | A pointer to the number of output blobs. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getOutputIndex | ( | uint32_t *const | blobIndex, |
| const char8_t *const | blobName, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the index of an output blob with a given blob name.
| [out] | blobIndex | A pointer to the index of the blob with the given name. |
| [in] | blobName | A pointer to the name of an output blob. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getOutputSize | ( | dwBlobSize *const | blobSize, |
| uint32_t const | blobIndex, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the output blob size at blobIndex.
| [out] | blobSize | A pointer to the where the output blob size is returned. |
| [in] | blobIndex | Specifies the blob index; must be in the range [0 dwDNN_getOutputBlobCount()-1]. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_getOutputTensorProperties | ( | dwDNNTensorProperties *const | tensorProps, |
| uint32_t const | blobIndex, | ||
| dwDNNHandle_t const | network | ||
| ) |
Gets the output tensor properties at blobIndex.
| [out] | tensorProps | Tensor properties. |
| [in] | blobIndex | Specifies the blob index; must be in the range [0 dwDNN_getOutputBlobCount()-1]. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_infer | ( | dwDNNTensorHandle_t *const | outputTensors, |
| uint32_t const | outputTensorCount, | ||
| dwConstDNNTensorHandle_t *const | inputTensors, | ||
| uint32_t const | inputTensorCount, | ||
| dwDNNHandle_t const | network | ||
| ) |
Runs inference pipeline on the given input.
| [out] | outputTensors | Output tensors. |
| [in] | outputTensorCount | Number of output tensors. |
| [in] | inputTensors | Input tensors. |
| [in] | inputTensorCount | Number of input tensors. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_inferRaw | ( | float32_t *const *const | dOutput, |
| const float32_t *const *const | dInput, | ||
| uint32_t const | batchsize, | ||
| dwDNNHandle_t const | network | ||
| ) |
Forwards pass from all input blobs to all output blobs.
| [out] | dOutput | A pointer to an array of pointers to the input blobs in GPU Memory. |
| [in] | dInput | A pointer to an array of pointers to the output blobs in GPU Memory. |
| [in] | batchsize | Batch size for inference. Batch size must be equal or less than the one that was given at the time of model generation. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_inferSIO | ( | float32_t *const | dOutput, |
| const float32_t *const | dInput, | ||
| uint32_t const | batchsize, | ||
| dwDNNHandle_t const | network | ||
| ) |
Forwards pass from the first input blob to the first output blob (a shortcut for a single input - single output network).
| [out] | dOutput | A pointer to the output blob in GPU memory. |
| [in] | dInput | A pointer to the input blob in GPU memory. |
| [in] | batchsize | Batch size for inference. Batch size must be equal or less than the one that was given at the time of model generation. |
| [in] | network | Network handle created with dwDNN_initialize(). |
| DW_API_PUBLIC dwStatus dwDNN_initializeTensorRTFromFile | ( | dwDNNHandle_t *const | network, |
| const char8_t *const | modelFilename, | ||
| const dwDNNPluginConfiguration *const | pluginConfiguration, | ||
| dwProcessorType const | processorType, | ||
| dwContextHandle_t const | context | ||
| ) |
Creates and initializes a TensorRT Network from file.
| [out] | network | A pointer to network handle that will be initialized from parameters. |
| [in] | modelFilename | A pointer to the name of the TensorRT model file. |
| [in] | pluginConfiguration | An optional pointer to plugin configuration for custom layers. |
| [in] | processorType | Processor that the inference should run on. Note that the model must be generated for this processor type. |
| [in] | context | Specifies the handle to the context under which the DNN module is created. |
{
"dataConditionerParams" : {
"meanValue" : [0.0, 0.0, 0.0],
"splitPlanes" : true,
"pixelScaleCoefficient": 1.0,
"ignoreAspectRatio" : false,
"doPerPlaneMeanNormalization" : false
}
"tonemapType" : "none",
"__comment": "tonemapType can be one of {none, agtm}"
}
\ | DW_API_PUBLIC dwStatus dwDNN_initializeTensorRTFromFileWithEngineId | ( | dwDNNHandle_t *const | network, |
| const char8_t *const | modelFilename, | ||
| const dwDNNPluginConfiguration *const | pluginConfiguration, | ||
| dwProcessorType const | processorType, | ||
| uint32_t | engineId, | ||
| dwContextHandle_t const | context | ||
| ) |
Creates and initializes a TensorRT Network from file with DLA Engine ID.
| [out] | network | A pointer to network handle that will be initialized from parameters. |
| [in] | modelFilename | A pointer to the name of the TensorRT model file. |
| [in] | pluginConfiguration | An optional pointer to plugin configuration for custom layers. |
| [in] | processorType | Processor that the inference should run on. Note that the model must be generated for this processor type. |
| [in] | engineId | Specifies the DLA engine id if the processorType is DW_PROCESSOR_TYPE_CUDLA. |
| [in] | context | Specifies the handle to the context under which the DNN module is created. |
| DW_API_PUBLIC dwStatus dwDNN_initializeTensorRTFromMemory | ( | dwDNNHandle_t *const | network, |
| const char8_t *const | modelContent, | ||
| uint32_t const | modelContentSize, | ||
| const dwDNNPluginConfiguration *const | pluginConfiguration, | ||
| dwProcessorType const | processorType, | ||
| dwContextHandle_t const | context | ||
| ) |
Creates and initializes a TensorRT Network from memory.
| [out] | network | A pointer to network handle that is initialized from parameters. |
| [in] | modelContent | A pointer to network content in the memory. |
| [in] | modelContentSize | Specifies the size of network content in memory, in bytes. |
| [in] | pluginConfiguration | An optional pointer to plugin configuration for custom layers. |
| [in] | processorType | Processor that the inference should run on. Note that the model must be generated for this processor type. |
| [in] | context | Specifies a handle to the context under which the DNN module is created. |
| DW_API_PUBLIC dwStatus dwDNN_initializeTensorRTFromMemoryWithEngineId | ( | dwDNNHandle_t *const | network, |
| const char8_t *const | modelContent, | ||
| uint32_t const | modelContentSize, | ||
| const dwDNNPluginConfiguration *const | pluginConfiguration, | ||
| dwProcessorType const | processorType, | ||
| uint32_t | engineId, | ||
| dwContextHandle_t const | context | ||
| ) |
Creates and initializes a TensorRT Network from memory with DLA Engine ID.
| [out] | network | A pointer to network handle that is initialized from parameters. |
| [in] | modelContent | A pointer to network content in the memory. |
| [in] | modelContentSize | Specifies the size of network content in memory, in bytes. |
| [in] | pluginConfiguration | An optional pointer to plugin configuration for custom layers. |
| [in] | processorType | Processor that the inference should run on. Note that the model must be generated for this processor type. |
| [in] | engineId | Specifies the DLA engine id if the processorType is DW_PROCESSOR_TYPE_CUDLA. |
| [in] | context | Specifies a handle to the context under which the DNN module is created. |
| DW_API_PUBLIC dwStatus dwDNN_release | ( | dwDNNHandle_t const | network | ) |
Releases a given network.
| [in] | network | The network handle to release. |
| DW_API_PUBLIC dwStatus dwDNN_reset | ( | dwDNNHandle_t const | network | ) |
Resets a given network.
| [in] | network | Network handle to reset. |
| DW_API_PUBLIC dwStatus dwDNN_setCUDAStream | ( | cudaStream_t const | stream, |
| dwDNNHandle_t const | network | ||
| ) |
Sets the CUDA stream for infer operations.
| [in] | stream | The CUDA stream to be used. Default is the stream 0, resulting in synchronous operations. |
| [in] | network | A handle to the DNN module to set CUDA stream for. |