TRT module to perform various deep learning inference.
Definition at line 137 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.

Public Member Functions | |
| TrtModule () | |
| Construct a TrtModule instance. More... | |
| void | initializeModel (std::function< void(nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int batchSize)> onnxProfileFunc, std::function< void(TrtModule *, const std::vector< int > &sizes)> setRuntimeDimFunc) |
| Create TensorRT inference engine; if engine does not exist, serialize from model. More... | |
| void | createInferEngine () |
| Build a TensorRT engine from the configured network model. More... | |
| void | parseOnnxModel (nvinfer1::INetworkDefinition &network, nvinfer1::ILogger &logger, std::unique_ptr< nvonnxparser::IParser > &parser) |
| Load ONNX model into network. More... | |
| nvinfer1::ICudaEngine * | decodeTltModel (nvinfer1::IBuilder *const builder, nvinfer1::IBuilderConfig *const config) |
| Decode TAO encrypted model. More... | |
| bool | loadTRTEngine () |
| Load reid TRT engine. More... | |
| void | submitInput (std::vector< void * > &bindings, const std::vector< int > &batchSize, cudaStream_t &cuStream) |
| Submit network input for inference. More... | |
| void | printEngineInfo () |
| Print TRT engine information. More... | |
| void | setCudaStream (cudaStream_t cuStream) |
| Set the CUDA stream used for TensorRT inference. More... | |
| TrtModule () | |
| Construct a TrtModule instance. More... | |
| void | initializeModel (std::function< void(nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int batchSize)> onnxProfileFunc, std::function< void(TrtModule *, const std::vector< int > &sizes)> setRuntimeDimFunc) |
| Create TensorRT inference engine; if engine does not exist, serialize from model. More... | |
| void | createInferEngine () |
| Build a TensorRT engine from the configured network model. More... | |
| void | parseOnnxModel (nvinfer1::INetworkDefinition &network, nvinfer1::ILogger &logger, std::unique_ptr< nvonnxparser::IParser > &parser) |
| Load ONNX model into network. More... | |
| nvinfer1::ICudaEngine * | decodeTltModel (nvinfer1::IBuilder *const builder, nvinfer1::IBuilderConfig *const config) |
| Decode TAO encrypted model. More... | |
| bool | loadTRTEngine () |
| Load reid TRT engine. More... | |
| void | submitInput (std::vector< void * > &bindings, const std::vector< int > &batchSize, cudaStream_t &cuStream) |
| Submit network input for inference. More... | |
| void | printEngineInfo () |
| Print TRT engine information. More... | |
| void | setCudaStream (cudaStream_t cuStream) |
| Set the CUDA stream used for TensorRT inference. More... | |
Data Fields | |
| TRTConfigParams | m_params |
| TRT module config. More... | |
| std::shared_ptr< nvinfer1::ICudaEngine > | m_engine |
| TensorRT engine for reid. More... | |
| std::shared_ptr< nvinfer1::IExecutionContext > | m_context |
| TensorRT execution context. More... | |
| cudaStream_t | m_cuStream |
| Cuda stream to run all GPU tasks. More... | |
Protected Attributes | |
| std::shared_ptr< nvinfer1::IRuntime > | m_runtime |
| TensorRT runtime used to deserialize engines. More... | |
| std::shared_ptr< TrackerInt8EntropyCalibrator > | m_calibrator |
| TensorRT int8 calibrator. More... | |
| std::string | m_absModelFilePath |
| Absolute model file path. More... | |
| std::function< void(nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int batchSize)> | m_onnxProfileFunc |
| Custom function to perform profiling for dynamic shapes required by TRT. More... | |
| std::function< void(TrtModule *, const std::vector< int > &)> | m_setRuntimeDimFunc |
| Custom function to set runtime dimension required by TRT. More... | |
| TrtModule::TrtModule | ( | ) |
Construct a TrtModule instance.
| TrtModule::TrtModule | ( | ) |
Construct a TrtModule instance.
| void TrtModule::createInferEngine | ( | ) |
Build a TensorRT engine from the configured network model.
| void TrtModule::createInferEngine | ( | ) |
Build a TensorRT engine from the configured network model.
| nvinfer1::ICudaEngine* TrtModule::decodeTltModel | ( | nvinfer1::IBuilder *const | builder, |
| nvinfer1::IBuilderConfig *const | config | ||
| ) |
Decode TAO encrypted model.
| [in] | builder | TensorRT engine builder. |
| [in] | config | TensorRT builder configuration. |
| nvinfer1::ICudaEngine* TrtModule::decodeTltModel | ( | nvinfer1::IBuilder *const | builder, |
| nvinfer1::IBuilderConfig *const | config | ||
| ) |
Decode TAO encrypted model.
| [in] | builder | TensorRT engine builder. |
| [in] | config | TensorRT builder configuration. |
| void TrtModule::initializeModel | ( | std::function< void(nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int batchSize)> | onnxProfileFunc, |
| std::function< void(TrtModule *, const std::vector< int > &sizes)> | setRuntimeDimFunc | ||
| ) |
Create TensorRT inference engine; if engine does not exist, serialize from model.
| [in] | onnxProfileFunc | Callback that sets the ONNX optimization profile before the engine is built. |
| [in] | setRuntimeDimFunc | Callback that sets runtime dimensions for dynamic input shapes. |
| void TrtModule::initializeModel | ( | std::function< void(nvinfer1::INetworkDefinition *network, nvinfer1::IBuilder *builder, nvinfer1::IBuilderConfig *config, int batchSize)> | onnxProfileFunc, |
| std::function< void(TrtModule *, const std::vector< int > &sizes)> | setRuntimeDimFunc | ||
| ) |
Create TensorRT inference engine; if engine does not exist, serialize from model.
| [in] | onnxProfileFunc | Callback that sets the ONNX optimization profile before the engine is built. |
| [in] | setRuntimeDimFunc | Callback that sets runtime dimensions for dynamic input shapes. |
| bool TrtModule::loadTRTEngine | ( | ) |
Load reid TRT engine.
| bool TrtModule::loadTRTEngine | ( | ) |
Load reid TRT engine.
| void TrtModule::parseOnnxModel | ( | nvinfer1::INetworkDefinition & | network, |
| nvinfer1::ILogger & | logger, | ||
| std::unique_ptr< nvonnxparser::IParser > & | parser | ||
| ) |
Load ONNX model into network.
| [out] | network | Network with ONNX model loaded. |
| [in] | logger | TensorRT logger. |
| [out] | parser | ONNX parser to populate. |
| void TrtModule::parseOnnxModel | ( | nvinfer1::INetworkDefinition & | network, |
| nvinfer1::ILogger & | logger, | ||
| std::unique_ptr< nvonnxparser::IParser > & | parser | ||
| ) |
Load ONNX model into network.
| [out] | network | Network with ONNX model loaded. |
| [in] | logger | TensorRT logger. |
| [out] | parser | ONNX parser to populate. |
| void TrtModule::printEngineInfo | ( | ) |
Print TRT engine information.
| void TrtModule::printEngineInfo | ( | ) |
Print TRT engine information.
|
inline |
Set the CUDA stream used for TensorRT inference.
| [in] | cuStream | CUDA stream used for the operation. |
Definition at line 198 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
References m_cuStream.
|
inline |
Set the CUDA stream used for TensorRT inference.
| [in] | cuStream | CUDA stream used for the operation. |
Definition at line 198 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
References m_cuStream.
| void TrtModule::submitInput | ( | std::vector< void * > & | bindings, |
| const std::vector< int > & | batchSize, | ||
| cudaStream_t & | cuStream | ||
| ) |
Submit network input for inference.
| [in] | bindings | Input and output tensor addresses for the network. |
| [in] | batchSize | Runtime batch size for each dynamic input. |
| [in] | cuStream | CUDA stream that runs the GPU work. |
| void TrtModule::submitInput | ( | std::vector< void * > & | bindings, |
| const std::vector< int > & | batchSize, | ||
| cudaStream_t & | cuStream | ||
| ) |
Submit network input for inference.
| [in] | bindings | Input and output tensor addresses for the network. |
| [in] | batchSize | Runtime batch size for each dynamic input. |
| [in] | cuStream | CUDA stream that runs the GPU work. |
|
protected |
Absolute model file path.
Definition at line 207 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
|
protected |
TensorRT int8 calibrator.
Definition at line 206 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
| std::shared_ptr< nvinfer1::IExecutionContext > TrtModule::m_context |
TensorRT execution context.
Definition at line 202 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
Referenced by setRuntimeDim4EVSamDecoder(), setRuntimeDim4EVSamEncoder(), setRuntimeDim4NanoSamDecoder(), setRuntimeDim4Sam2MaskDecoder(), setRuntimeDim4Sam2MemAttn(), and setRuntimeDim4Sam2MemEncoder().
| cudaStream_t TrtModule::m_cuStream |
Cuda stream to run all GPU tasks.
Definition at line 203 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
Referenced by setCudaStream(), setRuntimeDim4EVSamDecoder(), setRuntimeDim4NanoSamDecoder(), setRuntimeDim4Sam2MaskDecoder(), setRuntimeDim4Sam2MemAttn(), and setRuntimeDim4Sam2MemEncoder().
| std::shared_ptr< nvinfer1::ICudaEngine > TrtModule::m_engine |
TensorRT engine for reid.
Definition at line 201 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
Referenced by setRuntimeDim4EVSamDecoder(), setRuntimeDim4EVSamEncoder(), setRuntimeDim4NanoSamDecoder(), setRuntimeDim4Sam2MaskDecoder(), setRuntimeDim4Sam2MemAttn(), and setRuntimeDim4Sam2MemEncoder().
|
protected |
Custom function to perform profiling for dynamic shapes required by TRT.
Definition at line 210 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
| TRTConfigParams TrtModule::m_params |
TRT module config.
Definition at line 198 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
|
protected |
TensorRT runtime used to deserialize engines.
Definition at line 205 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.
|
protected |
Custom function to set runtime dimension required by TRT.
Definition at line 211 of file sources/libs/nvmultiobjecttracker/include/modules/FrameTransform/trtModule.hpp.