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
kindTensorRtOutputAllocatorCallbackKindThe callback operation. callback 操作。
tensorNamestringThe copied output tensor name. 复制出的输出 tensor 名称。
requestedSizeulongThe requested output size, or zero for shape notification. 请求的输出大小;shape 通知时为零。
alignmentulongThe requested alignment, or zero for shape notification. 请求的对齐;shape 通知时为零。
shapeDimensionslong[]The copied shape dimensions. 复制出的 shape 维度。
reasonstringA copied diagnostic reason. 复制出的诊断原因。
hasCurrentMemoryboolWhether TensorRT supplied current memory. TensorRT 是否提供 current memory。
hasStreamboolWhether 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
tensorNamestringThe copied output tensor name. 复制出的输出 tensor 名称。
requestedSizeulongThe requested output buffer size in bytes. 请求的输出缓冲区字节数。
alignmentulongThe requested output buffer alignment in bytes. 请求的输出缓冲区字节对齐。
shapeDimensionslong[]The copied output shape dimensions. 复制出的输出 shape 维度。
reasonstringA diagnostic reason copied from the caller. 调用方提供的诊断原因。
hasCurrentMemoryboolWhether 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
HasCurrentMemory
Gets whether an existing current memory pointer was reported. 获取是否报告了已有 current memory pointer。
public bool HasCurrentMemory { get; }
Property Value
HasStream
Gets whether TensorRT supplied an asynchronous CUDA stream. 获取 TensorRT 是否提供异步 CUDA stream。
public bool HasStream { get; }
Property Value
Kind
Gets the callback operation. 获取 callback 操作。
public TensorRtOutputAllocatorCallbackKind Kind { get; }
Property Value
Reason
Gets the copied diagnostic reason. 获取复制出的诊断原因。
public string Reason { get; }
Property Value
RequestedSize
Gets the requested output buffer size in bytes. 获取请求的输出缓冲区字节数。
public ulong RequestedSize { get; }
Property Value
ShapeDimensions
Gets the copied output shape dimensions. 获取复制出的输出 shape 维度。
public ReadOnlyCollection<long> ShapeDimensions { get; }
Property Value
ShapeRank
Gets the copied output shape rank. 获取复制出的输出 shape rank。
public int ShapeRank { get; }
Property Value
TensorName
Gets the copied output tensor name. 获取复制出的输出 tensor 名称。
public string TensorName { get; }