TensorRT 8.6.1
nvinfer1::IEngineInspector Class Reference

An engine inspector which prints out the layer information of an engine or an execution context. More...

#include <NvInferRuntime.h>

Inheritance diagram for nvinfer1::IEngineInspector:
nvinfer1::INoCopy

Public Member Functions

virtual ~IEngineInspector () noexcept=default
 
bool setExecutionContext (IExecutionContext const *context) noexcept
 Set an execution context as the inspection source. More...
 
IExecutionContext const * getExecutionContext () const noexcept
 Get the context currently being inspected. More...
 
char const * getLayerInformation (int32_t layerIndex, LayerInformationFormat format) const noexcept
 Get a string describing the information about a specific layer in the current engine or the execution context. More...
 
char const * getEngineInformation (LayerInformationFormat format) const noexcept
 Get a string describing the information about all the layers in the current engine or the execution context. More...
 
void setErrorRecorder (IErrorRecorder *recorder) noexcept
 Set the ErrorRecorder for this interface. More...
 
IErrorRecordergetErrorRecorder () const noexcept
 Get the ErrorRecorder assigned to this interface. More...
 

Protected Attributes

apiv::VEngineInspector * mImpl
 

Additional Inherited Members

- Protected Member Functions inherited from nvinfer1::INoCopy
 INoCopy ()=default
 
virtual ~INoCopy ()=default
 
 INoCopy (INoCopy const &other)=delete
 
INoCopyoperator= (INoCopy const &other)=delete
 
 INoCopy (INoCopy &&other)=delete
 
INoCopyoperator= (INoCopy &&other)=delete
 

Detailed Description

An engine inspector which prints out the layer information of an engine or an execution context.

The amount of printed information depends on the profiling verbosity setting of the builder config when the engine is built:

Warning
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
See also
ProfilingVerbosity, IEngineInspector

Constructor & Destructor Documentation

◆ ~IEngineInspector()

virtual nvinfer1::IEngineInspector::~IEngineInspector ( )
virtualdefaultnoexcept

Member Function Documentation

◆ getEngineInformation()

char const * nvinfer1::IEngineInspector::getEngineInformation ( LayerInformationFormat  format) const
inlinenoexcept

Get a string describing the information about all the layers in the current engine or the execution context.

Parameters
formatthe format the layer information should be printed in.
Returns
A null-terminated C-style string describing the information about all the layers in the current engine or the execution context.
Warning
The content of the returned string may change when another execution context has been set, or when another getLayerInformation() or getEngineInformation() has been called.
In a multi-threaded environment, this function must be protected from other threads changing the inspection source. If the inspection source changes, the data that is being pointed to can change. Copy the string to another buffer before releasing the lock in order to guarantee consistency.
See also
LayerInformationFormat

◆ getErrorRecorder()

IErrorRecorder * nvinfer1::IEngineInspector::getErrorRecorder ( ) const
inlinenoexcept

Get the ErrorRecorder assigned to this interface.

Retrieves the assigned error recorder object for the given class. A nullptr will be returned if an error handler has not been set.

Returns
A pointer to the IErrorRecorder object that has been registered.
See also
setErrorRecorder()

◆ getExecutionContext()

IExecutionContext const * nvinfer1::IEngineInspector::getExecutionContext ( ) const
inlinenoexcept

Get the context currently being inspected.

Returns
The pointer to the context currently being inspected.
See also
setExecutionContext()

◆ getLayerInformation()

char const * nvinfer1::IEngineInspector::getLayerInformation ( int32_t  layerIndex,
LayerInformationFormat  format 
) const
inlinenoexcept

Get a string describing the information about a specific layer in the current engine or the execution context.

Parameters
layerIndexthe index of the layer. It must lie in range [0, engine.getNbLayers()).
formatthe format the layer information should be printed in.
Returns
A null-terminated C-style string describing the information about a specific layer in the current engine or the execution context.
Warning
The content of the returned string may change when another execution context has been set, or when another getLayerInformation() or getEngineInformation() has been called.
In a multi-threaded environment, this function must be protected from other threads changing the inspection source. If the inspection source changes, the data that is being pointed to can change. Copy the string to another buffer before releasing the lock in order to guarantee consistency.
See also
LayerInformationFormat

◆ setErrorRecorder()

void nvinfer1::IEngineInspector::setErrorRecorder ( IErrorRecorder recorder)
inlinenoexcept

Set the ErrorRecorder for this interface.

Assigns the ErrorRecorder to this interface. The ErrorRecorder will track all errors during execution. This function will call incRefCount of the registered ErrorRecorder at least once. Setting recorder to nullptr unregisters the recorder with the interface, resulting in a call to decRefCount if a recorder has been registered.

If an error recorder is not set, messages will be sent to the global log stream.

Parameters
recorderThe error recorder to register with this interface.
See also
getErrorRecorder()

◆ setExecutionContext()

bool nvinfer1::IEngineInspector::setExecutionContext ( IExecutionContext const *  context)
inlinenoexcept

Set an execution context as the inspection source.

Setting the execution context and specifying all the input shapes allows the inspector to calculate concrete dimensions for any dynamic shapes and display their format information. Otherwise, values dependent on input shapes will be displayed as -1 and format information will not be shown.

Passing nullptr will remove any association with an execution context.

Returns
Whether the action succeeds.

Member Data Documentation

◆ mImpl

apiv::VEngineInspector* nvinfer1::IEngineInspector::mImpl
protected

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