API
 
Loading...
Searching...
No Matches
TensorrtEngine Class Reference

#include <trt_engine.hpp>

Collaboration diagram for TensorrtEngine:
Collaboration graph

Public Member Functions

 TensorrtEngine ()
 
bool build (std::string dataDirs, std::string onnxFileName, std::string engineDirs, std::string engineName, bool rebuildEngine)
 
bool load (std::string enginePath)
 
bool infer (float *inputData)
 
bool initializeBuffer ()
 
float * getOutput ()
 
int32_t getOutputSize ()
 

Public Attributes

BufferManagerbuffers
 

Private Member Functions

bool constructNetwork (std::unique_ptr< nvinfer1::IBuilder > &builder, std::unique_ptr< nvinfer1::INetworkDefinition > &network, std::unique_ptr< nvinfer1::IBuilderConfig > &config, std::unique_ptr< nvonnxparser::IParser > &parser, std::string onnxFileName, std::string dataDirs)
 

Private Attributes

std::shared_ptr< nvinfer1::IRuntime > mRuntime
 
std::shared_ptr< nvinfer1::ICudaEngine > mEngine
 
std::shared_ptr< nvinfer1::IExecutionContext > context
 
int32_t batch {1}
 
int32_t inputC {0}
 
int32_t inputH {0}
 
int32_t inputW {0}
 
int32_t outputSize {0}
 
const char * inputName
 
const char * outputName
 

Detailed Description

Definition at line 22 of file trt_engine.hpp.

Constructor & Destructor Documentation

◆ TensorrtEngine()

TensorrtEngine::TensorrtEngine ( )
inline

Definition at line 25 of file trt_engine.hpp.

Member Function Documentation

◆ build()

bool TensorrtEngine::build ( std::string  dataDirs,
std::string  onnxFileName,
std::string  engineDirs,
std::string  engineName,
bool  rebuildEngine 
)

Definition at line 65 of file trt_engine.hpp.

◆ constructNetwork()

bool TensorrtEngine::constructNetwork ( std::unique_ptr< nvinfer1::IBuilder > &  builder,
std::unique_ptr< nvinfer1::INetworkDefinition > &  network,
std::unique_ptr< nvinfer1::IBuilderConfig > &  config,
std::unique_ptr< nvonnxparser::IParser > &  parser,
std::string  onnxFileName,
std::string  dataDirs 
)
private

Definition at line 230 of file trt_engine.hpp.

Referenced by build().

◆ getOutput()

float * TensorrtEngine::getOutput ( )

Definition at line 304 of file trt_engine.hpp.

◆ getOutputSize()

int32_t TensorrtEngine::getOutputSize ( )
inline

Definition at line 41 of file trt_engine.hpp.

◆ infer()

bool TensorrtEngine::infer ( float *  inputData)

Definition at line 269 of file trt_engine.hpp.

◆ initializeBuffer()

bool TensorrtEngine::initializeBuffer ( )

Definition at line 249 of file trt_engine.hpp.

◆ load()

bool TensorrtEngine::load ( std::string  enginePath)

Definition at line 177 of file trt_engine.hpp.

Referenced by build().

Member Data Documentation

◆ batch

int32_t TensorrtEngine::batch {1}
private

Definition at line 51 of file trt_engine.hpp.

◆ buffers

BufferManager* TensorrtEngine::buffers

Definition at line 43 of file trt_engine.hpp.

Referenced by getOutput(), infer(), and initializeBuffer().

◆ context

std::shared_ptr<nvinfer1::IExecutionContext> TensorrtEngine::context
private

Definition at line 49 of file trt_engine.hpp.

Referenced by infer(), and initializeBuffer().

◆ inputC

int32_t TensorrtEngine::inputC {0}
private

Definition at line 52 of file trt_engine.hpp.

Referenced by build(), infer(), and load().

◆ inputH

int32_t TensorrtEngine::inputH {0}
private

Definition at line 53 of file trt_engine.hpp.

Referenced by build(), infer(), and load().

◆ inputName

const char* TensorrtEngine::inputName
private

Definition at line 56 of file trt_engine.hpp.

Referenced by build(), infer(), and load().

◆ inputW

int32_t TensorrtEngine::inputW {0}
private

Definition at line 54 of file trt_engine.hpp.

Referenced by build(), infer(), and load().

◆ mEngine

std::shared_ptr<nvinfer1::ICudaEngine> TensorrtEngine::mEngine
private

Definition at line 48 of file trt_engine.hpp.

Referenced by build(), initializeBuffer(), and load().

◆ mRuntime

std::shared_ptr<nvinfer1::IRuntime> TensorrtEngine::mRuntime
private

Definition at line 47 of file trt_engine.hpp.

Referenced by build(), and load().

◆ outputName

const char* TensorrtEngine::outputName
private

Definition at line 57 of file trt_engine.hpp.

Referenced by build(), getOutput(), and load().

◆ outputSize

int32_t TensorrtEngine::outputSize {0}
private

Definition at line 55 of file trt_engine.hpp.

Referenced by build(), getOutputSize(), and load().


The documentation for this class was generated from the following file: