Table of Contents

Class TensorRtOutputAllocatorCallbackOwner

Namespace
JYPPX.TensorRtSharp
Assembly
JYPPX.TensorRtSharp.dll

Owns a TensorRT output allocator callback and its managed lifetime. 管理 TensorRT output allocator callback 及其托管生命周期。

public sealed class TensorRtOutputAllocatorCallbackOwner : IDisposable
Inheritance
TensorRtOutputAllocatorCallbackOwner
Implements
Inherited Members

Remarks

The line-and-handler constructor creates a real native IOutputAllocator. Native code owns every CUDA allocation and exposes only copied request metadata to the managed handler. The parameterless constructor remains available for the repository's historical design diagnostics. 带版本线与 handler 的构造函数会创建真实 native IOutputAllocator。所有 CUDA 分配均由 native 代码持有,托管 handler 只接收复制后的请求元数据。无参构造函数继续供仓库既有设计诊断使用。

Constructors

TensorRtOutputAllocatorCallbackOwner()

Creates an output allocator callback owner design gate. 创建 output allocator callback owner 设计门禁。

public TensorRtOutputAllocatorCallbackOwner()

TensorRtOutputAllocatorCallbackOwner(TensorRtApiLine, TensorRtOutputAllocatorHandler)

Creates a real TensorRT output allocator callback owner. 创建真实 TensorRT output allocator callback owner。

public TensorRtOutputAllocatorCallbackOwner(TensorRtApiLine line, TensorRtOutputAllocatorHandler handler)

Parameters

line TensorRtApiLine

TensorRT 8, 10, or 11. TensorRT 8、10 或 11。

handler TensorRtOutputAllocatorHandler

The pointer-free managed request handler. 无指针托管请求处理器。

Properties

HasNativeAllocator

Gets whether this instance owns a real native IOutputAllocator. 获取当前实例是否拥有真实 native IOutputAllocator。

public bool HasNativeAllocator { get; }

Property Value

bool

IsAttached

Gets whether this owner is attached to a TensorRT execution context. 获取该 owner 是否已绑定到 TensorRT execution context。

public bool IsAttached { get; }

Property Value

bool

IsDisposed

Gets whether dispose has been requested. 获取是否已请求释放。

public bool IsDisposed { get; }

Property Value

bool

RuntimeLine

Gets the runtime TensorRT line, or null for a design-only owner. 获取 runtime TensorRT 版本线;纯设计 owner 返回 null。

public TensorRtApiLine? RuntimeLine { get; }

Property Value

TensorRtApiLine?

Methods

Dispose()

Releases managed keep-alive handles owned by the design gate. 释放该设计门禁持有的托管 keep-alive 句柄。

public void Dispose()

~TensorRtOutputAllocatorCallbackOwner()

Releases an undisposed runtime callback owner. 释放未显式 Dispose 的 runtime callback owner。

protected ~TensorRtOutputAllocatorCallbackOwner()

GetRuntimeSnapshot()

Gets a pointer-free snapshot from the real native output allocator owner. 获取真实 native output allocator owner 的无指针快照。

public TensorRtOutputAllocatorRuntimeSnapshot GetRuntimeSnapshot()

Returns

TensorRtOutputAllocatorRuntimeSnapshot

Copied callback, allocation, and lifecycle state. 复制后的 callback、分配及生命周期状态。

GetSnapshot(string)

Gets a copied snapshot of the current design gate state. 获取当前设计门禁状态的复制快照。

public TensorRtOutputAllocatorCallbackOwnerSnapshot GetSnapshot(string operation = "snapshot")

Parameters

operation string

A copied operation label. 复制出的操作标签。

Returns

TensorRtOutputAllocatorCallbackOwnerSnapshot

A pointer-free copied diagnostic snapshot. 不含 pointer 的复制诊断快照。

RunDesignDiagnostic(TensorRtApiLine, TensorRtOutputAllocatorCallbackRequest, ulong)

Runs the output allocator owner design diagnostic. 执行 output allocator owner 设计诊断。

public TensorRtOutputAllocatorCallbackOwnerSnapshot RunDesignDiagnostic(TensorRtApiLine line, TensorRtOutputAllocatorCallbackRequest request, ulong streamValue = 0)

Parameters

line TensorRtApiLine

The TensorRT API line to use for native ledger intent diagnostics. 用于 native ledger intent 诊断的 TensorRT API line。

request TensorRtOutputAllocatorCallbackRequest

The copied output allocator diagnostic request. 复制出的 output allocator 诊断请求。

streamValue ulong

A synthetic stream value copied into the native ledger diagnostic. 复制到 native ledger 诊断中的合成 stream 值。

Returns

TensorRtOutputAllocatorCallbackOwnerSnapshot

A pointer-free copied diagnostic snapshot. 不含 pointer 的复制诊断快照。

Remarks

The method emits synthetic notify/reallocate diagnostics and a native attach/allocation/release/detach ledger intent when the native bridge is available. Native bridge load failures are copied into the returned snapshot instead of escaping as proof of API absence. 该方法会发出合成的 notify/reallocate 诊断,并在 native bridge 可用时记录 native attach/allocation/release/detach ledger intent。native bridge 加载失败会被复制到返回快照中,不会被冒泡成 API 缺失证据。