TensorRT 10.8.0
NvInferRuntime.h
转到此文件的文档。
1/*
2 * SPDX-FileCopyrightText: 版权所有 (c) 1993-2024 NVIDIA CORPORATION 及附属公司。保留所有权利。
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * 根据 Apache License 2.0 版本(“许可证”)获得许可;
6 * 除非遵守许可证,否则您不得使用此文件。
7 * 您可以在以下网址获取许可证副本:
8 *
9 * https://apache.ac.cn/licenses/LICENSE-2.0
10 *
11 * 除非适用法律要求或以书面形式达成一致,否则
12 * 根据许可证分发的软件以“现状”为基础分发,
13 * 不附带任何形式的明示或暗示的保证或条件。
14 * 请参阅许可证,以了解有关权限和
15 * 许可证限制的具体语言。
16 */
17
18#ifndef NV_INFER_RUNTIME_H
19#define NV_INFER_RUNTIME_H
20
26
27#include "NvInferImpl.h"
28#define NV_INFER_INTERNAL_INCLUDE 1
29#include "NvInferPluginBase.h"
30#undef NV_INFER_INTERNAL_INCLUDE
32
33namespace nvinfer1
34{
35
36class IExecutionContext;
37class ICudaEngine;
38class IPluginFactory;
39class IEngineInspector;
40
49
51{
52protected
53 INoCopy() = default;
54 virtual ~INoCopy() = default;
55 INoCopy(INoCopy const& other) = delete;
56 INoCopy& operator=(INoCopy const& other) = delete;
57 INoCopy(INoCopy&& other) = delete;
58 INoCopy& operator=(INoCopy&& other) = delete;
59};
60
75enum class EngineCapability : int32_t
76{
81 kSTANDARD = 0,
82
89 kSAFETY = 1,
90
97};
98
99namespace impl
100{
102template <>
104{
105 static constexpr int32_t kVALUE = 3;
106};
107} // namespace impl
108
124{
125public
127 void const* values;
128 int64_t count;
129};
130
141class IHostMemory : public INoCopy
142{
143public
144 virtual ~IHostMemory() noexcept = default;
145
147 void* data() const noexcept
148 {
149 return mImpl->data();
150 }
151
153 std::size_t size() const noexcept
154 {
155 return mImpl->size();
156 }
157
159 DataType type() const noexcept
160 {
161 return mImpl->type();
162 }
163
164protected
165 apiv::VHostMemory* mImpl;
166};
167
178enum class DimensionOperation : int32_t
179{
180 kSUM = 0,
181 kPROD = 1,
182 kMAX = 2,
183 kMIN = 3,
184 kSUB = 4,
185 kEQUAL = 5,
186 kLESS = 6,
187 kFLOOR_DIV = 7,
188 kCEIL_DIV = 8
189};
190
192template <>
193constexpr inline int32_t EnumMax<DimensionOperation>() noexcept
194{
195 return 9;
196}
197
203enum class TensorLocation : int32_t
204{
205 kDEVICE = 0,
206 kHOST = 1,
207};
208
209namespace impl
210{
212template <>
214{
215 static constexpr int32_t kVALUE = 2;
216};
217} // namespace impl
218
232{
233public
237 bool isConstant() const noexcept
238 {
239 return mImpl->isConstant();
240 }
241
248 int64_t getConstantValue() const noexcept
249 {
250 return mImpl->getConstantValue();
251 }
252
253protected
254 apiv::VDimensionExpr* mImpl;
255 virtual ~IDimensionExpr() noexcept = default;
256
257public
263 bool isSizeTensor() const noexcept
264 {
265 return mImpl->isSizeTensor();
266 }
267};
268
286class IExprBuilder : public INoCopy
287{
288public
292 IDimensionExpr const* constant(int64_t value) noexcept
293 {
294 return mImpl->constant(value);
295 }
296
304 DimensionOperation op, IDimensionExpr const& first, IDimensionExpr const& second) noexcept
305 {
306 return mImpl->operation(op, first, second);
307 }
308
309protected
310 apiv::VExprBuilder* mImpl;
311 virtual ~IExprBuilder() noexcept = default;
312
313public
338 IDimensionExpr const* declareSizeTensor(int32_t outputIndex, IDimensionExpr const& opt, IDimensionExpr const& upper)
339 {
340 return mImpl->declareSizeTensor(outputIndex, opt, upper);
341 }
342};
343
350{
351public
352 int32_t nbDims;
354};
355
362{
365
368
371
374};
375
407{
408public
409 IPluginV2DynamicExt* clone() const noexcept override = 0;
410
435 virtual DimsExprs getOutputDimensions(
436 int32_t outputIndex, DimsExprs const* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept = 0;
437
441 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
442
475 virtual bool supportsFormatCombination(
476 int32_t pos, PluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
477
515 virtual void configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
516 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
517
527 virtual size_t getWorkspaceSize(PluginTensorDesc const* inputs, int32_t nbInputs, PluginTensorDesc const* outputs,
528 int32_t nbOutputs) const noexcept = 0;
529
542 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
543 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
544
545protected
553 int32_t getTensorRTVersion() const noexcept override
554 {
555 return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
556 }
557
558 virtual ~IPluginV2DynamicExt() noexcept {}
559
560private
561 // Following are obsolete base class methods, and must not be implemented or used.
562
566 void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
567 bool const*, PluginFormat, int32_t) noexcept override final
568 {
569 }
570
574 bool supportsFormat(DataType, PluginFormat) const noexcept override final
575 {
576 return false;
577 }
578
582 Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept override final
583 {
584 return Dims{-1, {}};
585 }
586
594 TRT_DEPRECATED bool isOutputBroadcastAcrossBatch(int32_t, bool const*, int32_t) const noexcept override final
595 {
596 return false;
597 }
598
606 TRT_DEPRECATED bool canBroadcastInputAcrossBatch(int32_t) const noexcept override final
607 {
608 return true;
609 }
610
614 size_t getWorkspaceSize(int32_t) const noexcept override final
615 {
616 return 0;
617 }
618
622 int32_t enqueue(int32_t, void const* const*, void* const*, void*, cudaStream_t) noexcept override final
623 {
624 return 1;
625 }
626};
627
628namespace v_1_0
629{
631{
632public
637 ~IStreamReader() override = default;
638 IStreamReader() = default;
639
643 InterfaceInfo getInterfaceInfo() const noexcept override
644 {
645 return InterfaceInfo{"IStreamReader", 1, 0};
646 }
647
656 virtual int64_t read(void* destination, int64_t nbBytes) = 0;
657
658protected
659 IStreamReader(IStreamReader const&) = default;
663};
664} // namespace v_1_0
665
675
680enum class SeekPosition : int32_t
681{
683 kSET = 0,
684
686 kCUR = 1,
687
689 kEND = 2,
690};
691
692namespace v_1_0
693{
695{
696public
701 ~IStreamReaderV2() override = default;
702 IStreamReaderV2() = default;
703
707 InterfaceInfo getInterfaceInfo() const noexcept override
708 {
709 return InterfaceInfo{"IStreamReaderV2", 1, 0};
710 }
711
722 virtual int64_t read(void* destination, int64_t nbBytes, cudaStream_t stream) noexcept = 0;
723
732 virtual bool seek(int64_t offset, SeekPosition where) noexcept = 0;
733
734protected
739};
740} // 命名空间 v_1_0
741
752
767{
768public
773 virtual IGpuAllocator* getGpuAllocator() const noexcept = 0;
774
779 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
780 virtual ~IPluginResourceContext() noexcept = default;
781
782protected
786 IPluginResourceContext& operator=(IPluginResourceContext const&) & = default;
788};
789
790namespace v_1_0
791{
793{
794public
798 InterfaceInfo getInterfaceInfo() const noexcept override
799 {
800 return InterfaceInfo{"PLUGIN_V3ONE_CORE", 1, 0};
801 }
802
811 virtual AsciiChar const* getPluginName() const noexcept = 0;
812
821 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
822
832 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
833};
834
836{
837public
843 static constexpr int32_t kDEFAULT_FORMAT_COMBINATION_LIMIT = 100;
844
848 InterfaceInfo getInterfaceInfo() const noexcept override
849 {
850 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 1, 0};
851 }
852
872 virtual int32_t configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
873 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
874
891 virtual int32_t getOutputDataTypes(
892 DataType* outputTypes, int32_t nbOutputs, const DataType* inputTypes, int32_t nbInputs) const noexcept = 0;
893
914 virtual int32_t getOutputShapes(DimsExprs const* inputs, int32_t nbInputs, DimsExprs const* shapeInputs,
915 int32_t nbShapeInputs, DimsExprs* outputs, int32_t nbOutputs, IExprBuilder& exprBuilder) noexcept = 0;
916
952 int32_t pos, DynamicPluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
953
959 virtual int32_t getNbOutputs() const noexcept = 0;
960
970 virtual size_t getWorkspaceSize(DynamicPluginTensorDesc const* inputs, int32_t nbInputs,
971 DynamicPluginTensorDesc const* outputs, int32_t nbOutputs) const noexcept
972 {
973 return 0;
974 }
975
1007 virtual int32_t getValidTactics(int32_t* tactics, int32_t nbTactics) noexcept
1008 {
1009 return 0;
1010 }
1011
1015 virtual int32_t getNbTactics() noexcept
1016 {
1017 return 0;
1018 }
1019
1031 virtual char const* getTimingCacheID() noexcept
1032 {
1033 return nullptr;
1034 }
1035
1039 virtual int32_t getFormatCombinationLimit() noexcept
1040 {
1041 return kDEFAULT_FORMAT_COMBINATION_LIMIT;
1042 }
1043
1050 virtual char const* getMetadataString() noexcept
1051 {
1052 return nullptr;
1053 }
1054};
1055
1057{
1058public
1062 InterfaceInfo getInterfaceInfo() const noexcept override
1063 {
1064 return InterfaceInfo{"PLUGIN_V3ONE_RUNTIME", 1, 0};
1065 }
1066
1074 virtual int32_t setTactic(int32_t tactic) noexcept
1075 {
1076 return 0;
1077 }
1078
1097 virtual int32_t onShapeChange(
1098 PluginTensorDesc const* in, int32_t nbInputs, PluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
1099
1113 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
1114 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
1115
1135 virtual IPluginV3* attachToContext(IPluginResourceContext* context) noexcept = 0;
1136
1142
1146 virtual PluginFieldCollection const* getFieldsToSerialize() noexcept = 0;
1147};
1148} // 命名空间 v_1_0
1149
1150namespace v_2_0
1151{
1152
1154{
1155public
1156 InterfaceInfo getInterfaceInfo() const noexcept override
1157 {
1158 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 2, 0};
1159 }
1160
1190 virtual int32_t getAliasedInput(int32_t outputIndex) noexcept
1191 {
1192 return -1;
1193 }
1194};
1195
1196} // 命名空间 v_2_0
1197
1208
1220
1232
1241
1242namespace v_1_0
1243{
1245{
1246public
1254 virtual void reportLayerTime(char const* layerName, float ms) noexcept = 0;
1255
1256 virtual ~IProfiler() noexcept {}
1257};
1258} // 命名空间 v_1_0
1259
1272
1280enum class WeightsRole : int32_t
1281{
1282 kKERNEL = 0,
1283 kBIAS = 1,
1284 kSHIFT = 2,
1285 kSCALE = 3,
1286 kCONSTANT = 4,
1287 kANY = 5,
1288};
1289
1291template <>
1292constexpr inline int32_t EnumMax<WeightsRole>() noexcept
1293{
1294 return 6;
1295}
1296
1302enum class DeviceType : int32_t
1303{
1304 kGPU = 0,
1305 kDLA = 1,
1306};
1307
1309template <>
1310constexpr inline int32_t EnumMax<DeviceType>() noexcept
1311{
1312 return 2;
1313}
1314
1325enum class TempfileControlFlag : int32_t
1326{
1329
1334};
1335
1337template <>
1338constexpr inline int32_t EnumMax<TempfileControlFlag>() noexcept
1339{
1340 return 2;
1341}
1342
1349using TempfileControlFlags = uint32_t;
1350
1381enum class TensorFormat : int32_t
1382{
1388 kLINEAR = 0,
1389
1394 kCHW2 = 1,
1395
1399 kHWC8 = 2,
1400
1414 kCHW4 = 3,
1415
1423 kCHW16 = 4,
1424
1432 kCHW32 = 5,
1433
1438 kDHWC8 = 6,
1439
1444 kCDHW32 = 7,
1445
1449 kHWC = 8,
1450
1459 kDLA_LINEAR = 9,
1460
1474 kDLA_HWC4 = 10,
1475
1480 kHWC16 = 11,
1481
1486 kDHWC = 12
1487};
1488
1489namespace impl
1490{
1492template <>
1494{
1496 static constexpr int32_t kVALUE = 13;
1497};
1498} // 命名空间 impl
1499
1505enum class AllocatorFlag : int32_t
1506{
1508 kRESIZABLE = 0,
1509};
1510
1511namespace impl
1512{
1514template <>
1516{
1518 static constexpr int32_t kVALUE = 1;
1519};
1520} // 命名空间 impl
1521
1522using AllocatorFlags = uint32_t;
1523
1526
1540{
1541public
1547 enum class Severity : int32_t
1548 {
1550 kINTERNAL_ERROR = 0,
1552 kERROR = 1,
1554 kWARNING = 2,
1556 kINFO = 3,
1558 kVERBOSE = 4,
1559 };
1560
1579 virtual void log(Severity severity, AsciiChar const* msg) noexcept = 0;
1580
1581 ILogger() = default;
1582 virtual ~ILogger() = default;
1583
1584protected
1585 // @cond SuppressDoxyWarnings
1586 ILogger(ILogger const&) = default;
1587 ILogger(ILogger&&) = default;
1588 ILogger& operator=(ILogger const&) & = default;
1589 ILogger& operator=(ILogger&&) & = default;
1590 // @endcond
1591};
1592
1593namespace impl
1594{
1596template <>
1597struct EnumMaxImpl<ILogger::Severity>
1598{
1600 static constexpr int32_t kVALUE = 5;
1601};
1602} // 命名空间 impl
1603
1604namespace v_1_0
1605{
1606
1608{
1609public
1635 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept = 0;
1636
1637 ~IGpuAllocator() override = default;
1638 IGpuAllocator() = default;
1639
1677 virtual void* reallocate(void* const /*baseAddr*/, uint64_t /*alignment*/, uint64_t /*newSize*/) noexcept
1678 {
1679 return nullptr;
1680 }
1681
1700 TRT_DEPRECATED virtual bool deallocate(void* const memory) noexcept = 0;
1701
1730 virtual void* allocateAsync(
1731 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t /*stream*/) noexcept
1732 {
1733 return allocate(size, alignment, flags);
1734 }
1763 virtual bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept
1764 {
1765 return deallocate(memory);
1766 }
1767
1771 InterfaceInfo getInterfaceInfo() const noexcept override
1772 {
1773 return {"IGpuAllocator", 1, 0};
1774 }
1775
1776protected
1777 // @cond SuppressDoxyWarnings
1778 IGpuAllocator(IGpuAllocator const&) = default;
1779 IGpuAllocator(IGpuAllocator&&) = default;
1780 IGpuAllocator& operator=(IGpuAllocator const&) & = default;
1781 IGpuAllocator& operator=(IGpuAllocator&&) & = default;
1782 // @endcond
1783};
1784
1785} // namespace v_1_0
1786
1808
1816class IRuntime : public INoCopy
1817{
1818public
1819 virtual ~IRuntime() noexcept = default;
1820
1832 void setDLACore(int32_t dlaCore) noexcept
1833 {
1834 mImpl->setDLACore(dlaCore);
1835 }
1836
1842 int32_t getDLACore() const noexcept
1843 {
1844 return mImpl->getDLACore();
1845 }
1846
1850 int32_t getNbDLACores() const noexcept
1851 {
1852 return mImpl->getNbDLACores();
1853 }
1854
1865 void setGpuAllocator(IGpuAllocator* allocator) noexcept
1866 {
1867 mImpl->setGpuAllocator(allocator);
1868 }
1869
1881 //
1884 void setErrorRecorder(IErrorRecorder* recorder) noexcept
1885 {
1886 mImpl->setErrorRecorder(recorder);
1887 }
1888
1900 {
1901 return mImpl->getErrorRecorder();
1902 }
1903
1914 ICudaEngine* deserializeCudaEngine(void const* blob, std::size_t size) noexcept
1915 {
1916 return mImpl->deserializeCudaEngine(blob, size);
1917 }
1918
1936 {
1937 return mImpl->deserializeCudaEngine(streamReader);
1938 }
1939
1957 {
1958 return mImpl->deserializeCudaEngineV2(streamReader);
1959 }
1960
1966 ILogger* getLogger() const noexcept
1967 {
1968 return mImpl->getLogger();
1969 }
1970
1981 bool setMaxThreads(int32_t maxThreads) noexcept
1982 {
1983 return mImpl->setMaxThreads(maxThreads);
1984 }
1985
1995 int32_t getMaxThreads() const noexcept
1996 {
1997 return mImpl->getMaxThreads();
1998 }
1999
2030 void setTemporaryDirectory(char const* path) noexcept
2031 {
2032 return mImpl->setTemporaryDirectory(path);
2033 }
2034
2041 char const* getTemporaryDirectory() const noexcept
2042 {
2043 return mImpl->getTemporaryDirectory();
2044 }
2045
2058 {
2059 return mImpl->setTempfileControlFlags(flags);
2060 }
2061
2070 {
2071 return mImpl->getTempfileControlFlags();
2072 }
2073
2080 {
2081 return mImpl->getPluginRegistry();
2082 }
2083
2097 IRuntime* loadRuntime(char const* path) noexcept
2098 {
2099 return mImpl->loadRuntime(path);
2100 }
2101
2109 void setEngineHostCodeAllowed(bool allowed) noexcept
2110 {
2111 return mImpl->setEngineHostCodeAllowed(allowed);
2112 }
2113
2119 bool getEngineHostCodeAllowed() const noexcept
2120 {
2121 return mImpl->getEngineHostCodeAllowed();
2122 }
2123
2124protected
2125 apiv::VRuntime* mImpl;
2126};
2127
2135class IRefitter : public INoCopy
2136{
2137public
2138 virtual ~IRefitter() noexcept = default;
2139
2155 bool setWeights(char const* layerName, WeightsRole role, Weights weights) noexcept
2156 {
2157 return mImpl->setWeights(layerName, role, weights);
2158 }
2159
2172 bool refitCudaEngine() noexcept
2173 {
2174 return mImpl->refitCudaEngine();
2175 }
2176
2193 int32_t getMissing(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2194 {
2195 return mImpl->getMissing(size, layerNames, roles);
2196 }
2197
2210 int32_t getAll(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2211 {
2212 return mImpl->getAll(size, layerNames, roles);
2213 }
2214
2232 TRT_DEPRECATED bool setDynamicRange(char const* tensorName, float min, float max) noexcept
2233 {
2234 return mImpl->setDynamicRange(tensorName, min, max);
2235 }
2236
2248 TRT_DEPRECATED float getDynamicRangeMin(char const* tensorName) const noexcept
2249 {
2250 return mImpl->getDynamicRangeMin(tensorName);
2251 }
2252
2264 TRT_DEPRECATED float getDynamicRangeMax(char const* tensorName) const noexcept
2265 {
2266 return mImpl->getDynamicRangeMax(tensorName);
2267 }
2268
2282 TRT_DEPRECATED int32_t getTensorsWithDynamicRange(int32_t size, char const** tensorNames) const noexcept
2283 {
2284 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
2285 }
2286
2298 //
2301 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2302 {
2303 mImpl->setErrorRecorder(recorder);
2304 }
2305
2317 {
2318 return mImpl->getErrorRecorder();
2319 }
2320
2341 bool setNamedWeights(char const* name, Weights weights) noexcept
2342 {
2343 return mImpl->setNamedWeights(name, weights);
2344 }
2345
2361 int32_t getMissingWeights(int32_t size, char const** weightsNames) noexcept
2362 {
2363 return mImpl->getMissingWeights(size, weightsNames);
2364 }
2365
2377 int32_t getAllWeights(int32_t size, char const** weightsNames) noexcept
2378 {
2379 return mImpl->getAllWeights(size, weightsNames);
2380 }
2381
2387 ILogger* getLogger() const noexcept
2388 {
2389 return mImpl->getLogger();
2390 }
2391
2403 bool setMaxThreads(int32_t maxThreads) noexcept
2404 {
2405 return mImpl->setMaxThreads(maxThreads);
2406 }
2407
2417 int32_t getMaxThreads() const noexcept
2418 {
2419 return mImpl->getMaxThreads();
2420 }
2421
2444 bool setNamedWeights(char const* name, Weights weights, TensorLocation location) noexcept
2445 {
2446 return mImpl->setNamedWeightsWithLocation(name, weights, location);
2447 }
2448
2460 Weights getNamedWeights(char const* weightsName) const noexcept
2461 {
2462 return mImpl->getNamedWeights(weightsName);
2463 }
2464
2476 TensorLocation getWeightsLocation(char const* weightsName) const noexcept
2477 {
2478 return mImpl->getWeightsLocation(weightsName);
2479 }
2480
2492 bool unsetNamedWeights(char const* weightsName) noexcept
2493 {
2494 return mImpl->unsetNamedWeights(weightsName);
2495 }
2496
2508 void setWeightsValidation(bool weightsValidation) noexcept
2509 {
2510 return mImpl->setWeightsValidation(weightsValidation);
2511 }
2512
2516 bool getWeightsValidation() const noexcept
2517 {
2518 return mImpl->getWeightsValidation();
2519 }
2520
2538 bool refitCudaEngineAsync(cudaStream_t stream) noexcept
2539 {
2540 return mImpl->refitCudaEngineAsync(stream);
2541 }
2542
2556 Weights getWeightsPrototype(char const* weightsName) const noexcept
2557 {
2558 return mImpl->getWeightsPrototype(weightsName);
2559 }
2560
2561protected
2562 apiv::VRefitter* mImpl;
2563};
2564
2575enum class OptProfileSelector : int32_t
2576{
2577 kMIN = 0,
2578 kOPT = 1,
2579 kMAX = 2
2580};
2581
2587template <>
2588constexpr inline int32_t EnumMax<OptProfileSelector>() noexcept
2589{
2590 return 3;
2591}
2592
2616{
2617public
2645 bool setDimensions(char const* inputName, OptProfileSelector select, Dims const& dims) noexcept
2646 {
2647 return mImpl->setDimensions(inputName, select, dims);
2648 }
2649
2657 Dims getDimensions(char const* inputName, OptProfileSelector select) const noexcept
2658 {
2659 return mImpl->getDimensions(inputName, select);
2660 }
2661
2705 char const* inputName, OptProfileSelector select, int32_t const* values, int32_t nbValues) noexcept
2706 {
2707 return mImpl->setShapeValues(inputName, select, values, nbValues);
2708 }
2709
2718 int32_t getNbShapeValues(char const* inputName) const noexcept
2719 {
2720 return mImpl->getNbShapeValues(inputName);
2721 }
2722
2730 int32_t const* getShapeValues(char const* inputName, OptProfileSelector select) const noexcept
2731 {
2732 return mImpl->getShapeValues(inputName, select);
2733 }
2734
2748 bool setExtraMemoryTarget(float target) noexcept
2749 {
2750 return mImpl->setExtraMemoryTarget(target);
2751 }
2752
2760 float getExtraMemoryTarget() const noexcept
2761 {
2762 return mImpl->getExtraMemoryTarget();
2763 }
2764
2777 bool isValid() const noexcept
2778 {
2779 return mImpl->isValid();
2780 }
2781
2782protected
2783 apiv::VOptimizationProfile* mImpl;
2784 virtual ~IOptimizationProfile() noexcept = default;
2785};
2786
2794enum class TacticSource : int32_t
2795{
2800
2804
2809
2814
2818};
2819
2820template <>
2821constexpr inline int32_t EnumMax<TacticSource>() noexcept
2822{
2823 return 5;
2824}
2825
2832using TacticSources = uint32_t;
2833
2843enum class ProfilingVerbosity : int32_t
2844{
2846 kNONE = 1,
2847 kDETAILED = 2,
2848};
2849
2851template <>
2852constexpr inline int32_t EnumMax<ProfilingVerbosity>() noexcept
2853{
2854 return 3;
2855}
2856
2863using SerializationFlags = uint32_t;
2864
2872enum class SerializationFlag : int32_t
2873{
2874 kEXCLUDE_WEIGHTS = 0,
2876};
2877
2879template <>
2880constexpr inline int32_t EnumMax<SerializationFlag>() noexcept
2881{
2882 return 2;
2883}
2884
2893{
2894public
2895 virtual ~ISerializationConfig() noexcept = default;
2896
2908 bool setFlags(SerializationFlags serializationFlags) noexcept
2909 {
2910 return mImpl->setFlags(serializationFlags);
2911 }
2912
2921 {
2922 return mImpl->getFlags();
2923 }
2924
2932 bool clearFlag(SerializationFlag serializationFlag) noexcept
2933 {
2934 return mImpl->clearFlag(serializationFlag);
2935 }
2936
2944 bool setFlag(SerializationFlag serializationFlag) noexcept
2945 {
2946 return mImpl->setFlag(serializationFlag);
2947 }
2948
2956 bool getFlag(SerializationFlag serializationFlag) const noexcept
2957 {
2958 return mImpl->getFlag(serializationFlag);
2959 }
2960
2961protected
2962 apiv::VSerializationConfig* mImpl;
2963};
2964
2977{
2978 kSTATIC = 0,
2980 kUSER_MANAGED = 2,
2981};
2982
2988template <>
2989constexpr inline int32_t EnumMax<ExecutionContextAllocationStrategy>() noexcept
2990{
2991 return 3;
2992}
2993
3001class ICudaEngine : public INoCopy
3002{
3003public
3004 virtual ~ICudaEngine() noexcept = default;
3005
3016 Dims getTensorShape(char const* tensorName) const noexcept
3017 {
3018 return mImpl->getTensorShape(tensorName);
3019 }
3020
3031 DataType getTensorDataType(char const* tensorName) const noexcept
3032 {
3033 return mImpl->getTensorDataType(tensorName);
3034 }
3035
3045 int32_t getNbLayers() const noexcept
3046 {
3047 return mImpl->getNbLayers();
3048 }
3049
3059 IHostMemory* serialize() const noexcept
3060 {
3061 return mImpl->serialize();
3062 }
3063
3078 {
3079 return mImpl->createExecutionContext(strategy);
3080 }
3081
3094 TensorLocation getTensorLocation(char const* tensorName) const noexcept
3095 {
3096 return mImpl->getTensorLocation(tensorName);
3097 }
3098
3114 bool isShapeInferenceIO(char const* tensorName) const noexcept
3115 {
3116 return mImpl->isShapeInferenceIO(tensorName);
3117 }
3118
3128 TensorIOMode getTensorIOMode(char const* tensorName) const noexcept
3129 {
3130 return mImpl->getTensorIOMode(tensorName);
3131 }
3132
3141 {
3142 return mImpl->createExecutionContextWithoutDeviceMemory();
3143 }
3144
3152 TRT_DEPRECATED size_t getDeviceMemorySize() const noexcept
3153 {
3154 return mImpl->getDeviceMemorySize();
3155 }
3156
3164 TRT_DEPRECATED size_t getDeviceMemorySizeForProfile(int32_t profileIndex) const noexcept
3165 {
3166 return mImpl->getDeviceMemorySizeForProfile(profileIndex);
3167 }
3168
3180 int64_t getDeviceMemorySizeV2() const noexcept
3181 {
3182 return mImpl->getDeviceMemorySizeV2();
3183 }
3184
3196 int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
3197 {
3198 return mImpl->getDeviceMemorySizeForProfileV2(profileIndex);
3199 }
3200
3206 bool isRefittable() const noexcept
3207 {
3208 return mImpl->isRefittable();
3209 }
3210
3227 int32_t getTensorBytesPerComponent(char const* tensorName) const noexcept
3228 {
3229 return mImpl->getTensorBytesPerComponent(tensorName);
3230 }
3231
3245 int32_t getTensorBytesPerComponent(char const* tensorName, int32_t profileIndex) const noexcept
3246 {
3247 return mImpl->getTensorBytesPerComponentV2(tensorName, profileIndex);
3248 }
3249
3266 int32_t getTensorComponentsPerElement(char const* tensorName) const noexcept
3267 {
3268 return mImpl->getTensorComponentsPerElement(tensorName);
3269 }
3270
3284 int32_t getTensorComponentsPerElement(char const* tensorName, int32_t profileIndex) const noexcept
3285 {
3286 return mImpl->getTensorComponentsPerElementV2(tensorName, profileIndex);
3287 }
3288
3299 TensorFormat getTensorFormat(char const* tensorName) const noexcept
3300 {
3301 return mImpl->getTensorFormat(tensorName);
3302 }
3303
3313 TensorFormat getTensorFormat(char const* tensorName, int32_t profileIndex) const noexcept
3314 {
3315 return mImpl->getTensorFormatV2(tensorName, profileIndex);
3316 }
3317
3337 char const* getTensorFormatDesc(char const* tensorName) const noexcept
3338 {
3339 return mImpl->getTensorFormatDesc(tensorName);
3340 }
3341
3360 char const* getTensorFormatDesc(char const* tensorName, int32_t profileIndex) const noexcept
3361 {
3362 return mImpl->getTensorFormatDescV2(tensorName, profileIndex);
3363 }
3364
3377 int32_t getTensorVectorizedDim(char const* tensorName) const noexcept
3378 {
3379 return mImpl->getTensorVectorizedDim(tensorName);
3380 }
3381
3393 int32_t getTensorVectorizedDim(char const* tensorName, int32_t profileIndex) const noexcept
3394 {
3395 return mImpl->getTensorVectorizedDimV2(tensorName, profileIndex);
3396 }
3397
3408 char const* getName() const noexcept
3409 {
3410 return mImpl->getName();
3411 }
3412
3419 int32_t getNbOptimizationProfiles() const noexcept
3420 {
3421 return mImpl->getNbOptimizationProfiles();
3422 }
3423
3439 Dims getProfileShape(char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
3440 {
3441 return mImpl->getProfileShape(tensorName, profileIndex, select);
3442 }
3443
3461 int32_t const* getProfileTensorValues(char const* tensorName, int32_t profileIndex, OptProfileSelector select) const
3462 noexcept
3463 {
3464 return mImpl->getProfileTensorValues(tensorName, profileIndex, select);
3465 }
3466
3478 {
3479 return mImpl->getEngineCapability();
3480 }
3481
3496 void setErrorRecorder(IErrorRecorder* recorder) noexcept
3497 {
3498 return mImpl->setErrorRecorder(recorder);
3499 }
3500
3512 {
3513 return mImpl->getErrorRecorder();
3514 }
3515
3526 {
3527 return mImpl->hasImplicitBatchDimension();
3528 }
3529
3542 {
3543 return mImpl->getTacticSources();
3544 }
3545
3554 {
3555 return mImpl->getProfilingVerbosity();
3556 }
3557
3564 {
3565 return mImpl->createEngineInspector();
3566 }
3567
3576 int32_t getNbIOTensors() const noexcept
3577 {
3578 return mImpl->getNbIOTensors();
3579 }
3580
3588 char const* getIOTensorName(int32_t index) const noexcept
3589 {
3590 return mImpl->getIOTensorName(index);
3591 }
3592
3602 {
3603 return mImpl->getHardwareCompatibilityLevel();
3604 }
3605
3616 int32_t getNbAuxStreams() const noexcept
3617 {
3618 return mImpl->getNbAuxStreams();
3619 }
3620
3627 {
3628 return mImpl->createSerializationConfig();
3629 }
3630
3643 {
3644 return mImpl->serializeWithConfig(config);
3645 }
3646
3687 TRT_DEPRECATED bool setWeightStreamingBudget(int64_t gpuMemoryBudget) noexcept
3688 {
3689 return mImpl->setWeightStreamingBudget(gpuMemoryBudget);
3690 }
3691
3708 {
3709 return mImpl->getWeightStreamingBudget();
3710 }
3711
3731 {
3732 return mImpl->getMinimumWeightStreamingBudget();
3733 }
3734
3746 int64_t getStreamableWeightsSize() const noexcept
3747 {
3748 return mImpl->getStreamableWeightsSize();
3749 }
3750
3788 bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
3789 {
3790 return mImpl->setWeightStreamingBudgetV2(gpuMemoryBudget);
3791 }
3792
3806 int64_t getWeightStreamingBudgetV2() const noexcept
3807 {
3808 return mImpl->getWeightStreamingBudgetV2();
3809 }
3810
3831 int64_t getWeightStreamingAutomaticBudget() const noexcept
3832 {
3833 return mImpl->getWeightStreamingAutomaticBudget();
3834 }
3835
3860 {
3861 return mImpl->getWeightStreamingScratchMemorySize();
3862 }
3863
3873 bool isDebugTensor(char const* name) const noexcept
3874 {
3875 return mImpl->isDebugTensor(name);
3876 }
3877
3878protected
3879 apiv::VCudaEngine* mImpl;
3880};
3881
3882namespace v_1_0
3883{
3885{
3886public
3890 InterfaceInfo getInterfaceInfo() const noexcept override
3891 {
3892 return {"IOutputAllocator", 1, 0};
3893 }
3894
3915 char const* tensorName, void* currentMemory, uint64_t size, uint64_t alignment) noexcept
3916 {
3917 return nullptr;
3918 }
3919
3943 char const* tensorName, void* currentMemory, uint64_t size, uint64_t alignment, cudaStream_t /*stream*/)
3944 {
3945 return reallocateOutput(tensorName, currentMemory, size, alignment);
3946 }
3947
3956 virtual void notifyShape(char const* tensorName, Dims const& dims) noexcept = 0;
3957};
3958} // namespace v_1_0
3959
3968
3969namespace v_1_0
3970{
3972{
3973public
3977 InterfaceInfo getInterfaceInfo() const noexcept override
3978 {
3979 return {"IDebugListener", 1, 0};
3980 }
3981
3995 virtual bool processDebugTensor(void const* addr, TensorLocation location, DataType type, Dims const& shape,
3996 char const* name, cudaStream_t stream)
3997 = 0;
3998
3999 ~IDebugListener() override = default;
4000};
4001} // namespace v_1_0 命名空间 v_1_0
4002
4009
4021{
4022public
4023 virtual ~IExecutionContext() noexcept = default;
4024
4033 void setDebugSync(bool sync) noexcept
4034 {
4035 mImpl->setDebugSync(sync);
4036 }
4037
4043 bool getDebugSync() const noexcept
4044 {
4045 return mImpl->getDebugSync();
4046 }
4047
4053 void setProfiler(IProfiler* profiler) noexcept
4054 {
4055 mImpl->setProfiler(profiler);
4056 }
4057
4063 IProfiler* getProfiler() const noexcept
4064 {
4065 return mImpl->getProfiler();
4066 }
4067
4073 ICudaEngine const& getEngine() const noexcept
4074 {
4075 return mImpl->getEngine();
4076 }
4077
4087 void setName(char const* name) noexcept
4088 {
4089 mImpl->setName(name);
4090 }
4091
4097 char const* getName() const noexcept
4098 {
4099 return mImpl->getName();
4100 }
4101
4124 void setDeviceMemory(void* memory) noexcept
4125 {
4126 mImpl->setDeviceMemory(memory);
4127 }
4128
4146 void setDeviceMemoryV2(void* memory, int64_t size) noexcept
4147 {
4148 return mImpl->setDeviceMemoryV2(memory, size);
4149 }
4150
4167 Dims getTensorStrides(char const* tensorName) const noexcept
4168 {
4169 return mImpl->getTensorStrides(tensorName);
4170 }
4171
4172public
4182 int32_t getOptimizationProfile() const noexcept
4183 {
4184 return mImpl->getOptimizationProfile();
4185 }
4186
4200 bool setInputShape(char const* tensorName, Dims const& dims) noexcept
4201 {
4202 return mImpl->setInputShape(tensorName, dims);
4203 }
4204
4237 Dims getTensorShape(char const* tensorName) const noexcept
4238 {
4239 return mImpl->getTensorShape(tensorName);
4240 }
4241
4253 bool allInputDimensionsSpecified() const noexcept
4254 {
4255 return mImpl->allInputDimensionsSpecified();
4256 }
4257
4271 {
4272 return mImpl->allInputShapesSpecified();
4273 }
4274
4289 void setErrorRecorder(IErrorRecorder* recorder) noexcept
4290 {
4291 mImpl->setErrorRecorder(recorder);
4292 }
4293
4305 {
4306 return mImpl->getErrorRecorder();
4307 }
4308
4321 bool executeV2(void* const* bindings) noexcept
4322 {
4323 return mImpl->executeV2(bindings);
4324 }
4325
4365 bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
4366 {
4367 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
4368 }
4369
4381 void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
4382 {
4383 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
4384 }
4385
4393 bool getEnqueueEmitsProfile() const noexcept
4394 {
4395 return mImpl->getEnqueueEmitsProfile();
4396 }
4397
4423 bool reportToProfiler() const noexcept
4424 {
4425 return mImpl->reportToProfiler();
4426 }
4427
4467 bool setTensorAddress(char const* tensorName, void* data) noexcept
4468 {
4469 return mImpl->setTensorAddress(tensorName, data);
4470 }
4471
4484 void const* getTensorAddress(char const* tensorName) const noexcept
4485 {
4486 return mImpl->getTensorAddress(tensorName);
4487 }
4488
4507 bool setOutputTensorAddress(char const* tensorName, void* data) noexcept
4508 {
4509 return mImpl->setOutputTensorAddress(tensorName, data);
4510 }
4511
4529 bool setInputTensorAddress(char const* tensorName, void const* data) noexcept
4530 {
4531 return mImpl->setInputTensorAddress(tensorName, data);
4532 }
4533
4548 void* getOutputTensorAddress(char const* tensorName) const noexcept
4549 {
4550 return mImpl->getOutputTensorAddress(tensorName);
4551 }
4552
4581 int32_t inferShapes(int32_t nbMaxNames, char const** tensorNames) noexcept
4582 {
4583 return mImpl->inferShapes(nbMaxNames, tensorNames);
4584 }
4585
4599 {
4600 return mImpl->updateDeviceMemorySizeForShapes();
4601 }
4602
4614 bool setInputConsumedEvent(cudaEvent_t event) noexcept
4615 {
4616 return mImpl->setInputConsumedEvent(event);
4617 }
4618
4624 cudaEvent_t getInputConsumedEvent() const noexcept
4625 {
4626 return mImpl->getInputConsumedEvent();
4627 }
4628
4643 bool setOutputAllocator(char const* tensorName, IOutputAllocator* outputAllocator) noexcept
4644 {
4645 return mImpl->setOutputAllocator(tensorName, outputAllocator);
4646 }
4647
4656 IOutputAllocator* getOutputAllocator(char const* tensorName) const noexcept
4657 {
4658 return mImpl->getOutputAllocator(tensorName);
4659 }
4660
4674 int64_t getMaxOutputSize(char const* tensorName) const noexcept
4675 {
4676 return mImpl->getMaxOutputSize(tensorName);
4677 }
4678
4695 {
4696 return mImpl->setTemporaryStorageAllocator(allocator);
4697 }
4698
4705 {
4706 return mImpl->getTemporaryStorageAllocator();
4707 }
4708
4728 bool enqueueV3(cudaStream_t stream) noexcept
4729 {
4730 return mImpl->enqueueV3(stream);
4731 }
4732
4744 void setPersistentCacheLimit(size_t size) noexcept
4745 {
4746 mImpl->setPersistentCacheLimit(size);
4747 }
4748
4755 size_t getPersistentCacheLimit() const noexcept
4756 {
4757 return mImpl->getPersistentCacheLimit();
4758 }
4759
4779 bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
4780 {
4781 return mImpl->setNvtxVerbosity(verbosity);
4782 }
4783
4792 {
4793 return mImpl->getNvtxVerbosity();
4794 }
4795
4822 void setAuxStreams(cudaStream_t* auxStreams, int32_t nbStreams) noexcept
4823 {
4824 mImpl->setAuxStreams(auxStreams, nbStreams);
4825 }
4826
4834 bool setDebugListener(IDebugListener* listener) noexcept
4835 {
4836 return mImpl->setDebugListener(listener);
4837 }
4838
4845 {
4846 return mImpl->getDebugListener();
4847 }
4848
4863 bool setTensorDebugState(char const* name, bool flag) noexcept
4864 {
4865 return mImpl->setTensorDebugState(name, flag);
4866 }
4867
4876 bool setAllTensorsDebugState(bool flag) noexcept
4877 {
4878 return mImpl->setAllTensorsDebugState(flag);
4879 }
4880
4886 bool getDebugState(char const* name) const noexcept
4887 {
4888 return mImpl->getDebugState(name);
4889 }
4890
4891protected
4892 apiv::VExecutionContext* mImpl;
4893}; // class IExecutionContext 类 IExecutionContext
4894
4902enum class LayerInformationFormat : int32_t
4903{
4904 kONELINE = 0,
4905 kJSON = 1,
4906};
4907
4910template <>
4911constexpr inline int32_t EnumMax<LayerInformationFormat>() noexcept
4912{
4913 return 2;
4914}
4915
4932{
4933public
4934 virtual ~IEngineInspector() noexcept = default;
4935
4948 bool setExecutionContext(IExecutionContext const* context) noexcept
4949 {
4950 return mImpl->setExecutionContext(context);
4951 }
4952
4961 {
4962 return mImpl->getExecutionContext();
4963 }
4964
4985 char const* getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
4986 {
4987 return mImpl->getLayerInformation(layerIndex, format);
4988 }
4989
5008 char const* getEngineInformation(LayerInformationFormat format) const noexcept
5009 {
5010 return mImpl->getEngineInformation(format);
5011 }
5012
5027 void setErrorRecorder(IErrorRecorder* recorder) noexcept
5028 {
5029 mImpl->setErrorRecorder(recorder);
5030 }
5031
5043 {
5044 return mImpl->getErrorRecorder();
5045 }
5046
5047protected
5048 apiv::VEngineInspector* mImpl;
5049}; // class IEngineInspector 类 IEngineInspector
5050
5051} // namespace nvinfer1 命名空间 nvinfer1
5052
5057extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
5058
5063extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
5064
5069
5075extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
5076
5077namespace nvinfer1
5078{
5079namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this 未命名的命名空间避免了在链接使用此头文件不同版本构建的对象时出现链接意外。
5080 // header.
5081{
5087inline IRuntime* createInferRuntime(ILogger& logger) noexcept
5088{
5089 return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
5090}
5091
5097inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
5098{
5099 return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
5100}
5101
5102} // namespace 命名空间
5103
5115template <typename T>
5117{
5118public
5120 {
5121 getPluginRegistry()->registerCreator(instance, "");
5122 }
5123
5124private
5126 T instance{};
5127};
5128
5129} // namespace nvinfer1
5130
5131#define REGISTER_TENSORRT_PLUGIN(name) \
5132 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
5133
5134namespace nvinfer1
5135{
5145{
5146public
5154 virtual ILogger* findLogger() = 0;
5155
5156protected
5157 virtual ~ILoggerFinder() = default;
5158};
5159
5162namespace v_1_0
5163{
5164
5166{
5167public
5169 ~IGpuAsyncAllocator() override = default;
5170
5200 void* allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags,
5201 cudaStream_t /*stream*/) noexcept override = 0;
5202
5228 bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept override = 0;
5229
5253 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept override
5254 {
5255 return allocateAsync(size, alignment, flags, nullptr);
5256 }
5257
5276 TRT_DEPRECATED bool deallocate(void* const memory) noexcept override
5277 {
5278 return deallocateAsync(memory, nullptr);
5279 }
5280
5284 InterfaceInfo getInterfaceInfo() const noexcept override
5285 {
5286 return {"IGpuAllocator", 1, 0};
5287 }
5288};
5289
5291{
5292public
5296 InterfaceInfo getInterfaceInfo() const noexcept override
5297 {
5298 return InterfaceInfo{"PLUGIN CREATOR_V3ONE", 1, 0};
5299 }
5300
5318 AsciiChar const* name, PluginFieldCollection const* fc, TensorRTPhase phase) noexcept = 0;
5319
5326 virtual PluginFieldCollection const* getFieldNames() noexcept = 0;
5327
5334 virtual AsciiChar const* getPluginName() const noexcept = 0;
5335
5342 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
5343
5350 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
5351
5353 virtual ~IPluginCreatorV3One() = default;
5354
5355protected
5358 IPluginCreatorV3One& operator=(IPluginCreatorV3One const&) & = default;
5359 IPluginCreatorV3One& operator=(IPluginCreatorV3One&&) & = default;
5360};
5361
5362} // namespace v_1_0
5363
5378
5388
5389} // namespace nvinfer1
5390
5394extern "C" TENSORRTAPI int32_t getInferLibMajorVersion() noexcept;
5398extern "C" TENSORRTAPI int32_t getInferLibMinorVersion() noexcept;
5402extern "C" TENSORRTAPI int32_t getInferLibPatchVersion() noexcept;
5406extern "C" TENSORRTAPI int32_t getInferLibBuildVersion() noexcept;
5407
5408#endif // NV_INFER_RUNTIME_H
nvinfer1::ILogger * getLogger() noexcept
返回 logger 对象。
int32_t getInferLibMajorVersion() noexcept
返回库主版本号。
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
返回插件注册表。
int32_t getInferLibPatchVersion() noexcept
返回库补丁版本号。
int32_t getInferLibMinorVersion() noexcept
返回库次版本号。
int32_t getInferLibBuildVersion() noexcept
返回库构建版本号。
#define TENSORRTAPI
定义: NvInferRuntimeBase.h:59
#define NV_TENSORRT_VERSION
定义: NvInferRuntimeBase.h:91
#define TRT_DEPRECATED
定义: NvInferRuntimeBase.h:45
#define TRT_DEPRECATED_ENUM
定义: NvInferRuntimeBase.h:46
定义张量维度的结构体。
定义: NvInferRuntimeBase.h:203
static constexpr int32_t MAX_DIMS
张量支持的最大秩(维度数量)。
定义: NvInferRuntimeBase.h:206
Dims 类的模拟,使用表达式代替常量来表示维度。
定义: NvInferRuntime.h:350
IDimensionExpr const * d[Dims::MAX_DIMS]
每个维度的范围。
定义: NvInferRuntime.h:353
int32_t nbDims
维度的数量。
定义: NvInferRuntime.h:352
用于在已构建的网络上执行推理的引擎,具有功能上不安全的功能。
定义: NvInferRuntime.h:3002
int32_t getTensorBytesPerComponent(char const *tensorName) const noexcept
返回一个元素中每个组件的字节数,如果张量未向量化或未提供,则返回 -1...
定义: NvInferRuntime.h:3227
ISerializationConfig * createSerializationConfig() noexcept
创建一个序列化配置对象。
定义: NvInferRuntime.h:3626
TRT_DEPRECATED int64_t getWeightStreamingBudget() const noexcept
以字节为单位返回当前权重流设备内存预算。
定义: NvInferRuntime.h:3707
int32_t const * getProfileTensorValues(char const *tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
获取给定名称的输入张量在某个优化配置下的最小/最佳/最大值(非维度)...
定义: NvInferRuntime.h:3461
char const * getIOTensorName(int32_t index) const noexcept
返回 IO 张量的名称。
定义: NvInferRuntime.h:3588
int64_t getWeightStreamingBudgetV2() const noexcept
以字节为单位返回当前权重流设备内存预算。
定义: NvInferRuntime.h:3806
EngineCapability getEngineCapability() const noexcept
确定此引擎具有的执行能力。
定义: NvInferRuntime.h:3477
IErrorRecorder * getErrorRecorder() const noexcept
获取分配给此接口的 ErrorRecorder。
定义: NvInferRuntime.h:3511
TensorFormat getTensorFormat(char const *tensorName, int32_t profileIndex) const noexcept
返回给定配置的张量格式,如果提供的名称未映射到...
定义: NvInferRuntime.h:3313
TRT_DEPRECATED bool hasImplicitBatchDimension() const noexcept
查询引擎是否使用隐式批次维度构建。
定义: NvInferRuntime.h:3525
apiv::VCudaEngine * mImpl
定义: NvInferRuntime.h:3879
TRT_DEPRECATED size_t getDeviceMemorySizeForProfile(int32_t profileIndex) const noexcept
返回配置文件的上下文所需的最大设备内存。
定义: NvInferRuntime.h:3164
IExecutionContext * createExecutionContext(ExecutionContextAllocationStrategy strategy=ExecutionContextAllocationStrategy::kSTATIC) noexcept
创建一个执行上下文并指定用于分配内部激活内存的策略。
定义: NvInferRuntime.h:3076
char const * getTensorFormatDesc(char const *tensorName) const noexcept
返回张量格式的人类可读描述,如果提供的名称不映射到...
定义: NvInferRuntime.h:3337
Dims getProfileShape(char const *tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
获取给定名称的输入张量在优化下的最小/最佳/最大维度...
定义: NvInferRuntime.h:3439
bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
限制网络权重可用的最大 GPU 内存量(以字节为单位)。
定义: NvInferRuntime.h:3788
int32_t getNbAuxStreams() const noexcept
返回此引擎使用的辅助流的数量。
定义: NvInferRuntime.h:3616
int64_t getStreamableWeightsSize() const noexcept
获取所有可流式传输权重的总大小(以字节为单位)。
定义: NvInferRuntime.h:3746
DataType getTensorDataType(char const *tensorName) const noexcept
从张量名称确定缓冲区所需的数据类型。
定义: NvInferRuntime.h:3031
void setErrorRecorder(IErrorRecorder *recorder) noexcept
为此接口设置 ErrorRecorder。
定义: NvInferRuntime.h:3496
TacticSources getTacticSources() const noexcept
返回此引擎所需的策略源。
定义: NvInferRuntime.h:3541
IHostMemory * serializeWithConfig(ISerializationConfig &config) const noexcept
使用提供的 SerializationConfig 将网络序列化到流中。
定义: NvInferRuntime.h:3642
virtual ~ICudaEngine() noexcept=default
int64_t getWeightStreamingAutomaticBudget() const noexcept
TensorRT 自动确定模型运行的设备内存预算。预算接近于...
定义: NvInferRuntime.h:3831
bool isDebugTensor(char const *name) const noexcept
检查张量是否标记为调试张量。
定义: NvInferRuntime.h:3873
int32_t getTensorVectorizedDim(char const *tensorName, int32_t profileIndex) const noexcept
返回给定配置的缓冲区向量化的维度索引,如果提供的名称...
定义: NvInferRuntime.h:3393
char const * getName() const noexcept
返回与引擎关联的网络的名称。
定义: NvInferRuntime.h:3408
ProfilingVerbosity getProfilingVerbosity() const noexcept
返回构建引擎时构建器配置设置的 ProfilingVerbosity。
定义: NvInferRuntime.h:3553
bool isShapeInferenceIO(char const *tensorName) const noexcept
如果张量是形状计算所需的输入或形状计算的输出,则为 True。
定义: NvInferRuntime.h:3114
int64_t getWeightStreamingScratchMemorySize() const noexcept
返回当前权重流预算所需的暂存内存大小。
定义: NvInferRuntime.h:3859
TRT_DEPRECATED bool setWeightStreamingBudget(int64_t gpuMemoryBudget) noexcept
限制网络权重可用的最大 GPU 内存量(以字节为单位)。
定义: NvInferRuntime.h:3687
int64_t getDeviceMemorySizeV2() const noexcept
返回所有配置文件中上下文所需的最大设备内存。
定义: NvInferRuntime.h:3180
int32_t getTensorVectorizedDim(char const *tensorName) const noexcept
返回缓冲区向量化的维度索引,如果提供的名称未映射到 ...,则返回 -1。
定义: NvInferRuntime.h:3377
TRT_DEPRECATED size_t getDeviceMemorySize() const noexcept
返回所有配置文件中上下文所需的最大设备内存。
定义: NvInferRuntime.h:3152
int32_t getTensorComponentsPerElement(char const *tensorName, int32_t profileIndex) const noexcept
返回给定配置的元素中包含的组件数量,如果张量未向量化,则返回 -1...
定义: NvInferRuntime.h:3284
int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
返回配置文件的上下文所需的最大设备内存。
定义: NvInferRuntime.h:3196
TensorFormat getTensorFormat(char const *tensorName) const noexcept
返回张量格式,如果提供的名称未映射到输入或输出,则返回 TensorFormat::kLINEAR...
定义: NvInferRuntime.h:3299
IHostMemory * serialize() const noexcept
将网络序列化到流中。
定义: NvInferRuntime.h:3059
TensorLocation getTensorLocation(char const *tensorName) const noexcept
获取输入或输出张量是否必须在 GPU 或 CPU 上。
定义: NvInferRuntime.h:3094
IEngineInspector * createEngineInspector() const noexcept
创建一个新的引擎检查器,用于打印引擎或执行上下文中的层信息。
定义: NvInferRuntime.h:3563
int32_t getTensorBytesPerComponent(char const *tensorName, int32_t profileIndex) const noexcept
返回给定配置的元素中每个组件的字节数,如果张量是...
定义: NvInferRuntime.h:3245
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
返回此引擎的硬件兼容性级别。
定义: NvInferRuntime.h:3601
int32_t getNbOptimizationProfiles() const noexcept
获取为此引擎定义的优化配置文件的数量。
定义: NvInferRuntime.h:3419
TRT_DEPRECATED IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
创建一个不分配任何设备内存的执行上下文
定义: NvInferRuntime.h:3140
char const * getTensorFormatDesc(char const *tensorName, int32_t profileIndex) const noexcept
返回给定配置的张量格式的人类可读描述,如果 p...,则返回空字符串。
定义: NvInferRuntime.h:3360
TRT_DEPRECATED int64_t getMinimumWeightStreamingBudget() const noexcept
网络权重成功进行权重流式传输所需的最小 GPU 内存字节数...
定义: NvInferRuntime.h:3730
TensorIOMode getTensorIOMode(char const *tensorName) const noexcept
确定张量是输入张量还是输出张量。
定义: NvInferRuntime.h:3128
int32_t getNbLayers() const noexcept
获取网络中的层数。
定义: NvInferRuntime.h:3045
int32_t getNbIOTensors() const noexcept
返回 IO 张量的数量。
定义: NvInferRuntime.h:3576
int32_t getTensorComponentsPerElement(char const *tensorName) const noexcept
返回一个元素中包含的组件数量,如果张量未向量化或如果 ...,则返回 -1。
定义: NvInferRuntime.h:3266
bool isRefittable() const noexcept
如果引擎可以重新拟合,则返回 true。
定义: NvInferRuntime.h:3206
IDimensionExpr 表示从常量、输入维度构建的整数表达式...
定义: NvInferRuntime.h:232
bool isConstant() const noexcept
如果表达式是构建时常量,则返回 true。
定义: NvInferRuntime.h:237
bool isSizeTensor() const noexcept
如果这表示大小张量的值,则返回 true。
定义: NvInferRuntime.h:263
virtual ~IDimensionExpr() noexcept=default
apiv::VDimensionExpr * mImpl
定义: NvInferRuntime.h:254
int64_t getConstantValue() const noexcept
获取常量的值。
定义: NvInferRuntime.h:248
引擎检查器,用于打印引擎或执行上下文的层信息。
定义: NvInferRuntime.h:4932
char const * getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
获取描述当前引擎或执行上下文中的特定层信息的字符串。
定义: NvInferRuntime.h:4985
IErrorRecorder * getErrorRecorder() const noexcept
获取分配给此接口的 ErrorRecorder。
定义: NvInferRuntime.h:5042
void setErrorRecorder(IErrorRecorder *recorder) noexcept
为此接口设置 ErrorRecorder。
定义: NvInferRuntime.h:5027
IExecutionContext const * getExecutionContext() const noexcept
获取当前正在检查的上下文。
定义: NvInferRuntime.h:4960
apiv::VEngineInspector * mImpl
定义: NvInferRuntime.h:5048
virtual ~IEngineInspector() noexcept=default
char const * getEngineInformation(LayerInformationFormat format) const noexcept
获取描述当前引擎或执行上下文中所有层信息的字符串。
定义: NvInferRuntime.h:5008
使用引擎执行推理的上下文,具有功能上不安全的功能。
定义: NvInferRuntime.h:4021
IOutputAllocator * getOutputAllocator(char const *tensorName) const noexcept
获取与给定名称的输出张量关联的输出分配器,如果提供的名称 doe...,则返回 nullptr。
定义: NvInferRuntime.h:4656
IErrorRecorder * getErrorRecorder() const noexcept
获取分配给此接口的 ErrorRecorder。
定义: NvInferRuntime.h:4304
bool reportToProfiler() const noexcept
计算 IExecutionContext 中当前优化配置的层计时信息,并更新 ...
定义: NvInferRuntime.h:4423
virtual ~IExecutionContext() noexcept=default
void setDeviceMemory(void *memory) noexcept
设置此执行上下文要使用的设备内存。
定义: NvInferRuntime.h:4124
TRT_DEPRECATED bool allInputShapesSpecified() const noexcept
是否已指定所有输入形状绑定。
定义: NvInferRuntime.h:4270
bool setTensorDebugState(char const *name, bool flag) noexcept
设置给定张量名称的张量的调试状态。
定义: NvInferRuntime.h:4863
char const * getName() const noexcept
返回执行上下文的名称。
定义: NvInferRuntime.h:4097
IGpuAllocator * getTemporaryStorageAllocator() const noexcept
通过 setTemporaryStorageAllocator 获取分配器集。
定义: NvInferRuntime.h:4704
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
设置 enqueue 是否将层计时信息发送到 profiler。
定义: NvInferRuntime.h:4381
Dims getTensorShape(char const *tensorName) const noexcept
返回给定输入或输出的形状。
定义: NvInferRuntime.h:4237
bool getDebugState(char const *name) const noexcept
定义: NvInferRuntime.h:4886
bool setInputShape(char const *tensorName, Dims const &dims) noexcept
设置给定输入的形状。
定义: NvInferRuntime.h:4200
bool executeV2(void *const *bindings) noexcept
同步执行网络。
定义: NvInferRuntime.h:4321
bool getEnqueueEmitsProfile() const noexcept
获取 enqueueEmitsProfile 状态。
定义: NvInferRuntime.h:4393
void const * getTensorAddress(char const *tensorName) const noexcept
获取绑定到给定输入或输出张量的内存地址,如果提供的名称不匹配,则返回 nullptr...
定义: NvInferRuntime.h:4484
bool setOutputAllocator(char const *tensorName, IOutputAllocator *outputAllocator) noexcept
设置用于给定名称的输出张量的输出分配器。传递 nullptr 给 outputAllocator 以取消设置...
定义: NvInferRuntime.h:4643
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
为当前上下文选择一个优化配置文件,使用异步语义。
定义: NvInferRuntime.h:4365
apiv::VExecutionContext * mImpl
定义: NvInferRuntime.h:4892
bool setOutputTensorAddress(char const *tensorName, void *data) noexcept
设置给定输出张量的内存地址。
定义: NvInferRuntime.h:4507
void setPersistentCacheLimit(size_t size) noexcept
设置持久缓存使用的最大大小。
定义: NvInferRuntime.h:4744
size_t getPersistentCacheLimit() const noexcept
获取持久缓存使用的最大大小。
定义: NvInferRuntime.h:4755
bool setAllTensorsDebugState(bool flag) noexcept
定义: NvInferRuntime.h:4876
ICudaEngine const & getEngine() const noexcept
获取关联的引擎。
定义: NvInferRuntime.h:4073
ProfilingVerbosity getNvtxVerbosity() const noexcept
获取执行上下文的 NVTX 详细程度。
定义: NvInferRuntime.h:4791
size_t updateDeviceMemorySizeForShapes() noexcept
基于当前的输入形状重新计算内部激活缓冲区大小,并返回总计...
定义: NvInferRuntime.h:4598
void setAuxStreams(cudaStream_t *auxStreams, int32_t nbStreams) noexcept
设置 TensorRT 应在下次 enqueueV3() 调用中在其上启动内核的辅助流。
定义: NvInferRuntime.h:4822
int64_t getMaxOutputSize(char const *tensorName) const noexcept
获取输出张量大小的上限(以字节为单位),基于当前的优化配置文件和 i...
定义: NvInferRuntime.h:4674
int32_t inferShapes(int32_t nbMaxNames, char const **tensorNames) noexcept
运行形状计算。
定义: NvInferRuntime.h:4581
bool setDebugListener(IDebugListener *listener) noexcept
为此执行上下文设置 DebugListener。
定义: NvInferRuntime.h:4834
bool setTensorAddress(char const *tensorName, void *data) noexcept
设置给定输入或输出张量的内存地址。
定义: NvInferRuntime.h:4467
bool setTemporaryStorageAllocator(IGpuAllocator *allocator) noexcept
指定用于内部临时存储的分配器。
定义: NvInferRuntime.h:4694
void * getOutputTensorAddress(char const *tensorName) const noexcept
获取给定输出的内存地址。
定义: NvInferRuntime.h:4548
bool enqueueV3(cudaStream_t stream) noexcept
在流上排队推理。
定义: NvInferRuntime.h:4728
IDebugListener * getDebugListener() noexcept
获取此执行上下文的 DebugListener。
定义: NvInferRuntime.h:4844
int32_t getOptimizationProfile() const noexcept
获取当前选定的优化配置文件的索引。
定义: NvInferRuntime.h:4182
bool setInputTensorAddress(char const *tensorName, void const *data) noexcept
设置给定输入的内存地址。
定义: NvInferRuntime.h:4529
bool getDebugSync() const noexcept
获取调试同步标志。
定义: NvInferRuntime.h:4043
bool setInputConsumedEvent(cudaEvent_t event) noexcept
将输入标记为已消耗。
定义: NvInferRuntime.h:4614
Dims getTensorStrides(char const *tensorName) const noexcept
返回给定张量名称的缓冲区的步幅。
定义: NvInferRuntime.h:4167
bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
设置执行上下文中 NVTX 标记的详细程度。
定义: NvInferRuntime.h:4779
IProfiler * getProfiler() const noexcept
获取 profiler。
定义: NvInferRuntime.h:4063
void setErrorRecorder(IErrorRecorder *recorder) noexcept
为此接口设置 ErrorRecorder。
定义: NvInferRuntime.h:4289
void setDeviceMemoryV2(void *memory, int64_t size) noexcept
设置设备内存及其相应大小,供此执行上下文使用。
定义: NvInferRuntime.h:4146
bool allInputDimensionsSpecified() const noexcept
是否已指定输入张量的所有动态维度。
定义: NvInferRuntime.h:4253
void setProfiler(IProfiler *profiler) noexcept
设置 profiler。
定义: NvInferRuntime.h:4053
void setName(char const *name) noexcept
设置执行上下文的名称。
定义: NvInferRuntime.h:4087
cudaEvent_t getInputConsumedEvent() const noexcept
与消耗输入相关的事件。
定义: NvInferRuntime.h:4624
用于构造 IDimensionExpr 的对象。
定义: NvInferRuntime.h:287
IDimensionExpr const * operation(DimensionOperation op, IDimensionExpr const &first, IDimensionExpr const &second) noexcept
获取操作。
定义: NvInferRuntime.h:303
virtual ~IExprBuilder() noexcept=default
IDimensionExpr const * constant(int64_t value) noexcept
返回给定值的 IDimensionExpr 的指针。
定义: NvInferRuntime.h:292
apiv::VExprBuilder * mImpl
定义: NvInferRuntime.h:310
IDimensionExpr const * declareSizeTensor(int32_t outputIndex, IDimensionExpr const &opt, IDimensionExpr const &upper)
在给定的输出索引处声明一个大小张量,具有指定的自动调整公式和上限...
定义: NvInferRuntime.h:338
用于处理库分配的、用户可访问的内存的类。
定义: NvInferRuntime.h:142
void * data() const noexcept
指向库拥有的原始数据的指针。
定义: NvInferRuntime.h:147
DataType type() const noexcept
已分配内存的类型。
定义: NvInferRuntime.h:159
std::size_t size() const noexcept
已分配数据的字节大小。
定义: NvInferRuntime.h:153
apiv::VHostMemory * mImpl
定义: NvInferRuntime.h:165
virtual ~IHostMemory() noexcept=default
用于查找 logger 的虚拟基类。允许插件在需要时查找 logger 的实例...
定义: NvInferRuntime.h:5145
virtual ILogger * findLogger()=0
获取引擎或执行上下文调用的插件方法使用的 logger。
virtual ~ILoggerFinder()=default
应用程序实现的用于构建器、重定器和运行时的日志记录接口。
定义: NvInferRuntime.h:1540
virtual ~ILogger()=default
Severity
与日志消息对应的严重性。
定义: NvInferRuntime.h:1548
virtual void log(Severity severity, AsciiChar const *msg) noexcept=0
应用程序实现的用于处理日志消息的回调;。
IEngineInspector 的前向声明,供其他接口使用。
定义: NvInferRuntime.h:51
INoCopy & operator=(INoCopy &&other)=delete
INoCopy(INoCopy const &other)=delete
INoCopy(INoCopy &&other)=delete
virtual ~INoCopy()=default
INoCopy & operator=(INoCopy const &other)=delete
用于动态输入维度和形状张量的优化配置文件。
定义: NvInferRuntime.h:2616
int32_t const * getShapeValues(char const *inputName, OptProfileSelector select) const noexcept
获取输入形状张量的最小/最佳/最大值。
定义: NvInferRuntime.h:2730
apiv::VOptimizationProfile * mImpl
定义: NvInferRuntime.h:2783
Dims getDimensions(char const *inputName, OptProfileSelector select) const noexcept
获取动态输入张量的最小/最佳/最大维度。
定义: NvInferRuntime.h:2657
virtual ~IOptimizationProfile() noexcept=default
float getExtraMemoryTarget() const noexcept
获取为此配置文件定义的额外内存目标。
定义: NvInferRuntime.h:2760
bool setExtraMemoryTarget(float target) noexcept
为此配置文件设置可能使用的额外 GPU 内存的目标。
定义: NvInferRuntime.h:2748
bool setDimensions(char const *inputName, OptProfileSelector select, Dims const &dims) noexcept
设置动态输入张量的最小/最佳/最大维度。
定义: NvInferRuntime.h:2645
bool setShapeValues(char const *inputName, OptProfileSelector select, int32_t const *values, int32_t nbValues) noexcept
设置输入形状张量的最小/最佳/最大值。
定义: NvInferRuntime.h:2704
bool isValid() const noexcept
检查优化配置文件是否可以传递给 IBuilderConfig 对象。
定义: NvInferRuntime.h:2777
int32_t getNbShapeValues(char const *inputName) const noexcept
获取输入形状张量的值的数量。
定义: NvInferRuntime.h:2718
应用程序中所有插件的单个注册点。它用于查找插件实现...
定义: NvInferRuntimeCommon.h:56
virtual TRT_DEPRECATED bool registerCreator(IPluginCreator &creator, AsciiChar const *const pluginNamespace) noexcept=0
注册实现 IPluginCreator 的插件创建器。如果任何插件创建器具有相同的 s,则返回 false...
用于插件访问 TensorRT 提供的每个上下文资源的接口。
定义: NvInferRuntime.h:767
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
获取与资源上下文关联的错误记录器。
IPluginResourceContext & operator=(IPluginResourceContext const &) &=default
virtual IGpuAllocator * getGpuAllocator() const noexcept=0
获取与资源上下文关联的 GPU 分配器。
类似于 IPluginV2Ext,但支持动态形状。
定义: NvInferRuntime.h:407
IPluginV2DynamicExt * clone() const noexcept override=0
克隆插件对象。这将复制内部插件参数,并返回一个新的插件...
virtual ~IPluginV2DynamicExt() noexcept
定义: NvInferRuntime.h:558
用于用户实现的层的插件类。
定义: NvInferRuntimePlugin.h:468
更新引擎中的权重。
定义: NvInferRuntime.h:2136
bool refitCudaEngineAsync(cudaStream_t stream) noexcept
在给定流上排队关联引擎的权重重定。
定义: NvInferRuntime.h:2538
int32_t getMaxThreads() const noexcept
获取重定器可以使用的最大线程数。
定义: NvInferRuntime.h:2417
TensorLocation getWeightsLocation(char const *weightsName) const noexcept
获取与给定名称关联的权重的location。
定义: NvInferRuntime.h:2476
bool setNamedWeights(char const *name, Weights weights) noexcept
指定给定名称的新权重。
定义: NvInferRuntime.h:2341
int32_t getAllWeights(int32_t size, char const **weightsNames) noexcept
获取所有可以重定的权重的名称。
定义: NvInferRuntime.h:2377
ILogger * getLogger() const noexcept
获取创建重定器时使用的 logger
定义: NvInferRuntime.h:2387
bool refitCudaEngine() noexcept
重定关联的引擎。
定义: NvInferRuntime.h:2172
int32_t getMissingWeights(int32_t size, char const **weightsNames) noexcept
获取缺失权重的名称。
定义: NvInferRuntime.h:2361
TRT_DEPRECATED float getDynamicRangeMax(char const *tensorName) const noexcept
获取动态范围的最大值。
定义: NvInferRuntime.h:2264
int32_t getMissing(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
获取缺失权重的描述。
定义: NvInferRuntime.h:2193
Weights getNamedWeights(char const *weightsName) const noexcept
获取与给定名称关联的权重。
定义: NvInferRuntime.h:2460
bool unsetNamedWeights(char const *weightsName) noexcept
取消设置与给定名称关联的权重。
定义: NvInferRuntime.h:2492
Weights getWeightsPrototype(char const *weightsName) const noexcept
获取与给定名称关联的 Weights 原型。
定义: NvInferRuntime.h:2556
bool setMaxThreads(int32_t maxThreads) noexcept
设置最大线程数。
定义: NvInferRuntime.h:2403
TRT_DEPRECATED float getDynamicRangeMin(char const *tensorName) const noexcept
获取动态范围的最小值。
定义: NvInferRuntime.h:2248
TRT_DEPRECATED int32_t getTensorsWithDynamicRange(int32_t size, char const **tensorNames) const noexcept
获取所有具有可重定动态范围的张量的名称。
定义: NvInferRuntime.h:2282
bool setNamedWeights(char const *name, Weights weights, TensorLocation location) noexcept
在给定名称的指定设备上指定新权重。
定义: NvInferRuntime.h:2444
void setWeightsValidation(bool weightsValidation) noexcept
设置是否在重定期间验证权重。
定义: NvInferRuntime.h:2508
TRT_DEPRECATED bool setDynamicRange(char const *tensorName, float min, float max) noexcept
定义: NvInferRuntime.h:2232
apiv::VRefitter * mImpl
定义: NvInferRuntime.h:2562
int32_t getAll(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
获取所有可以重定的权重的描述。
定义: NvInferRuntime.h:2210
virtual ~IRefitter() noexcept=default
bool getWeightsValidation() const noexcept
获取是否在重定期间验证权重值。
定义: NvInferRuntime.h:2516
void setErrorRecorder(IErrorRecorder *recorder) noexcept
为此接口设置 ErrorRecorder。
定义: NvInferRuntime.h:2301
IErrorRecorder * getErrorRecorder() const noexcept
获取分配给此接口的 ErrorRecorder。
定义: NvInferRuntime.h:2316
允许反序列化功能上不安全的序列化引擎。
定义: NvInferRuntime.h:1817
bool setMaxThreads(int32_t maxThreads) noexcept
设置最大线程数。
定义: NvInferRuntime.h:1981
IRuntime * loadRuntime(char const *path) noexcept
从文件加载 IRuntime。
定义: NvInferRuntime.h:2097
bool getEngineHostCodeAllowed() const noexcept
获取运行时是否允许反序列化具有主机可执行代码的引擎。
定义: NvInferRuntime.h:2119
TempfileControlFlags getTempfileControlFlags() const noexcept
获取此运行时的临时文件控制标志。
定义: NvInferRuntime.h:2069
void setEngineHostCodeAllowed(bool allowed) noexcept
设置运行时是否允许反序列化具有主机可执行代码的引擎。
定义: NvInferRuntime.h:2109
virtual ~IRuntime() noexcept=default
void setTemporaryDirectory(char const *path) noexcept
设置此运行时将用于临时文件的目录。
定义: NvInferRuntime.h:2030
IPluginRegistry & getPluginRegistry() noexcept
获取运行时可以使用的本地插件注册表。
定义: NvInferRuntime.h:2079
apiv::VRuntime * mImpl
定义: NvInferRuntime.h:2125
int32_t getNbDLACores() const noexcept
返回可访问的 DLA 硬件内核数量,如果 DLA 不可用,则返回 0。
定义: NvInferRuntime.h:1850
ICudaEngine * deserializeCudaEngine(void const *blob, std::size_t size) noexcept
从主机内存反序列化引擎。
定义: NvInferRuntime.h:1914
void setTempfileControlFlags(TempfileControlFlags flags) noexcept
设置此运行时的临时文件控制标志。
定义: NvInferRuntime.h:2057
int32_t getDLACore() const noexcept
获取引擎在其上执行的 DLA 内核。
定义: NvInferRuntime.h:1842
void setGpuAllocator(IGpuAllocator *allocator) noexcept
设置 GPU 分配器。
定义: NvInferRuntime.h:1865
IErrorRecorder * getErrorRecorder() const noexcept
获取分配给此接口的 ErrorRecorder。
定义: NvInferRuntime.h:1899
ICudaEngine * deserializeCudaEngine(IStreamReaderV2 &streamReader)
从流反序列化引擎。IStreamReaderV2 预计支持读取到主机和 ...
定义: NvInferRuntime.h:1956
ILogger * getLogger() const noexcept
获取创建运行时时使用的 logger
定义: NvInferRuntime.h:1966
int32_t getMaxThreads() const noexcept
获取运行时可以使用的最大线程数。
定义: NvInferRuntime.h:1995
char const * getTemporaryDirectory() const noexcept
获取此运行时将用于临时文件的目录。
定义: NvInferRuntime.h:2041
TRT_DEPRECATED ICudaEngine * deserializeCudaEngine(IStreamReader &streamReader)
从流反序列化引擎。
定义: NvInferRuntime.h:1935
void setErrorRecorder(IErrorRecorder *recorder) noexcept
为此接口设置 ErrorRecorder。
定义: NvInferRuntime.h:1884
保存用于配置引擎以序列化二进制文件的属性。
定义: NvInferRuntime.h:2893
virtual ~ISerializationConfig() noexcept=default
bool clearFlag(SerializationFlag serializationFlag) noexcept
清除序列化标志。
定义: NvInferRuntime.h:2932
bool setFlag(SerializationFlag serializationFlag) noexcept
设置序列化标志。
定义: NvInferRuntime.h:2944
SerializationFlags getFlags() const noexcept
获取此配置的序列化标志。
定义: NvInferRuntime.h:2920
bool getFlag(SerializationFlag serializationFlag) const noexcept
如果设置了序列化标志,则返回 true。
定义: NvInferRuntime.h:2956
apiv::VSerializationConfig * mImpl
定义: NvInferRuntime.h:2962
用于版本控制的接口类。
定义: NvInferRuntimeBase.h:263
与 TRT 接口关联的版本信息。
定义: NvInferRuntimeBase.h:228
将插件创建器注册到注册表。静态注册表对象将在 ... 时实例化
定义: NvInferRuntime.h:5117
PluginRegistrar()
定义: NvInferRuntime.h:5119
用作层参数的权重数组。
定义: NvInferRuntime.h:124
DataType type
权重的类型。
定义: NvInferRuntime.h:126
int64_t count
数组中权重的数量。
定义: NvInferRuntime.h:128
void const * values
权重值,在一个连续的数组中。
定义: NvInferRuntime.h:127
定义: NvInferRuntime.h:3972
virtual bool processDebugTensor(void const *addr, TensorLocation location, DataType type, Dims const &shape, char const *name, cudaStream_t stream)=0
当调试张量的值更新且 te 的调试状态时调用的回调函数...
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:3977
~IDebugListener() override=default
定义: NvInferRuntimeBase.h:400
定义: NvInferRuntime.h:1608
virtual void * allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t) noexcept
应用程序实现的线程安全回调,用于处理 GPU 内存的流有序获取...
定义: NvInferRuntime.h:1730
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:1771
virtual TRT_DEPRECATED bool deallocate(void *const memory) noexcept=0
应用程序实现的线程安全回调,用于处理 GPU 内存的释放。
~IGpuAllocator() override=default
virtual void * reallocate(void *const, uint64_t, uint64_t) noexcept
应用程序实现的线程安全回调,用于调整现有分配的大小。
定义: NvInferRuntime.h:1677
virtual TRT_DEPRECATED void * allocate(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept=0
应用程序实现的线程安全回调,用于处理 GPU 内存的获取。
virtual bool deallocateAsync(void *const memory, cudaStream_t) noexcept
应用程序实现的线程安全回调,用于处理 GPU 内存的流有序释放。
定义: NvInferRuntime.h:1763
定义: NvInferRuntime.h:5166
bool deallocateAsync(void *const memory, cudaStream_t) noexcept override=0
应用程序实现的线程安全回调,用于处理流有序异步释放 o...
void * allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t) noexcept override=0
应用程序实现的线程安全回调,用于处理流有序异步获取 i...
TRT_DEPRECATED void * allocate(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept override
应用程序实现的线程安全回调,用于处理 GPU 内存的获取。
定义: NvInferRuntime.h:5252
TRT_DEPRECATED bool deallocate(void *const memory) noexcept override
应用程序实现的线程安全回调,用于处理 GPU 内存的释放。
定义: NvInferRuntime.h:5276
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:5284
~IGpuAsyncAllocator() override=default
定义: NvInferRuntime.h:3885
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:3890
virtual void * reallocateOutputAsync(char const *tensorName, void *currentMemory, uint64_t size, uint64_t alignment, cudaStream_t)
返回输出张量的内存指针,如果无法分配内存,则返回 nullptr....
定义: NvInferRuntime.h:3942
virtual void notifyShape(char const *tensorName, Dims const &dims) noexcept=0
当输出张量的形状已知时,由 TensorRT 调用。
virtual TRT_DEPRECATED void * reallocateOutput(char const *tensorName, void *currentMemory, uint64_t size, uint64_t alignment) noexcept
返回输出张量的内存指针,如果无法分配内存,则返回 nullptr....
定义: NvInferRuntime.h:3914
定义: NvInferPluginBase.h:141
定义: NvInferPluginBase.h:193
定义: NvInferRuntime.h:5291
virtual PluginFieldCollection const * getFieldNames() noexcept=0
返回创建插件时需要传递给 createPlugin() 的字段列表,以便在 th 中使用...
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:5296
virtual IPluginV3 * createPlugin(AsciiChar const *name, PluginFieldCollection const *fc, TensorRTPhase phase) noexcept=0
返回插件对象。如果发生错误,则返回 nullptr。
定义: NvInferPluginBase.h:206
定义: NvInferRuntime.h:836
virtual int32_t getFormatCombinationLimit() noexcept
返回 TensorRT 在构建阶段将计时的最大格式组合数...
定义: NvInferRuntime.h:1039
virtual int32_t getNbOutputs() const noexcept=0
获取插件的输出数量。
virtual int32_t configurePlugin(DynamicPluginTensorDesc const *in, int32_t nbInputs, DynamicPluginTensorDesc const *out, int32_t nbOutputs) noexcept=0
配置插件。
virtual int32_t getNbTactics() noexcept
查询插件打算使用的自定义策略的数量。
定义: NvInferRuntime.h:1015
virtual char const * getMetadataString() noexcept
查询表示插件配置的字符串。可以在插件 c 后随时调用...
定义: NvInferRuntime.h:1050
virtual char const * getTimingCacheID() noexcept
调用以查询用于计时缓存 ID 的后缀。可以在插件创建后随时调用...
定义: NvInferRuntime.h:1031
virtual bool supportsFormatCombination(int32_t pos, DynamicPluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs) noexcept=0
如果插件支持 pos 索引的输入/输出的格式和数据类型,则返回 true。
virtual int32_t getOutputDataTypes(DataType *outputTypes, int32_t nbOutputs, const DataType *inputTypes, int32_t nbInputs) const noexcept=0
如果输入张量具有提供的数据类型,则提供插件输出的数据类型。
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:848
virtual int32_t getOutputShapes(DimsExprs const *inputs, int32_t nbInputs, DimsExprs const *shapeInputs, int32_t nbShapeInputs, DimsExprs *outputs, int32_t nbOutputs, IExprBuilder &exprBuilder) noexcept=0
提供用于从输入 tenso 的维度计算输出张量维度的表达式...
virtual int32_t getValidTactics(int32_t *tactics, int32_t nbTactics) noexcept
查询插件打算使用的任何自定义策略。
定义: NvInferRuntime.h:1007
定义: NvInferRuntime.h:793
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:798
virtual AsciiChar const * getPluginName() const noexcept=0
返回插件名称。应与相应插件创建器返回的插件名称匹配。
定义: NvInferRuntime.h:1057
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:1062
virtual int32_t onShapeChange(PluginTensorDesc const *in, int32_t nbInputs, PluginTensorDesc const *out, int32_t nbOutputs) noexcept=0
当插件正在准备针对特定维度执行时调用。这可能会多次发生...
virtual PluginFieldCollection const * getFieldsToSerialize() noexcept=0
获取应序列化的插件字段。
virtual int32_t setTactic(int32_t tactic) noexcept
设置要在后续 enqueue() 调用中使用的策略。如果没有通告自定义策略,...
定义: NvInferRuntime.h:1074
virtual int32_t enqueue(PluginTensorDesc const *inputDesc, PluginTensorDesc const *outputDesc, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept=0
执行层。
virtual IPluginV3 * attachToContext(IPluginResourceContext *context) noexcept=0
克隆插件,将克隆的插件对象附加到执行上下文,并授予克隆的插件 ...
定义: NvInferRuntime.h:1245
virtual ~IProfiler() noexcept
定义: NvInferRuntime.h:1256
virtual void reportLayerTime(char const *layerName, float ms) noexcept=0
层时间报告回调。
定义: NvInferRuntime.h:631
~IStreamReader() override=default
IStreamReader & operator=(IStreamReader const &) &=default
IStreamReader & operator=(IStreamReader &&) &=default
virtual int64_t read(void *destination, int64_t nbBytes)=0
读取流中的下一个字节数。
IStreamReader(IStreamReader &&)=default
IStreamReader(IStreamReader const &)=default
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:643
定义: NvInferRuntime.h:695
IStreamReaderV2 & operator=(IStreamReaderV2 const &) &=default
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:707
IStreamReaderV2(IStreamReaderV2 &&)=default
~IStreamReaderV2() override=default
virtual int64_t read(void *destination, int64_t nbBytes, cudaStream_t stream) noexcept=0
异步读取流中的下一个字节数。
IStreamReaderV2(IStreamReaderV2 const &)=default
virtual bool seek(int64_t offset, SeekPosition where) noexcept=0
将流的位置设置为给定的偏移量。
IStreamReaderV2 & operator=(IStreamReaderV2 &&) &=default
定义: NvInferRuntime.h:1154
virtual int32_t getAliasedInput(int32_t outputIndex) noexcept
告知 TensorRT 指定输出索引处的输出与输入处的别名关联...
定义: NvInferRuntime.h:1190
InterfaceInfo getInterfaceInfo() const noexcept override
返回与此接口关联的版本信息。应用程序不得覆盖此方法...
定义: NvInferRuntime.h:1156
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
创建 IRefitter 类的实例。
定义: NvInferRuntime.h:5097
IRuntime * createInferRuntime(ILogger &logger) noexcept
创建 IRuntime 类的实例。
定义: NvInferRuntime.h:5087
TensorRT API 版本 1 的命名空间。
uint32_t TacticSources
表示一个或多个 TacticSource 值的集合,使用按位或运算组合。
定义: NvInferRuntime.h:2832
v_1_0::IOutputAllocator IOutputAllocator
定义: NvInferRuntime.h:3967
EngineCapability
支持的引擎能力流程列表。
定义: NvInferRuntime.h:76
DimensionOperation
对两个 IDimensionExpr 的操作,IDimensionExpr 表示维度计算中使用的整数表达式...
定义: NvInferRuntime.h:179
@ kSUB
从第一个元素中减去第二个元素。
@ kSUM
两个操作数的和。
@ kPROD
两个操作数的积。
@ kFLOOR_DIV
第一个元素除以第二个元素的向下取整除法。
@ kEQUAL
如果操作数相等,则为 1,否则为 0。
@ kMIN
两个操作数的最小值。
@ kLESS
如果第一个操作数小于第二个操作数,则为 1,否则为 0。
@ kMAX
两个操作数的最大值。
@ kCEIL_DIV
向上取整除法。
v_1_0::IPluginV3OneCore IPluginV3OneCore
定义: NvInferRuntime.h:1207
TensorIOMode
张量 IO 模式的定义。
定义: NvInferRuntimeBase.h:643
HardwareCompatibilityLevel
描述与 GPU 架构兼容性的要求,该架构不同于执行构建的 GPU 架构...
定义: NvInfer.h:9203
SerializationFlag
引擎在序列化字节时可以启用的有效标志列表。
定义: NvInferRuntime.h:2873
@ kEXCLUDE_WEIGHTS
排除可以重新拟合的权重。
v_1_0::IProfiler IProfiler
定义: NvInferRuntime.h:1271
SeekPosition
控制 IStreamReaderV2 的查找模式。
定义: NvInferRuntime.h:681
@ kSET
从文件开头开始。
@ kCUR
从文件的当前位置开始。
@ kEND
从文件末尾开始。
v_1_0::IStreamReaderV2 IStreamReaderV2
定义: NvInferRuntime.h:751
uint32_t TempfileControlFlags
表示一个或多个 TempfileControlFlag 值的集合,使用按位或运算组合...
定义: NvInferRuntime.h:1349
v_1_0::IGpuAllocator IGpuAllocator
定义: NvInferRuntime.h:1807
constexpr int32_t EnumMax< WeightsRole >() noexcept
WeightsRole 枚举中元素的最大数量。
定义: NvInferRuntime.h:1292
char_t AsciiChar
定义: NvInferRuntimeBase.h:105
TensorRTPhase
指示 TensorRT 的操作阶段。
定义: NvInferPluginBase.h:116
@ kV2_DYNAMICEXT
IPluginV2DynamicExt。
constexpr int32_t EnumMax< LayerInformationFormat >() noexcept
定义: NvInferRuntime.h:4911
DataType
权重和张量的类型。
定义: NvInferRuntimeBase.h:133
DeviceType
此层/网络将在其上执行的设备。
定义: NvInferRuntime.h:1303
@ kGPU
GPU 设备。
@ kDLA
DLA 核心。
@ kSCALE
Scale 层。
@ kCONSTANT
Constant 层。
v_1_0::IDebugListener IDebugListener
定义: NvInferRuntime.h:4008
TempfileControlFlag
用于控制 TensorRT 在创建可执行临时文件时的行为的标志。
定义: NvInferRuntime.h:1326
@ kALLOW_IN_MEMORY_FILES
允许在内存中(或未命名的文件)创建和加载文件。
constexpr int32_t EnumMax< OptProfileSelector >() noexcept
OptProfileSelector 枚举的不同值的数量。
定义: NvInferRuntime.h:2588
WeightsRole
层如何使用特定的 Weights。
定义: NvInferRuntime.h:1281
@ kSHIFT
IScaleLayer 的 shift 部分
@ kANY
任何其他权重角色。
@ kBIAS
IConvolutionLayer 或 IDeconvolutionLayer 的 bias
@ kKERNEL
IConvolutionLayer 或 IDeconvolutionLayer 的 kernel
constexpr int32_t EnumMax< ProfilingVerbosity >() noexcept
ProfilingVerbosity 枚举中最大profile verbosity levels 的数量。
定义: NvInferRuntime.h:2852
ProfilingVerbosity
NVTX 注释和 IEngineInspector 中公开的层信息 verbosity levels 列表。
定义: NvInferRuntime.h:2844
@ kLAYER_NAMES_ONLY
仅打印层名称。这是默认设置。
@ kDETAILED
打印详细的层信息,包括层名称和层参数。
TacticSource
TensorRT 的 tactic sources 列表。
定义: NvInferRuntime.h:2795
TensorFormat PluginFormat
PluginFormat 保留用于向后兼容性。
定义: NvInferRuntimePlugin.h:54
v_1_0::IPluginV3OneRuntime IPluginV3OneRuntime
定义: NvInferRuntime.h:1231
@ kMIN
两个元素的最小值。
constexpr int32_t EnumMax< TempfileControlFlag >() noexcept
TempfileControlFlag 枚举中元素的最大数量。
定义: NvInferRuntime.h:1338
uint32_t SerializationFlags
表示一个或多个 SerializationFlag 值,使用二进制 OR 运算,例如,1U << Serialization...
定义: NvInferRuntime.h:2863
@ kLINEAR
支持线性 (1D)、双线性 (2D) 和三线性 (3D) 插值。
v_1_0::IPluginV3OneBuild IPluginV3OneBuild
定义: NvInferRuntime.h:1219
TensorFormat
输入/输出张量的格式。
定义: NvInferRuntime.h:1382
ExecutionContextAllocationStrategy
IExecutionContext 的不同内存分配行为。
定义: NvInferRuntime.h:2977
@ kSTATIC
跨所有配置文件的最大尺寸的默认静态分配。
@ kUSER_MANAGED
用户为执行上下文提供自定义分配。
@ kON_PROFILE_CHANGE
在选择配置文件时重新分配。
constexpr int32_t EnumMax< TacticSource >() noexcept
TacticSource 枚举中 tactic sources 的最大数量。
定义: NvInferRuntime.h:2821
LayerInformationFormat
IEngineInspector 打印层信息的格式。
定义: NvInferRuntime.h:4903
@ kJSON
以 JSON 格式打印层信息。
@ kONELINE
每层打印一行层信息。
v_1_0::IStreamReader IStreamReader
定义: NvInferRuntime.h:674
AllocatorFlag
允许的内存分配类型。
定义: NvInferRuntime.h:1506
@ kRESIZABLE
TensorRT 可能会对此分配调用 realloc()。
@ kMAX
元素的最大值。
constexpr int32_t EnumMax< DeviceType >() noexcept
DeviceType 枚举中元素的最大数量。
定义: NvInferRuntime.h:1310
constexpr int32_t EnumMax< DimensionOperation >() noexcept
DimensionOperation 枚举中元素的最大数量。
定义: NvInferRuntime.h:193
constexpr int32_t EnumMax< ExecutionContextAllocationStrategy >() noexcept
ExecutionContextAllocationStrategy 枚举中内存分配策略的最大数量。
定义: NvInferRuntime.h:2989
constexpr int32_t EnumMax< SerializationFlag >() noexcept
SerializationFlag 枚举中 serialization flags 的最大数量。
定义: NvInferRuntime.h:2880
TensorLocation
张量数据存储的位置,设备或主机。
定义: NvInferRuntime.h:204
@ kHOST
数据存储在主机上。
@ kDEVICE
数据存储在设备上。
OptProfileSelector
在设置或查询优化配置文件参数时(例如 shape tensor inputs 或动态维度...
定义: NvInferRuntime.h:2576
@ kOPT
这用于设置或获取在优化(内核选择)中使用的值。
uint32_t AllocatorFlags
定义: NvInferRuntime.h:1522
概述插件可能看到的输入或输出张量。
定义: NvInferRuntime.h:362
Dims min
张量维度的下限。
定义: NvInferRuntime.h:367
Dims max
张量维度的上限。
定义: NvInferRuntime.h:370
Dims opt
为自动调整指定的张量维度的最佳值。
定义: NvInferRuntime.h:373
PluginTensorDesc desc
解释张量数据指针所需的信息,除了 desc.dims 在动态维度位置为 -1...
定义: NvInferRuntime.h:364
插件字段集合结构体。
定义: NvInferPluginBase.h:103
插件可能看到的输入或输出字段。
定义: NvInferRuntimePlugin.h:73
EnumMaxImpl 结构体的声明,用于存储枚举类型中元素的最大数量。
定义: NvInferRuntimeBase.h:118

  版权所有 © 2024 NVIDIA Corporation
  隐私政策 | 管理我的隐私 | 请勿出售或分享我的数据 | 服务条款 | 辅助功能 | 公司政策 | 产品安全 | 联系我们