Table of Contents

Class TensorRtEnvironmentProbe

Namespace
JYPPX.TensorRtSharp
Assembly
JYPPX.TensorRtSharp.dll

Queries the current bridge state without requiring TensorRT inference to succeed. 在不要求 TensorRT 推理成功的前提下查询当前 bridge 状态。

public static class TensorRtEnvironmentProbe
Inheritance
TensorRtEnvironmentProbe
Inherited Members

Methods

GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability)

Gets a read-only snapshot of TensorRT's builder capability plugin registry. 获取 TensorRT builder capability plugin registry 的只读快照。

public static TensorRtPluginRegistryInventory GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

Returns

TensorRtPluginRegistryInventory

A builder capability plugin registry inventory snapshot. builder capability plugin registry inventory 快照。

Remarks

This method queries getBuilderPluginRegistry for the requested engine capability. It does not create plugins, register plugins, unregister plugins, initialize plugin libraries, or take ownership of creator objects. Creator identity, interface info, and field metadata are copied into managed value objects. 该方法会针对请求的 engine capability 查询 getBuilderPluginRegistry;不会创建 plugin、注册或注销 plugin、初始化 plugin library,也不会接管 creator 对象所有权。 Creator 标识、interface 信息和字段元数据会复制到托管值对象中。

GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability, bool)

Gets a builder capability plugin registry snapshot with optional creator-field collection. 获取 builder capability plugin registry 快照,并可选择是否采集 creator 字段。

public static TensorRtPluginRegistryInventory GetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability, bool includeCreatorFields)

Parameters

line TensorRtApiLine
capability TensorRtEngineCapability
includeCreatorFields bool

Returns

TensorRtPluginRegistryInventory

GetCurrent()

Gets the current high-level bridge environment snapshot. 获取当前高层 bridge 环境快照。

public static TensorRtEnvironmentSnapshot GetCurrent()

Returns

TensorRtEnvironmentSnapshot

The current bridge environment snapshot. 当前 bridge 环境快照。

GetGlobalPluginRegistryInventory(TensorRtApiLine)

Gets a read-only snapshot of TensorRT's global plugin registry. 获取 TensorRT 全局 plugin registry 的只读快照。

public static TensorRtPluginRegistryInventory GetGlobalPluginRegistryInventory(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

TensorRtPluginRegistryInventory

A global plugin registry inventory snapshot. 全局 plugin registry inventory 快照。

Remarks

This method does not initialize plugin libraries, create plugins, deserialize plugins, or take ownership of creator objects. 该方法不会初始化 plugin library、创建 plugin、反序列化 plugin,也不会接管 creator 对象所有权。

GetGlobalPluginRegistryInventory(TensorRtApiLine, bool)

Gets a read-only global plugin registry snapshot with optional creator-field collection. 获取全局 plugin registry 只读快照,并可选择是否采集 creator 字段。

public static TensorRtPluginRegistryInventory GetGlobalPluginRegistryInventory(TensorRtApiLine line, bool includeCreatorFields)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

includeCreatorFields bool

Whether to invoke creator field metadata APIs. 是否调用 creator 字段元数据 API。

Returns

TensorRtPluginRegistryInventory

GetGlobalRuntimeVersion(TensorRtApiLine)

Gets TensorRT global runtime version details without creating a runtime. 无需创建 runtime 即可获取 TensorRT 全局 runtime 版本信息。

public static TensorRtGlobalRuntimeVersion GetGlobalRuntimeVersion(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

TensorRtGlobalRuntimeVersion

A global runtime version snapshot. 全局 runtime 版本快照。

GetRuntimeCreateDiagnostic(TensorRtApiLine)

Gets a copied no-throw diagnostic snapshot for TensorRT runtime creation. 获取 TensorRT runtime 创建的复制型 no-throw 诊断快照。

public static TensorRtRuntimeCreateDiagnosticSnapshot GetRuntimeCreateDiagnostic(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to diagnose. 要诊断的 TensorRT API line。

Returns

TensorRtRuntimeCreateDiagnosticSnapshot

A pointer-free runtime creation diagnostic snapshot. 无指针 runtime 创建诊断快照。

Remarks

The native diagnostic entry is currently implemented for TensorRT 11. Other lines return a managed not-supported snapshot. native 诊断入口目前仅实现 TensorRT 11;其他版本线返回托管 not-supported 快照。

InitializeBuiltInPlugins(TensorRtLogger, string?)

Initializes and registers TensorRT built-in plugins for the logger's API line. 使用 logger 所属版本线初始化并注册 TensorRT 内置 plugin。

public static bool InitializeBuiltInPlugins(TensorRtLogger logger, string? libNamespace = null)

Parameters

logger TensorRtLogger

The logger used synchronously by vendor plugin initialization. vendor 初始化期间同步使用的 logger。

libNamespace string

Optional namespace for the built-in plugin registrations. 内置 plugin 注册使用的可选 namespace。

Returns

bool

true when the vendor reports successful initialization. vendor 报告初始化成功时返回 true。

Remarks

This is an explicit process-global registration operation. It does not create, return, or own plugin objects, and the logger is borrowed only for the synchronous vendor call. 这是显式的进程级注册操作;不会创建、返回或接管 plugin 对象,logger 只在同步 vendor 调用期间被借用。

IsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine, TensorRtEngineCapability, string, string, string)

Checks whether TensorRT's builder capability plugin registry contains a creator matching the supplied metadata. 检查 TensorRT builder capability plugin registry 是否包含匹配给定元数据的 creator。

public static bool IsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

Returns

bool

true when TensorRT finds a matching creator. TensorRT 找到匹配 creator 时返回 true。

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

IsBuilderCapabilityPluginRegistryAvailable(TensorRtApiLine, TensorRtEngineCapability)

Checks whether TensorRT exposes a builder capability plugin registry for the requested engine capability. 检查 TensorRT 是否为指定 engine capability 暴露 builder capability plugin registry。

public static bool IsBuilderCapabilityPluginRegistryAvailable(TensorRtApiLine line, TensorRtEngineCapability capability)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder registry should be checked. 要检查 builder registry 的 engine capability。

Returns

bool

true when TensorRT reports a builder capability plugin registry. TensorRT 报告存在 builder capability plugin registry 时返回 true。

Remarks

This method only checks whether getBuilderPluginRegistry returns a non-null registry pointer. It does not return the registry pointer, register creators, unregister creators, load plugin libraries, or take ownership of native objects. 该方法只检查 getBuilderPluginRegistry 是否返回非空 registry 指针;不会返回 registry 指针、注册或注销 creator、加载 plugin library,也不会接管 native 对象所有权。

IsBuilderSafePluginRegistryAvailable(TensorRtApiLine, TensorRtEngineCapability)

Checks whether TensorRT exposes a builder safe plugin registry for the requested engine capability. 检查 TensorRT 是否为指定 engine capability 暴露 builder safe plugin registry。

public static bool IsBuilderSafePluginRegistryAvailable(TensorRtApiLine line, TensorRtEngineCapability capability)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose safe builder registry should be checked. 要检查 safe builder registry 的 engine capability。

Returns

bool

true when TensorRT reports a safe builder plugin registry. TensorRT 报告存在 safe builder plugin registry 时返回 true。

Remarks

This method calls the deprecated TensorRT safe-registry getter only to test for a non-null registry pointer. It does not return the registry pointer, register creators, unregister creators, load plugin libraries, or take ownership of native objects. 该方法只调用已弃用的 TensorRT safe registry getter 判断返回指针是否非空;不会返回 registry 指针、注册或注销 creator、加载 plugin library,也不会接管 native 对象所有权。

IsGlobalPluginCreatorRegistered(TensorRtApiLine, string, string, string)

Checks whether TensorRT's global plugin registry contains a creator matching the supplied metadata. 检查 TensorRT 全局 plugin registry 是否存在匹配给定元数据的 creator。

public static bool IsGlobalPluginCreatorRegistered(TensorRtApiLine line, string pluginName, string pluginVersion, string pluginNamespace)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

Returns

bool

true when TensorRT finds a matching creator. TensorRT 找到匹配 creator 时返回 true。

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

IsGlobalPluginRegistryAvailable(TensorRtApiLine)

Checks whether TensorRT exposes a non-null global plugin registry. 检查 TensorRT 是否暴露非空全局 plugin registry。

public static bool IsGlobalPluginRegistryAvailable(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

bool

true when TensorRT reports a global plugin registry. TensorRT 报告存在全局 plugin registry 时返回 true。

Remarks

This method only checks whether getPluginRegistry returns a non-null registry pointer. It does not return the registry pointer, register creators, unregister creators, load plugin libraries, or take ownership of native objects. 该方法只检查 getPluginRegistry 是否返回非空 registry 指针;不会返回 registry 指针、注册或注销 creator、加载 plugin library,也不会接管 native 对象所有权。

IsGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine)

Gets whether TensorRT's global plugin registry searches its parent registry. 获取 TensorRT 全局 plugin registry 是否搜索 parent registry。

public static bool IsGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

Returns

bool

true when parent search is enabled. parent search 已启用时返回 true。

ProbeNativeDependencies(TensorRtApiLine)

Probes native bridge, TensorRT, CUDA, cuDNN, and parser DLL resolution using managed OS APIs only. 仅使用托管 OS API 探测 native bridge、TensorRT、CUDA、cuDNN 与 parser DLL 的解析情况。

public static TensorRtDependencyProbeReport ProbeNativeDependencies(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line used to select expected TensorRT DLL file names. 用于选择预期 TensorRT DLL 文件名的 TensorRT API line。

Returns

TensorRtDependencyProbeReport

A non-throwing native dependency probe report. 非抛异常的 native 依赖探测报告。

Remarks

This diagnostic does not call TensorRT global version functions, global registry functions, runtime creation, or builder creation. It is intended to inspect DLL search-path drift before riskier vendor entry points are used. 该诊断不会调用 TensorRT 全局版本函数、全局 registry 函数、runtime 创建或 builder 创建;用于在调用风险更高的 vendor 入口点前检查 DLL 搜索路径漂移。

ProbeRuntime(TensorRtApiLine)

Runs staged TensorRT runtime probes and returns diagnostics for each stage. 运行 TensorRT runtime 分阶段探针,并返回每个阶段的诊断信息。

public static TensorRtRuntimeProbeReport ProbeRuntime(TensorRtApiLine line)

Parameters

line TensorRtApiLine

The TensorRT API line to probe. 要探测的 TensorRT API line。

Returns

TensorRtRuntimeProbeReport

A staged runtime probe report. 分阶段 runtime 探针报告。

Remarks

The probe intentionally separates global version, global registry, logger creation, builder creation, and runtime creation. 探针会刻意分离全局版本、全局 registry、logger 创建、builder 创建和 runtime 创建阶段。

SetGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine, bool)

Sets the global plugin registry parent-search state and verifies the value by reading it back. 设置全局 plugin registry 的 parent-search 状态,并通过读回进行校验。

public static void SetGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine line, bool enabled)

Parameters

line TensorRtApiLine

The TensorRT API line to update. 要更新的 TensorRT API line。

enabled bool

The requested parent-search state. 请求的 parent-search 状态。

TryBuildTensorRt10SerializedNetworkOnly(out string)

Tries to build a TensorRT 10 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 10 serialized network。

public static bool TryBuildTensorRt10SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true。

TryBuildTensorRt11SerializedNetworkOnly(out string)

Tries to build a TensorRT 11 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 11 serialized network。

public static bool TryBuildTensorRt11SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true。

TryBuildTensorRt8SerializedNetworkOnly(out string)

Tries to build a TensorRT 8 serialized network without running inference. 尝试构建一个不执行推理的 TensorRT 8 serialized network。

public static bool TryBuildTensorRt8SerializedNetworkOnly(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when serialized-network build succeeds. serialized network 构建成功时返回 true。

TryCreateBuilder(TensorRtApiLine, out string)

Tries to create a TensorRT builder for one API line. 尝试为一个 API line 创建 TensorRT builder。

public static bool TryCreateBuilder(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when builder creation succeeds. builder 创建成功时返回 true。

TryCreateLogger(TensorRtApiLine, out string)

Tries to create a TensorRT logger for one API line. 尝试为一个 API line 创建 TensorRT logger。

public static bool TryCreateLogger(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when logger creation succeeds. logger 创建成功时返回 true。

TryCreateRuntime(TensorRtApiLine, out string)

Tries to create a TensorRT runtime for one API line. 尝试为一个 API line 创建 TensorRT runtime。

public static bool TryCreateRuntime(TensorRtApiLine line, out string message)

Parameters

line TensorRtApiLine

The TensorRT API line. TensorRT API 版本线。

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when runtime creation succeeds. runtime 创建成功时返回 true。

TryGetBuilderCapabilityPluginCreator(TensorRtApiLine, TensorRtEngineCapability, string, string, string, out TensorRtPluginCreatorInfo?, out string)

Tries to read metadata for a plugin creator from TensorRT's builder capability plugin registry. 尝试从 TensorRT builder capability plugin registry 读取某个 plugin creator 的元数据。

public static bool TryGetBuilderCapabilityPluginCreator(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace, out TensorRtPluginCreatorInfo? creator, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

creator TensorRtPluginCreatorInfo

The copied creator metadata when a matching creator is found. 找到匹配 creator 时复制出的 creator 元数据。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when a matching creator was found and copied. 找到并复制匹配 creator 时返回 true。

Remarks

The returned metadata is copied into managed objects. The native creator pointer is never exposed or owned by managed code. 返回的元数据会复制到托管对象中;native creator 指针不会暴露给托管代码,也不会由托管代码持有。

TryGetBuilderCapabilityPluginCreator(TensorRtApiLine, TensorRtEngineCapability, string, string, string, bool, out TensorRtPluginCreatorInfo?, out string)

Tries to copy builder capability plugin creator metadata with optional field collection. 尝试复制 builder capability plugin creator 元数据,并可选择是否采集字段。

public static bool TryGetBuilderCapabilityPluginCreator(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace, bool includeCreatorFields, out TensorRtPluginCreatorInfo? creator, out string diagnostic)

Parameters

line TensorRtApiLine
capability TensorRtEngineCapability
pluginName string
pluginVersion string
pluginNamespace string
includeCreatorFields bool
creator TensorRtPluginCreatorInfo
diagnostic string

Returns

bool

TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability, out TensorRtPluginRegistryInventory?, out string)

Tries to get TensorRT's builder capability plugin registry inventory without throwing for unsupported lines. 尝试获取 TensorRT builder capability plugin registry inventory;不支持的 API line 不会抛出异常。

public static bool TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

inventory TensorRtPluginRegistryInventory

The inventory snapshot when the query succeeds. 查询成功时的 inventory 快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the inventory was collected successfully. 成功采集 inventory 时返回 true。

TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine, TensorRtEngineCapability, bool, out TensorRtPluginRegistryInventory?, out string)

Tries to copy builder capability registry metadata with optional creator-field collection. 尝试复制 builder capability registry 元数据,并可选择是否采集 creator 字段。

public static bool TryGetBuilderCapabilityPluginRegistryInventory(TensorRtApiLine line, TensorRtEngineCapability capability, bool includeCreatorFields, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine
capability TensorRtEngineCapability
includeCreatorFields bool
inventory TensorRtPluginRegistryInventory
diagnostic string

Returns

bool

TryGetGlobalPluginCreator(TensorRtApiLine, string, string, string, out TensorRtPluginCreatorInfo?, out string)

Tries to read metadata for a plugin creator from TensorRT's global plugin registry. 尝试从 TensorRT 全局 plugin registry 读取某个 plugin creator 的元数据。

public static bool TryGetGlobalPluginCreator(TensorRtApiLine line, string pluginName, string pluginVersion, string pluginNamespace, out TensorRtPluginCreatorInfo? creator, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

creator TensorRtPluginCreatorInfo

The copied creator metadata when a matching creator is found. 找到匹配 creator 时复制出的 creator 元数据。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when a matching creator was found and copied. 找到并复制匹配 creator 时返回 true。

Remarks

The lookup does not create a plugin, does not return the native creator pointer, and does not take ownership of TensorRT objects. The returned metadata is copied into managed objects. 该 lookup 不会创建 plugin、不会返回 native creator 指针,也不会接管 TensorRT 对象所有权;返回的元数据会复制到托管对象中。

TryGetGlobalPluginCreator(TensorRtApiLine, string, string, string, bool, out TensorRtPluginCreatorInfo?, out string)

Tries to copy global plugin creator metadata with optional field collection. 尝试复制全局 plugin creator 元数据,并可选择是否采集字段。

public static bool TryGetGlobalPluginCreator(TensorRtApiLine line, string pluginName, string pluginVersion, string pluginNamespace, bool includeCreatorFields, out TensorRtPluginCreatorInfo? creator, out string diagnostic)

Parameters

line TensorRtApiLine
pluginName string
pluginVersion string
pluginNamespace string
includeCreatorFields bool
creator TensorRtPluginCreatorInfo
diagnostic string

Returns

bool

TryGetGlobalPluginRegistryInventory(TensorRtApiLine, out TensorRtPluginRegistryInventory?, out string)

Tries to get TensorRT's global plugin registry inventory without throwing for unsupported lines. 尝试获取 TensorRT 全局 plugin registry inventory;不支持时不抛出异常。

public static bool TryGetGlobalPluginRegistryInventory(TensorRtApiLine line, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

inventory TensorRtPluginRegistryInventory

The inventory snapshot when the query succeeds. 查询成功时的 inventory 快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the inventory was collected successfully. 成功采集 inventory 时返回 true。

TryGetGlobalPluginRegistryInventory(TensorRtApiLine, bool, out TensorRtPluginRegistryInventory?, out string)

Tries to copy global plugin registry metadata with optional creator-field collection. 尝试复制全局 plugin registry 元数据,并可选择是否采集 creator 字段。

public static bool TryGetGlobalPluginRegistryInventory(TensorRtApiLine line, bool includeCreatorFields, out TensorRtPluginRegistryInventory? inventory, out string diagnostic)

Parameters

line TensorRtApiLine
includeCreatorFields bool
inventory TensorRtPluginRegistryInventory
diagnostic string

Returns

bool

TryGetGlobalRuntimeVersion(TensorRtApiLine, out TensorRtGlobalRuntimeVersion?, out string)

Tries to get TensorRT global runtime version details without throwing for unsupported lines. 尝试获取 TensorRT 全局 runtime 版本信息;不支持时不抛出异常。

public static bool TryGetGlobalRuntimeVersion(TensorRtApiLine line, out TensorRtGlobalRuntimeVersion? version, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

version TensorRtGlobalRuntimeVersion

The version snapshot when the query succeeds. 查询成功时的版本快照。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the version was collected successfully. 成功采集版本信息时返回 true。

TryInitializeBuiltInPlugins(TensorRtLogger, string?, out bool, out string)

Tries to initialize TensorRT built-in plugins and returns a bounded diagnostic. 尝试初始化 TensorRT 内置 plugin,并返回受控诊断。

public static bool TryInitializeBuiltInPlugins(TensorRtLogger logger, string? libNamespace, out bool initialized, out string diagnostic)

Parameters

logger TensorRtLogger
libNamespace string
initialized bool
diagnostic string

Returns

bool

TryIsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine, TensorRtEngineCapability, string, string, string, out bool, out string)

Tries to check whether TensorRT's builder capability plugin registry contains a matching creator without throwing probe exceptions. 尝试检查 TensorRT builder capability plugin registry 是否存在匹配 creator;探针异常会转为诊断字符串。

public static bool TryIsBuilderCapabilityPluginCreatorRegistered(TensorRtApiLine line, TensorRtEngineCapability capability, string pluginName, string pluginVersion, string pluginNamespace, out bool found, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder-visible registry should be inspected. 要检查其 builder-visible registry 的 engine capability。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

found bool

Set to true when TensorRT finds a matching creator. 找到匹配 creator 时设为 true。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the lookup completed successfully. lookup 成功完成时返回 true。

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

TryIsBuilderCapabilityPluginRegistryAvailable(TensorRtApiLine, TensorRtEngineCapability, out bool, out string)

Tries to check whether TensorRT exposes a builder capability plugin registry without throwing probe exceptions. 尝试检查 TensorRT 是否暴露 builder capability plugin registry;探针异常会转为诊断字符串。

public static bool TryIsBuilderCapabilityPluginRegistryAvailable(TensorRtApiLine line, TensorRtEngineCapability capability, out bool available, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose builder registry should be checked. 要检查 builder registry 的 engine capability。

available bool

Set to true when TensorRT reports a registry. TensorRT 报告存在 registry 时设为 true。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the probe completed successfully. 探针成功完成时返回 true。

Remarks

This method only checks whether getBuilderPluginRegistry returns a non-null registry pointer. It does not return the registry pointer or take ownership of native objects. 该方法只检查 getBuilderPluginRegistry 是否返回非空 registry 指针;不会返回 registry 指针,也不会接管 native 对象所有权。

TryIsBuilderSafePluginRegistryAvailable(TensorRtApiLine, TensorRtEngineCapability, out bool, out string)

Tries to check whether TensorRT exposes a builder safe plugin registry without throwing probe exceptions. 尝试检查 TensorRT 是否暴露 builder safe plugin registry;探针异常会转为诊断字符串。

public static bool TryIsBuilderSafePluginRegistryAvailable(TensorRtApiLine line, TensorRtEngineCapability capability, out bool available, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

capability TensorRtEngineCapability

The engine capability whose safe builder registry should be checked. 要检查 safe builder registry 的 engine capability。

available bool

Set to true when TensorRT reports a safe registry. TensorRT 报告存在 safe registry 时设为 true。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the probe completed successfully. 探针成功完成时返回 true。

Remarks

This method only checks whether TensorRT returns a non-null safe registry pointer. It does not return the registry pointer or take ownership of native objects. 该方法只检查 TensorRT 是否返回非空 safe registry 指针;不会返回 registry 指针,也不会接管 native 对象所有权。

TryIsGlobalPluginCreatorRegistered(TensorRtApiLine, string, string, string, out bool, out string)

Tries to check whether TensorRT's global plugin registry contains a matching creator without throwing probe exceptions. 尝试检查 TensorRT 全局 plugin registry 是否存在匹配 creator;探针异常会转为诊断字符串。

public static bool TryIsGlobalPluginCreatorRegistered(TensorRtApiLine line, string pluginName, string pluginVersion, string pluginNamespace, out bool found, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

pluginName string

The plugin creator name. plugin creator 名称。

pluginVersion string

The plugin creator version. plugin creator 版本。

pluginNamespace string

The plugin creator namespace. plugin creator 命名空间。

found bool

Set to true when TensorRT finds a matching creator. 找到匹配 creator 时设为 true。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the lookup completed successfully. lookup 成功完成时返回 true。

Remarks

This lookup does not create a plugin and does not return or own the native creator pointer. 该 lookup 不会创建 plugin,也不会返回或持有 native creator 指针。

TryIsGlobalPluginRegistryAvailable(TensorRtApiLine, out bool, out string)

Tries to check whether TensorRT exposes a global plugin registry without throwing probe exceptions. 尝试检查 TensorRT 是否暴露全局 plugin registry;探针异常会转为诊断字符串。

public static bool TryIsGlobalPluginRegistryAvailable(TensorRtApiLine line, out bool available, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

available bool

Set to true when TensorRT reports a registry. TensorRT 报告存在 registry 时设为 true。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the probe completed successfully. 探针成功完成时返回 true。

Remarks

This method only checks whether getPluginRegistry returns a non-null registry pointer. It does not return the registry pointer or take ownership of native objects. 该方法只检查 getPluginRegistry 是否返回非空 registry 指针;不会返回 registry 指针,也不会接管 native 对象所有权。

TryIsGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine, out bool, out string)

Tries to get the global plugin registry parent-search state. 尝试获取全局 plugin registry 的 parent-search 状态。

public static bool TryIsGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine line, out bool enabled, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to query. 要查询的 TensorRT API line。

enabled bool

The copied parent-search state. 复制出的 parent-search 状态。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the query completed successfully. 查询成功完成时返回 true。

TryRunTensorRt10MinimalBuildChain(out string)

Tries to run the minimal TensorRT 10 build chain. 尝试运行最小 TensorRT 10 构建链路。

public static bool TryRunTensorRt10MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true。

TryRunTensorRt11MinimalBuildChain(out string)

Tries to run the minimal TensorRT 11 build chain. 尝试运行最小 TensorRT 11 构建链路。

public static bool TryRunTensorRt11MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true。

TryRunTensorRt8MinimalBuildChain(out string)

Tries to run the minimal TensorRT 8 build chain. 尝试运行最小 TensorRT 8 构建链路。

public static bool TryRunTensorRt8MinimalBuildChain(out string message)

Parameters

message string

A success or failure diagnostic message. 成功或失败诊断消息。

Returns

bool

true when the minimal build chain succeeds. 最小构建链路成功时返回 true。

TrySetGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine, bool, out bool, out string)

Tries to set and read back the global plugin registry parent-search state. 尝试设置并读回全局 plugin registry 的 parent-search 状态。

public static bool TrySetGlobalPluginRegistryParentSearchEnabled(TensorRtApiLine line, bool enabled, out bool actualEnabled, out string diagnostic)

Parameters

line TensorRtApiLine

The TensorRT API line to update. 要更新的 TensorRT API line。

enabled bool

The requested parent-search state. 请求的 parent-search 状态。

actualEnabled bool

The read-back state when the update succeeds. 更新成功时读回的状态。

diagnostic string

A diagnostic string describing success or failure. 描述成功或失败原因的诊断字符串。

Returns

bool

true when the update and readback both succeed. 更新及读回均成功时返回 true。