Class TensorRtTimingCache
- Namespace
- JYPPX.TensorRtSharp
- Assembly
- JYPPX.TensorRtSharp.dll
Managed wrapper around a TensorRT timing cache. TensorRT timing cache 的托管封装。
public sealed class TensorRtTimingCache : IDisposable
- Inheritance
-
TensorRtTimingCache
- Implements
- Inherited Members
Fields
KeySizeInBytes
The fixed size of one TensorRT timing-cache key in bytes. 单个 TensorRT timing cache key 的固定字节长度。
public const int KeySizeInBytes = 16
Field Value
Properties
Line
Gets the TensorRT API line used by this timing cache. 获取当前 timing cache 使用的 TensorRT API line。
public TensorRtApiLine Line { get; }
Property Value
Methods
Combine(TensorRtTimingCache, bool)
Merges another timing cache into this timing cache. 将另一个 timing cache 合并到当前 timing cache 中。
public bool Combine(TensorRtTimingCache inputCache, bool ignoreMismatch = false)
Parameters
inputCacheTensorRtTimingCacheThe timing cache to merge. 要合并的 timing cache。
ignoreMismatchboolWhether TensorRT should ignore cache mismatches. TensorRT 是否忽略 cache 不匹配。
Returns
Dispose()
Releases the TensorRT timing-cache handle. 释放 TensorRT timing cache 句柄。
public void Dispose()
QueryKeyBytes()
Copies the flattened timing-cache key bytes. 复制扁平化的 timing cache key 字节数据。
public byte[] QueryKeyBytes()
Returns
- byte[]
The concatenated key bytes. 拼接后的 key 字节数组。
QueryKeyCount()
Gets the number of timing-cache keys stored in the cache. 获取当前 cache 中存储的 timing cache key 数量。
public long QueryKeyCount()
Returns
- long
The key count. key 数量。
QueryKeys()
Returns timing-cache keys as individual 16-byte arrays. 将 timing cache key 作为独立的 16 字节数组返回。
public IReadOnlyList<byte[]> QueryKeys()
Returns
- IReadOnlyList<byte[]>
A read-only list of keys. key 的只读列表。
Reset()
Resets the timing cache contents. 重置 timing cache 内容。
public bool Reset()
Returns
Serialize()
Serializes the timing cache into TensorRT host memory. 将 timing cache 序列化为 TensorRT host memory。
public TensorRtHostMemory Serialize()
Returns
- TensorRtHostMemory
The serialized timing-cache payload. 序列化的 timing cache 负载。
TryQuery(byte[], out TensorRtTimingCacheValue)
Tries to query one timing-cache entry by key. 尝试按 key 查询一个 timing cache 条目。
public bool TryQuery(byte[] key, out TensorRtTimingCacheValue value)
Parameters
keybyte[]The 16-byte timing-cache key. 16 字节 timing cache key。
valueTensorRtTimingCacheValueThe queried value. 查询到的值。
Returns
Update(byte[], TensorRtTimingCacheValue)
Updates one timing-cache entry with a prebuilt value object. 使用预构建值对象更新一个 timing cache 条目。
public bool Update(byte[] key, TensorRtTimingCacheValue value)
Parameters
keybyte[]The 16-byte timing-cache key. 16 字节 timing cache key。
valueTensorRtTimingCacheValueThe value to store. 要写入的值。
Returns
Update(byte[], ulong, float)
Updates one timing-cache entry with explicit tactic and timing data. 使用显式 tactic 与 timing 数据更新一个 timing cache 条目。
public bool Update(byte[] key, ulong tacticHash, float timingMilliseconds)
Parameters
keybyte[]The 16-byte timing-cache key. 16 字节 timing cache key。
tacticHashulongThe TensorRT tactic hash. TensorRT tactic 哈希值。
timingMillisecondsfloatThe observed timing in milliseconds. 观测到的 timing,单位为毫秒。