TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
SampleConfig Class Referenceabstract
Inheritance diagram for SampleConfig:
Collaboration diagram for SampleConfig:

Public Types

enum  InputDataFormat : int {
  InputDataFormat::kASCII = 0,
  InputDataFormat::kPPM = 1
}
 
typedef int Verbosity
 Defines Verbosity level. More...
 

Public Member Functions

 SampleConfig ()
 
void setModelDtype (const nvinfer1::DataType mdt)
 Set the Model Data Type. More...
 
nvinfer1::DataType getModelDtype () const
 Get the Model Data Type. More...
 
bool getTF32 () const
 
void setTF32 (bool enabled)
 
const char * getModelFileName () const
 Get the Model FileName. More...
 
void setModelFileName (const char *onnxFilename)
 Set the Model File Name. More...
 
Verbosity getVerbosityLevel () const
 Get the Verbosity Level. More...
 
void addVerbosity ()
 Increase the Verbosity Level. More...
 
void reduceVerbosity ()
 Decrease verbosity Level. More...
 
virtual void setVerbosityLevel (Verbosity v)
 
const char * getEngineFileName () const
 
void setEngineFileName (const char *engineFilename)
 
const char * getTextFileName () const
 Returns the File Name of the Network Description as a Text File. More...
 
void setTextFileName (const char *textFilename)
 Set the File Name of the Network Description as a Text File. More...
 
const char * getFullTextFileName () const
 Get the File Name of the Network Description as a Text File, including the weights. More...
 
void setFullTextFileName (const char *fullTextFilename)
 Set the File Name of the Network Description as a Text File, including the weights. More...
 
bool getPrintLayerInfo () const
 Get whether the layer information will be printed. More...
 
const char * getImageFileName () const
 < set Image file name (PPM or ASCII) More...
 
void setImageFileName (const char *imageFilename)
 
const char * getReferenceFileName () const
 
void setReferenceFileName (const char *referenceFilename)
 
const char * getOutputFileName () const
 < specifies the file to save the results More...
 
void setOutputFileName (const char *outputFilename)
 
void setCalibrationFileName (const char *calibrationFilename)
 
uint64_t getTopK () const
 
float getFailurePercentage () const
 
void setFailurePercentage (float f)
 
float getTolerance () const
 
void setTolerance (float t)
 
bool isDebug () const
 
void destroy ()
 Destroy IOnnxConfig object. More...
 
virtual void setVerbosityLevel (Verbosity)=0
 Set to specific verbosity Level. More...
 
virtual void setPrintLayerInfo (bool)=0
 Set whether the layer information will be printed. More...
 

Protected Member Functions

 ~SampleConfig ()
 

Private Attributes

std::string mModelFilename
 
std::string mEngineFilename
 
std::string mTextFilename
 
std::string mFullTextFilename
 
std::string mImageFilename
 
std::string mReferenceFilename
 
std::string mOutputFilename
 
std::string mCalibrationFilename
 
int64_t mLabel {-1}
 
int64_t mMaxBatchSize {32}
 
int64_t mMaxWorkspaceSize {1 * 1024 * 1024 * 1024}
 
int64_t mCalibBatchSize {0}
 
int64_t mMaxNCalibBatch {0}
 
int64_t mFirstCalibBatch {0}
 
int64_t mUseDLACore {-1}
 
nvinfer1::DataType mModelDtype {nvinfer1::DataType::kFLOAT}
 
bool mTF32 {true}
 
Verbosity mVerbosity {static_cast<int>(nvinfer1::ILogger::Severity::kWARNING)}
 
bool mPrintLayercInfo {false}
 
bool mDebugBuilder {false}
 
InputDataFormat mInputDataFormat {InputDataFormat::kASCII}
 
uint64_t mTopK {0}
 
float mFailurePercentage {-1.0f}
 
float mTolerance {0.0f}
 

Member Typedef Documentation

◆ Verbosity

Defines Verbosity level.

Member Enumeration Documentation

◆ InputDataFormat

Enumerator
kASCII 
kPPM 

Constructor & Destructor Documentation

◆ SampleConfig()

SampleConfig::SampleConfig ( )
inline
Here is the call graph for this function:

◆ ~SampleConfig()

SampleConfig::~SampleConfig ( )
inlineprotected
Here is the call graph for this function:

Member Function Documentation

◆ setModelDtype()

void SampleConfig::setModelDtype ( const nvinfer1::DataType  )
inlinevirtual

Set the Model Data Type.

Sets the Model DataType, one of the following: float -d 32 (default), half precision -d 16, and int8 -d 8 data types.

See also
getModelDtype()

Implements nvonnxparser::IOnnxConfig.

◆ getModelDtype()

nvinfer1::DataType SampleConfig::getModelDtype ( ) const
inlinevirtual

Get the Model Data Type.

Returns
DataType nvinfer1::DataType
See also
setModelDtype() and #DataType

Implements nvonnxparser::IOnnxConfig.

◆ getTF32()

bool SampleConfig::getTF32 ( ) const
inline

◆ setTF32()

void SampleConfig::setTF32 ( bool  enabled)
inline

◆ getModelFileName()

const char* SampleConfig::getModelFileName ( ) const
inlinevirtual

Get the Model FileName.

Returns
Return the Model Filename, as a pointer to a NULL-terminated character sequence.
See also
setModelFileName()

Implements nvonnxparser::IOnnxConfig.

◆ setModelFileName()

void SampleConfig::setModelFileName ( const char *  onnxFilename)
inlinevirtual

Set the Model File Name.

The Model File name contains the Network Description in ONNX pb format.

This method copies the name string.

Parameters
onnxFilenameThe name.
See also
getModelFileName()

Implements nvonnxparser::IOnnxConfig.

◆ getVerbosityLevel()

Verbosity SampleConfig::getVerbosityLevel ( ) const
inlinevirtual

Get the Verbosity Level.

Returns
The Verbosity Level.
See also
addVerbosity(), reduceVerbosity()

Implements nvonnxparser::IOnnxConfig.

◆ addVerbosity()

void SampleConfig::addVerbosity ( )
inlinevirtual

Increase the Verbosity Level.

Returns
The Verbosity Level.
See also
addVerbosity(), reduceVerbosity(), setVerbosity(Verbosity) Increase verbosity Level.

Implements nvonnxparser::IOnnxConfig.

◆ reduceVerbosity()

void SampleConfig::reduceVerbosity ( )
inlinevirtual

Decrease verbosity Level.

Implements nvonnxparser::IOnnxConfig.

◆ setVerbosityLevel() [1/2]

virtual void SampleConfig::setVerbosityLevel ( Verbosity  v)
inlinevirtual

◆ getEngineFileName()

const char* SampleConfig::getEngineFileName ( ) const
inline

◆ setEngineFileName()

void SampleConfig::setEngineFileName ( const char *  engineFilename)
inline

◆ getTextFileName()

const char* SampleConfig::getTextFileName ( ) const
inlinevirtual

Returns the File Name of the Network Description as a Text File.

Returns
Return the name of the file containing the network description converted to a plain text, used for debugging purposes.
See also
setTextFilename()

Implements nvonnxparser::IOnnxConfig.

◆ setTextFileName()

void SampleConfig::setTextFileName ( const char *  textFileName)
inlinevirtual

Set the File Name of the Network Description as a Text File.

This API allows setting a file name for the network description in plain text, equivalent of the ONNX protobuf.

This method copies the name string.

Parameters
textFileNameName of the file.
See also
getTextFilename()

Implements nvonnxparser::IOnnxConfig.

◆ getFullTextFileName()

const char* SampleConfig::getFullTextFileName ( ) const
inlinevirtual

Get the File Name of the Network Description as a Text File, including the weights.

Returns
Return the name of the file containing the network description converted to a plain text, used for debugging purposes.
See also
setFullTextFilename()

Implements nvonnxparser::IOnnxConfig.

◆ setFullTextFileName()

void SampleConfig::setFullTextFileName ( const char *  fullTextFileName)
inlinevirtual

Set the File Name of the Network Description as a Text File, including the weights.

This API allows setting a file name for the network description in plain text, equivalent of the ONNX protobuf.

This method copies the name string.

Parameters
fullTextFileNameName of the file.
See also
getFullTextFilename()

Implements nvonnxparser::IOnnxConfig.

◆ getPrintLayerInfo()

bool SampleConfig::getPrintLayerInfo ( ) const
inlinevirtual

Get whether the layer information will be printed.

Returns
Returns whether the layer information will be printed.
See also
setPrintLayerInfo()

Implements nvonnxparser::IOnnxConfig.

◆ getImageFileName()

const char* SampleConfig::getImageFileName ( ) const
inline

< set Image file name (PPM or ASCII)

◆ setImageFileName()

void SampleConfig::setImageFileName ( const char *  imageFilename)
inline
Parameters
imageFilenameget the Image file name

◆ getReferenceFileName()

const char* SampleConfig::getReferenceFileName ( ) const
inline

◆ setReferenceFileName()

void SampleConfig::setReferenceFileName ( const char *  referenceFilename)
inline
Parameters
referenceFilenameset reference file name

◆ getOutputFileName()

const char* SampleConfig::getOutputFileName ( ) const
inline

< specifies the file to save the results

◆ setOutputFileName()

void SampleConfig::setOutputFileName ( const char *  outputFilename)
inline
Parameters
outputFilenameget the output file name

◆ setCalibrationFileName()

void SampleConfig::setCalibrationFileName ( const char *  calibrationFilename)
inline
Parameters
calibrationFilenameget the int 8 calibration list file name

◆ getTopK()

uint64_t SampleConfig::getTopK ( ) const
inline

◆ getFailurePercentage()

float SampleConfig::getFailurePercentage ( ) const
inline

◆ setFailurePercentage()

void SampleConfig::setFailurePercentage ( float  f)
inline

◆ getTolerance()

float SampleConfig::getTolerance ( ) const
inline

◆ setTolerance()

void SampleConfig::setTolerance ( float  t)
inline

◆ isDebug()

bool SampleConfig::isDebug ( ) const
inline
Here is the caller graph for this function:

◆ destroy()

void SampleConfig::destroy ( )
inlinevirtual

Destroy IOnnxConfig object.

Implements nvonnxparser::IOnnxConfig.

◆ setVerbosityLevel() [2/2]

virtual void nvonnxparser::IOnnxConfig::setVerbosityLevel ( Verbosity  )
pure virtualinherited

Set to specific verbosity Level.

Implemented in ParserOnnxConfig.

◆ setPrintLayerInfo()

virtual void nvonnxparser::IOnnxConfig::setPrintLayerInfo ( bool  )
pure virtualinherited

Set whether the layer information will be printed.

See also
getPrintLayerInfo()

Member Data Documentation

◆ mModelFilename

std::string SampleConfig::mModelFilename
private

◆ mEngineFilename

std::string SampleConfig::mEngineFilename
private

◆ mTextFilename

std::string SampleConfig::mTextFilename
private

◆ mFullTextFilename

std::string SampleConfig::mFullTextFilename
private

◆ mImageFilename

std::string SampleConfig::mImageFilename
private

◆ mReferenceFilename

std::string SampleConfig::mReferenceFilename
private

◆ mOutputFilename

std::string SampleConfig::mOutputFilename
private

◆ mCalibrationFilename

std::string SampleConfig::mCalibrationFilename
private

◆ mLabel

int64_t SampleConfig::mLabel {-1}
private

◆ mMaxBatchSize

int64_t SampleConfig::mMaxBatchSize {32}
private

◆ mMaxWorkspaceSize

int64_t SampleConfig::mMaxWorkspaceSize {1 * 1024 * 1024 * 1024}
private

◆ mCalibBatchSize

int64_t SampleConfig::mCalibBatchSize {0}
private

◆ mMaxNCalibBatch

int64_t SampleConfig::mMaxNCalibBatch {0}
private

◆ mFirstCalibBatch

int64_t SampleConfig::mFirstCalibBatch {0}
private

◆ mUseDLACore

int64_t SampleConfig::mUseDLACore {-1}
private

◆ mModelDtype

nvinfer1::DataType SampleConfig::mModelDtype {nvinfer1::DataType::kFLOAT}
private

◆ mTF32

bool SampleConfig::mTF32 {true}
private

◆ mVerbosity

Verbosity SampleConfig::mVerbosity {static_cast<int>(nvinfer1::ILogger::Severity::kWARNING)}
private

◆ mPrintLayercInfo

bool SampleConfig::mPrintLayercInfo {false}
private

◆ mDebugBuilder

bool SampleConfig::mDebugBuilder {false}
private

◆ mInputDataFormat

InputDataFormat SampleConfig::mInputDataFormat {InputDataFormat::kASCII}
private

◆ mTopK

uint64_t SampleConfig::mTopK {0}
private

◆ mFailurePercentage

float SampleConfig::mFailurePercentage {-1.0f}
private

◆ mTolerance

float SampleConfig::mTolerance {0.0f}
private

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