TensorRT 10.8.0
nvinfer1::IEngineInspector 类参考

引擎检查器,用于打印引擎或执行上下文的层信息。 更多...

#include <NvInferRuntime.h>

nvinfer1::IEngineInspector 的继承关系图
nvinfer1::INoCopy

公共成员函数

virtual ~IEngineInspector () noexcept=default
 
bool setExecutionContext (IExecutionContext const *context) noexcept
 设置执行上下文作为检查源。 更多...
 
IExecutionContext const * getExecutionContext () const noexcept
 获取当前正在检查的上下文。 更多...
 
char const * getLayerInformation (int32_t layerIndex, LayerInformationFormat format) const noexcept
 获取描述当前引擎或执行上下文中特定层信息的字符串。 更多...
 
char const * getEngineInformation (LayerInformationFormat format) const noexcept
 获取描述当前引擎或执行上下文中所有层信息的字符串。 更多...
 
void setErrorRecorder (IErrorRecorder *recorder) noexcept
 为此接口设置 ErrorRecorder。 更多...
 
IErrorRecordergetErrorRecorder () const noexcept
 获取分配给此接口的 ErrorRecorder。 更多...
 

受保护的属性

apiv::VEngineInspector * mImpl
 

附加的继承成员

- 继承自 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
 

详细描述

引擎检查器,用于打印引擎或执行上下文的层信息。

打印信息的量取决于构建引擎时构建器配置文件的 profiling verbosity 设置

警告
不要从此类继承,这样做会破坏 API 和 ABI 的向前兼容性。
另请参阅
ProfilingVerbosity, IEngineInspector

构造函数 & 析构函数文档

◆ ~IEngineInspector()

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

成员函数文档

◆ getEngineInformation()

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

获取描述当前引擎或执行上下文中所有层信息的字符串。

参数
format层信息应打印成的格式。
返回值
一个以 null 结尾的 C 风格字符串,描述当前引擎或执行上下文中所有层的信息。
警告
当设置了另一个执行上下文,或者调用了另一个 getLayerInformation()getEngineInformation() 时,返回字符串的内容可能会更改。
在多线程环境中,必须保护此函数免受其他线程更改检查源的影响。如果检查源更改,则正在指向的数据可能会更改。在释放锁之前将字符串复制到另一个缓冲区,以保证一致性。
另请参阅
LayerInformationFormat

◆ getErrorRecorder()

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

获取分配给此接口的 ErrorRecorder。

检索给定类别的已分配错误记录器对象。如果未设置错误处理程序,则将返回 nullptr。

返回值
指向已注册的 IErrorRecorder 对象的指针。
另请参阅
setErrorRecorder()

◆ getExecutionContext()

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

获取当前正在检查的上下文。

返回值
指向当前正在检查的上下文的指针。
另请参阅
setExecutionContext()

◆ getLayerInformation()

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

获取描述当前引擎或执行上下文中特定层信息的字符串。

参数
layerIndex层的索引。它必须在范围 [0, engine.getNbLayers()) 内。
format层信息应打印成的格式。
返回值
一个以 null 结尾的 C 风格字符串,描述当前引擎或执行上下文中特定层的信息。
警告
当设置了另一个执行上下文,或者调用了另一个 getLayerInformation()getEngineInformation() 时,返回字符串的内容可能会更改。
在多线程环境中,必须保护此函数免受其他线程更改检查源的影响。如果检查源更改,则正在指向的数据可能会更改。在释放锁之前将字符串复制到另一个缓冲区,以保证一致性。
另请参阅
LayerInformationFormat

◆ setErrorRecorder()

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

为此接口设置 ErrorRecorder。

将 ErrorRecorder 分配给此接口。ErrorRecorder 将跟踪执行期间的所有错误。此函数将至少调用一次已注册 ErrorRecorder 的 incRefCount。将 recorder 设置为 nullptr 将取消注册接口的记录器,如果已注册记录器,则会导致调用 decRefCount。

如果未设置错误记录器,消息将发送到全局日志流。

参数
recorder要向此接口注册的错误记录器。
另请参阅
getErrorRecorder()

◆ setExecutionContext()

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

设置执行上下文作为检查源。

设置执行上下文并指定所有输入形状允许检查器计算任何动态形状的具体维度并显示其格式信息。否则,依赖于输入形状的值将显示为 -1,并且不会显示格式信息。

传递 nullptr 将删除与执行上下文的任何关联。

返回值
操作是否成功。

成员数据文档

◆ mImpl

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

此类文档的生成文件为:

  版权所有 © 2024 NVIDIA Corporation
  隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 无障碍访问 | 公司政策 | 产品安全 | 联系方式