Table of Contents

Struct TensorRtOutputAllocatorCallbackRequest

Namespace
JYPPX.TensorRtSharp
Assembly
JYPPX.TensorRtSharp.dll

Describes copied metadata for one TensorRT output allocator callback. 描述一次 TensorRT output allocator 回调复制出的元数据。

public readonly struct TensorRtOutputAllocatorCallbackRequest
Inherited Members

Remarks

This request contains copied metadata only. It does not carry a TensorRT output buffer, CUDA stream handle, or device pointer ownership. Native code owns every CUDA allocation returned to TensorRT. 该请求只包含复制出的元数据;不携带 TensorRT output buffer、CUDA stream handle 或 device pointer 所有权。

Constructors

TensorRtOutputAllocatorCallbackRequest(TensorRtOutputAllocatorCallbackKind, string, ulong, ulong, long[]?, string, bool, bool)

Creates a copied output allocator callback request. 创建复制后的 output allocator callback 请求。

public TensorRtOutputAllocatorCallbackRequest(TensorRtOutputAllocatorCallbackKind kind, string tensorName, ulong requestedSize, ulong alignment, long[]? shapeDimensions, string reason = "", bool hasCurrentMemory = false, bool hasStream = false)

Parameters

kind TensorRtOutputAllocatorCallbackKind

The callback operation. callback 操作。

tensorName string

The copied output tensor name. 复制出的输出 tensor 名称。

requestedSize ulong

The requested output size, or zero for shape notification. 请求的输出大小;shape 通知时为零。

alignment ulong

The requested alignment, or zero for shape notification. 请求的对齐;shape 通知时为零。

shapeDimensions long[]

The copied shape dimensions. 复制出的 shape 维度。

reason string

A copied diagnostic reason. 复制出的诊断原因。

hasCurrentMemory bool

Whether TensorRT supplied current memory. TensorRT 是否提供 current memory。

hasStream bool

Whether the async callback supplied a CUDA stream. 异步 callback 是否提供 CUDA stream。

TensorRtOutputAllocatorCallbackRequest(string, ulong, ulong, long[]?, string, bool)

Creates an output allocator owner diagnostic request. 创建 output allocator owner 诊断请求。

public TensorRtOutputAllocatorCallbackRequest(string tensorName, ulong requestedSize, ulong alignment, long[]? shapeDimensions, string reason = "", bool hasCurrentMemory = false)

Parameters

tensorName string

The copied output tensor name. 复制出的输出 tensor 名称。

requestedSize ulong

The requested output buffer size in bytes. 请求的输出缓冲区字节数。

alignment ulong

The requested output buffer alignment in bytes. 请求的输出缓冲区字节对齐。

shapeDimensions long[]

The copied output shape dimensions. 复制出的输出 shape 维度。

reason string

A diagnostic reason copied from the caller. 调用方提供的诊断原因。

hasCurrentMemory bool

Whether TensorRT reported an existing current memory pointer. TensorRT 是否报告已有 current memory pointer。

Properties

Alignment

Gets the requested output buffer alignment in bytes. 获取请求的输出缓冲区字节对齐。

public ulong Alignment { get; }

Property Value

ulong

HasCurrentMemory

Gets whether an existing current memory pointer was reported. 获取是否报告了已有 current memory pointer。

public bool HasCurrentMemory { get; }

Property Value

bool

HasStream

Gets whether TensorRT supplied an asynchronous CUDA stream. 获取 TensorRT 是否提供异步 CUDA stream。

public bool HasStream { get; }

Property Value

bool

Kind

Gets the callback operation. 获取 callback 操作。

public TensorRtOutputAllocatorCallbackKind Kind { get; }

Property Value

TensorRtOutputAllocatorCallbackKind

Reason

Gets the copied diagnostic reason. 获取复制出的诊断原因。

public string Reason { get; }

Property Value

string

RequestedSize

Gets the requested output buffer size in bytes. 获取请求的输出缓冲区字节数。

public ulong RequestedSize { get; }

Property Value

ulong

ShapeDimensions

Gets the copied output shape dimensions. 获取复制出的输出 shape 维度。

public ReadOnlyCollection<long> ShapeDimensions { get; }

Property Value

ReadOnlyCollection<long>

ShapeRank

Gets the copied output shape rank. 获取复制出的输出 shape rank。

public int ShapeRank { get; }

Property Value

int

TensorName

Gets the copied output tensor name. 获取复制出的输出 tensor 名称。

public string TensorName { get; }

Property Value

string