TensorRT 11.3.0
NvInferRuntime.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 1993-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef NV_INFER_RUNTIME_H
19#define NV_INFER_RUNTIME_H
20
26
27#include "NvInferImpl.h" // IWYU pragma: export
28#define NV_INFER_INTERNAL_INCLUDE 1
29#include "NvInferPluginBase.h" // IWYU pragma: export
30#undef NV_INFER_INTERNAL_INCLUDE
31#include "NvInferRuntimeCommon.h" // IWYU pragma: export
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
100template <>
102{
103 static constexpr int32_t kVALUE = 3;
104};
105
132{
133public:
135 void const* values;
136 int64_t count;
137};
138
149class IHostMemory : public INoCopy
150{
151public:
152 virtual ~IHostMemory() noexcept = 0;
153
155 void* data() const noexcept
156 {
157 return mImpl->data();
158 }
159
161 std::size_t size() const noexcept
162 {
163 return mImpl->size();
164 }
165
167 DataType type() const noexcept
168 {
169 return mImpl->type();
170 }
171
172protected:
173 apiv::VHostMemory* mImpl;
174};
175
176inline IHostMemory::~IHostMemory() noexcept = default;
177
188enum class DimensionOperation : int32_t
189{
190 kSUM = 0,
191 kPROD = 1,
192 kMAX = 2,
193 kMIN = 3,
194 kSUB = 4,
195 kEQUAL = 5,
196 kLESS = 6,
197 kFLOOR_DIV = 7,
198 kCEIL_DIV = 8
199};
200
202template <>
204{
205 static constexpr int32_t kVALUE = 9;
206};
207
213enum class TensorLocation : int32_t
214{
215 kDEVICE = 0,
216 kHOST = 1,
217};
218
220template <>
222{
223 static constexpr int32_t kVALUE = 2;
224};
225
239{
240public:
244 bool isConstant() const noexcept
245 {
246 return mImpl->isConstant();
247 }
248
255 int64_t getConstantValue() const noexcept
256 {
257 return mImpl->getConstantValue();
258 }
259
260protected:
261 apiv::VDimensionExpr* mImpl;
262 virtual ~IDimensionExpr() noexcept = 0;
263
264public:
270 bool isSizeTensor() const noexcept
271 {
272 return mImpl->isSizeTensor();
273 }
274};
275
276inline IDimensionExpr::~IDimensionExpr() noexcept = default;
277
295class IExprBuilder : public INoCopy
296{
297public:
301 IDimensionExpr const* constant(int64_t value) noexcept
302 {
303 return mImpl->constant(value);
304 }
305
313 DimensionOperation op, IDimensionExpr const& first, IDimensionExpr const& second) noexcept
314 {
315 return mImpl->operation(op, first, second);
316 }
317
318protected:
319 apiv::VExprBuilder* mImpl;
320 virtual ~IExprBuilder() noexcept = 0;
321
322public:
347 IDimensionExpr const* declareSizeTensor(int32_t outputIndex, IDimensionExpr const& opt, IDimensionExpr const& upper)
348 {
349 return mImpl->declareSizeTensor(outputIndex, opt, upper);
350 }
351};
352
353inline IExprBuilder::~IExprBuilder() noexcept = default;
354
361{
362public:
363 int32_t nbDims;
365};
366
373{
376
379
382
385};
386
418{
419public:
420 IPluginV2DynamicExt* clone() const noexcept override = 0;
421
446 virtual DimsExprs getOutputDimensions(
447 int32_t outputIndex, DimsExprs const* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept = 0;
448
452 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
453
486 virtual bool supportsFormatCombination(
487 int32_t pos, PluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
488
524 virtual void configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
525 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
526
536 virtual size_t getWorkspaceSize(PluginTensorDesc const* inputs, int32_t nbInputs, PluginTensorDesc const* outputs,
537 int32_t nbOutputs) const noexcept = 0;
538
551 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
552 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
553
554protected:
562 int32_t getTensorRTVersion() const noexcept override
563 {
564 return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
565 }
566
567 virtual ~IPluginV2DynamicExt() noexcept {}
568
569private:
570 // Following are obsolete base class methods, and must not be implemented or used.
571
575 void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
576 bool const*, PluginFormat, int32_t) noexcept final
577 {
578 }
579
583 bool supportsFormat(DataType, PluginFormat) const noexcept final
584 {
585 return false;
586 }
587
591 Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept final
592 {
593 return Dims{-1, {}};
594 }
595
599 size_t getWorkspaceSize(int32_t) const noexcept final
600 {
601 return 0;
602 }
603
607 int32_t enqueue(int32_t, void const* const*, void* const*, void*, cudaStream_t) noexcept final
608 {
609 return 1;
610 }
611};
612
613namespace v_1_0
614{
619{
620public:
625 ~IStreamReader() override = default;
626 IStreamReader() = default;
627
631 InterfaceInfo getInterfaceInfo() const noexcept override
632 {
633 return InterfaceInfo{"IStreamReader", 1, 0};
634 }
635
644 virtual int64_t read(void* destination, int64_t nbBytes) = 0;
645
646protected:
647 IStreamReader(IStreamReader const&) = default;
651};
652
654{
655public:
660 ~IStreamWriter() override = default;
661 IStreamWriter() = default;
662
666 InterfaceInfo getInterfaceInfo() const noexcept override
667 {
668 return InterfaceInfo{"IStreamWriter", 1, 0};
669 }
670
680 virtual int64_t write(void const* data, int64_t nbBytes) = 0;
681
682protected:
683 IStreamWriter(IStreamWriter const&) = default;
687};
688} // namespace v_1_0
689
701
711
716enum class SeekPosition : int32_t
717{
719 kSET = 0,
720
722 kCUR = 1,
723
725 kEND = 2,
726};
727
728namespace v_1_0
729{
731{
732public:
737 ~IStreamReaderV2() override = default;
738 IStreamReaderV2() = default;
739
743 InterfaceInfo getInterfaceInfo() const noexcept override
744 {
745 return InterfaceInfo{"IStreamReaderV2", 1, 0};
746 }
747
758 virtual int64_t read(void* destination, int64_t nbBytes, cudaStream_t stream) noexcept = 0;
759
768 virtual bool seek(int64_t offset, SeekPosition where) noexcept = 0;
769
770protected:
775};
776} // namespace v_1_0
777
788
803{
804public:
809 virtual IGpuAllocator* getGpuAllocator() const noexcept = 0;
810
815 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
816 virtual ~IPluginResourceContext() noexcept = 0;
817
818protected:
822 IPluginResourceContext& operator=(IPluginResourceContext const&) & = default;
824};
825
826inline IPluginResourceContext::~IPluginResourceContext() noexcept = default;
827
828namespace v_1_0
829{
831{
832public:
836 InterfaceInfo getInterfaceInfo() const noexcept override
837 {
838 return InterfaceInfo{"PLUGIN_V3ONE_CORE", 1, 0};
839 }
840
849 virtual AsciiChar const* getPluginName() const noexcept = 0;
850
859 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
860
870 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
871};
872
874{
875public:
881 static constexpr int32_t kDEFAULT_FORMAT_COMBINATION_LIMIT = 100;
882
886 InterfaceInfo getInterfaceInfo() const noexcept override
887 {
888 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 1, 0};
889 }
890
910 virtual int32_t configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
911 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
912
929 virtual int32_t getOutputDataTypes(
930 DataType* outputTypes, int32_t nbOutputs, const DataType* inputTypes, int32_t nbInputs) const noexcept = 0;
931
953 virtual int32_t getOutputShapes(DimsExprs const* inputs, int32_t nbInputs, DimsExprs const* shapeInputs,
954 int32_t nbShapeInputs, DimsExprs* outputs, int32_t nbOutputs, IExprBuilder& exprBuilder) noexcept = 0;
955
991 int32_t pos, DynamicPluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
992
998 virtual int32_t getNbOutputs() const noexcept = 0;
999
1009 virtual size_t getWorkspaceSize(DynamicPluginTensorDesc const* /* inputs */, int32_t /* nbInputs */,
1010 DynamicPluginTensorDesc const* /* outputs */, int32_t /* nbOutputs */) const noexcept
1011 {
1012 return 0;
1013 }
1014
1046 virtual int32_t getValidTactics(int32_t* /* tactics */, int32_t /* nbTactics */) noexcept
1047 {
1048 return 0;
1049 }
1050
1054 virtual int32_t getNbTactics() noexcept
1055 {
1056 return 0;
1057 }
1058
1070 virtual char const* getTimingCacheID() noexcept
1071 {
1072 return nullptr;
1073 }
1074
1078 virtual int32_t getFormatCombinationLimit() noexcept
1079 {
1080 return kDEFAULT_FORMAT_COMBINATION_LIMIT;
1081 }
1082
1089 virtual char const* getMetadataString() noexcept
1090 {
1091 return nullptr;
1092 }
1093};
1094
1096{
1097public:
1101 InterfaceInfo getInterfaceInfo() const noexcept override
1102 {
1103 return InterfaceInfo{"PLUGIN_V3ONE_RUNTIME", 1, 0};
1104 }
1105
1113 virtual int32_t setTactic(int32_t /* tactic */) noexcept
1114 {
1115 return 0;
1116 }
1117
1136 virtual int32_t onShapeChange(
1137 PluginTensorDesc const* in, int32_t nbInputs, PluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
1138
1152 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
1153 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
1154
1174 virtual IPluginV3* attachToContext(IPluginResourceContext* context) noexcept = 0;
1175
1181
1185 virtual PluginFieldCollection const* getFieldsToSerialize() noexcept = 0;
1186};
1187} // namespace v_1_0
1188
1189namespace v_2_0
1190{
1191
1193{
1194public:
1195 InterfaceInfo getInterfaceInfo() const noexcept override
1196 {
1197 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 2, 0};
1198 }
1199
1229 virtual int32_t getAliasedInput(int32_t /* outputIndex */) noexcept
1230 {
1231 return -1;
1232 }
1233};
1234
1235} // namespace v_2_0
1236
1247
1259
1271
1280
1283namespace v_1_0
1284{
1286{
1287public:
1291 InterfaceInfo getInterfaceInfo() const noexcept override
1292 {
1293 return {"IProfiler", 1, 0};
1294 }
1295
1303 virtual void reportLayerTime(char const* layerName, float ms) noexcept = 0;
1304
1305 ~IProfiler() override = default;
1306};
1307} // namespace v_1_0
1308
1321
1329enum class WeightsRole : int32_t
1330{
1331 kKERNEL = 0,
1332 kBIAS = 1,
1333 kSHIFT = 2,
1334 kSCALE = 3,
1335 kCONSTANT = 4,
1336 kANY = 5,
1337};
1338
1340template <>
1342{
1343 static constexpr int32_t kVALUE = 6;
1344};
1345
1351enum class DeviceType : int32_t
1352{
1353 kGPU = 0,
1354 kDLA = 1,
1355};
1356
1358template <>
1360{
1361 static constexpr int32_t kVALUE = 2;
1362};
1363
1374enum class TempfileControlFlag : int32_t
1375{
1378
1383};
1384
1386template <>
1388{
1389 static constexpr int32_t kVALUE = 2;
1390};
1391
1398using TempfileControlFlags = uint32_t;
1399
1431enum class TensorFormat : int32_t
1432{
1439 kLINEAR = 0,
1440
1445 kCHW2 = 1,
1446
1450 kHWC8 = 2,
1451
1465 kCHW4 = 3,
1466
1473 kCHW16 = 4,
1474
1482 kCHW32 = 5,
1483
1488 kDHWC8 = 6,
1489
1494 kCDHW32 = 7,
1495
1499 kHWC = 8,
1500
1509 kDLA_LINEAR = 9,
1510
1524 kDLA_HWC4 = 10,
1525
1530 kHWC16 = 11,
1531
1536 kDHWC = 12
1537};
1538
1540template <>
1542{
1544 static constexpr int32_t kVALUE = 13;
1545};
1546
1552enum class AllocatorFlag : int32_t
1553{
1555 kRESIZABLE = 0,
1556};
1557
1559template <>
1561{
1563 static constexpr int32_t kVALUE = 1;
1564};
1565
1566using AllocatorFlags = uint32_t;
1567
1576{
1578 kDEFAULT = 0,
1585 kSHARED_STATIC = 1,
1586};
1587
1589template <>
1591{
1593 static constexpr int32_t kVALUE = 2;
1594};
1595
1598namespace v_1_0
1599{
1600
1614{
1615public:
1619 InterfaceInfo getInterfaceInfo() const noexcept override
1620 {
1621 return {"ILogger", 1, 0};
1622 }
1623
1629 enum class Severity : int32_t
1630 {
1632 kINTERNAL_ERROR = 0,
1634 kERROR = 1,
1636 kWARNING = 2,
1638 kINFO = 3,
1640 kVERBOSE = 4,
1641 };
1642
1661 virtual void log(Severity severity, AsciiChar const* msg) noexcept = 0;
1662
1663 ILogger() = default;
1664 ~ILogger() override = default;
1665
1666protected:
1667 // @cond SuppressDoxyWarnings
1668 ILogger(ILogger const&) = default;
1669 ILogger(ILogger&&) = default;
1670 ILogger& operator=(ILogger const&) & = default;
1671 ILogger& operator=(ILogger&&) & = default;
1672 // @endcond
1673};
1674
1675} // namespace v_1_0
1676
1677using ILogger = v_1_0::ILogger;
1678
1680template <>
1682{
1684 static constexpr int32_t kVALUE = 5;
1685};
1686
1687namespace v_1_0
1688{
1689
1691{
1692public:
1718 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept = 0;
1719
1720 ~IGpuAllocator() override = default;
1721 IGpuAllocator() = default;
1722
1760 virtual void* reallocate(void* const /*baseAddr*/, uint64_t /*alignment*/, uint64_t /*newSize*/) noexcept
1761 {
1762 return nullptr;
1763 }
1764
1783 TRT_DEPRECATED virtual bool deallocate(void* const memory) noexcept = 0;
1784
1813 virtual void* allocateAsync(
1814 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t /*stream*/) noexcept
1815 {
1816 return allocate(size, alignment, flags);
1817 }
1846 virtual bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept
1847 {
1848 return deallocate(memory);
1849 }
1850
1854 InterfaceInfo getInterfaceInfo() const noexcept override
1855 {
1856 return {"IGpuAllocator", 1, 0};
1857 }
1858
1859protected:
1860 // @cond SuppressDoxyWarnings
1861 IGpuAllocator(IGpuAllocator const&) = default;
1862 IGpuAllocator(IGpuAllocator&&) = default;
1863 IGpuAllocator& operator=(IGpuAllocator const&) & = default;
1864 IGpuAllocator& operator=(IGpuAllocator&&) & = default;
1865 // @endcond
1866};
1867
1868} // namespace v_1_0
1869
1891
1892
1900class IRuntime : public INoCopy
1901{
1902public:
1903 virtual ~IRuntime() noexcept = 0;
1904
1919 void setDLACore(int32_t dlaCore) noexcept
1920 {
1921 mImpl->setDLACore(dlaCore);
1922 }
1923
1929 int32_t getDLACore() const noexcept
1930 {
1931 return mImpl->getDLACore();
1932 }
1933
1937 int32_t getNbDLACores() const noexcept
1938 {
1939 return mImpl->getNbDLACores();
1940 }
1941
1955 {
1956 return mImpl->setDLAWorkspaceAllocationStrategy(strategy);
1957 }
1958
1965 {
1966 return mImpl->getDLAWorkspaceAllocationStrategy();
1967 }
1968
1980 void setGpuAllocator(IGpuAllocator* allocator) noexcept
1981 {
1982 mImpl->setGpuAllocator(allocator);
1983 }
1984
1996 //
1999 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2000 {
2001 mImpl->setErrorRecorder(recorder);
2002 }
2003
2015 {
2016 return mImpl->getErrorRecorder();
2017 }
2018
2032 ICudaEngine* deserializeCudaEngine(void const* blob, std::size_t size) noexcept
2033 {
2034 return mImpl->deserializeCudaEngine(blob, size);
2035 }
2036
2056 {
2057 return mImpl->deserializeCudaEngineV2(streamReader);
2058 }
2059
2065 ILogger* getLogger() const noexcept
2066 {
2067 return mImpl->getLogger();
2068 }
2069
2080 bool setMaxThreads(int32_t maxThreads) noexcept
2081 {
2082 return mImpl->setMaxThreads(maxThreads);
2083 }
2084
2094 int32_t getMaxThreads() const noexcept
2095 {
2096 return mImpl->getMaxThreads();
2097 }
2098
2129 void setTemporaryDirectory(char const* path) noexcept
2130 {
2131 return mImpl->setTemporaryDirectory(path);
2132 }
2133
2140 char const* getTemporaryDirectory() const noexcept
2141 {
2142 return mImpl->getTemporaryDirectory();
2143 }
2144
2157 {
2158 return mImpl->setTempfileControlFlags(flags);
2159 }
2160
2169 {
2170 return mImpl->getTempfileControlFlags();
2171 }
2172
2179 {
2180 return mImpl->getPluginRegistry();
2181 }
2182
2196 IRuntime* loadRuntime(char const* path) noexcept
2197 {
2198 return mImpl->loadRuntime(path);
2199 }
2200
2208 void setEngineHostCodeAllowed(bool allowed) noexcept
2209 {
2210 return mImpl->setEngineHostCodeAllowed(allowed);
2211 }
2212
2218 bool getEngineHostCodeAllowed() const noexcept
2219 {
2220 return mImpl->getEngineHostCodeAllowed();
2221 }
2222
2223
2224protected:
2225 apiv::VRuntime* mImpl{};
2226};
2227
2228inline IRuntime::~IRuntime() noexcept = default;
2229
2237class IRefitter : public INoCopy
2238{
2239public:
2240 virtual ~IRefitter() noexcept = 0;
2241
2257 bool setWeights(char const* layerName, WeightsRole role, Weights weights) noexcept
2258 {
2259 return mImpl->setWeights(layerName, role, weights);
2260 }
2261
2274 bool refitCudaEngine() noexcept
2275 {
2276 return mImpl->refitCudaEngine();
2277 }
2278
2295 int32_t getMissing(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2296 {
2297 return mImpl->getMissing(size, layerNames, roles);
2298 }
2299
2312 int32_t getAll(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2313 {
2314 return mImpl->getAll(size, layerNames, roles);
2315 }
2316
2328 //
2331 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2332 {
2333 mImpl->setErrorRecorder(recorder);
2334 }
2335
2347 {
2348 return mImpl->getErrorRecorder();
2349 }
2350
2371 bool setNamedWeights(char const* name, Weights weights) noexcept
2372 {
2373 return mImpl->setNamedWeights(name, weights);
2374 }
2375
2391 int32_t getMissingWeights(int32_t size, char const** weightsNames) noexcept
2392 {
2393 return mImpl->getMissingWeights(size, weightsNames);
2394 }
2395
2407 int32_t getAllWeights(int32_t size, char const** weightsNames) noexcept
2408 {
2409 return mImpl->getAllWeights(size, weightsNames);
2410 }
2411
2417 ILogger* getLogger() const noexcept
2418 {
2419 return mImpl->getLogger();
2420 }
2421
2433 bool setMaxThreads(int32_t maxThreads) noexcept
2434 {
2435 return mImpl->setMaxThreads(maxThreads);
2436 }
2437
2447 int32_t getMaxThreads() const noexcept
2448 {
2449 return mImpl->getMaxThreads();
2450 }
2451
2474 bool setNamedWeights(char const* name, Weights weights, TensorLocation location) noexcept
2475 {
2476 return mImpl->setNamedWeightsWithLocation(name, weights, location);
2477 }
2478
2490 Weights getNamedWeights(char const* weightsName) const noexcept
2491 {
2492 return mImpl->getNamedWeights(weightsName);
2493 }
2494
2506 TensorLocation getWeightsLocation(char const* weightsName) const noexcept
2507 {
2508 return mImpl->getWeightsLocation(weightsName);
2509 }
2510
2522 bool unsetNamedWeights(char const* weightsName) noexcept
2523 {
2524 return mImpl->unsetNamedWeights(weightsName);
2525 }
2526
2538 void setWeightsValidation(bool weightsValidation) noexcept
2539 {
2540 return mImpl->setWeightsValidation(weightsValidation);
2541 }
2542
2546 bool getWeightsValidation() const noexcept
2547 {
2548 return mImpl->getWeightsValidation();
2549 }
2550
2574 bool refitCudaEngineAsync(cudaStream_t stream) noexcept
2575 {
2576 return mImpl->refitCudaEngineAsync(stream);
2577 }
2578
2592 Weights getWeightsPrototype(char const* weightsName) const noexcept
2593 {
2594 return mImpl->getWeightsPrototype(weightsName);
2595 }
2596
2597protected:
2598 apiv::VRefitter* mImpl;
2599};
2600
2601inline IRefitter::~IRefitter() noexcept = default;
2602
2613enum class OptProfileSelector : int32_t
2614{
2615 kMIN = 0,
2616 kOPT = 1,
2617 kMAX = 2
2618};
2619
2621template <>
2623{
2624 static constexpr int32_t kVALUE = 3;
2625};
2626
2650{
2651public:
2679 bool setDimensions(char const* inputName, OptProfileSelector select, Dims const& dims) noexcept
2680 {
2681 return mImpl->setDimensions(inputName, select, dims);
2682 }
2683
2691 Dims getDimensions(char const* inputName, OptProfileSelector select) const noexcept
2692 {
2693 return mImpl->getDimensions(inputName, select);
2694 }
2695
2704 int32_t getNbShapeValues(char const* inputName) const noexcept
2705 {
2706 return mImpl->getNbShapeValues(inputName);
2707 }
2708
2722 bool setExtraMemoryTarget(float target) noexcept
2723 {
2724 return mImpl->setExtraMemoryTarget(target);
2725 }
2726
2734 float getExtraMemoryTarget() const noexcept
2735 {
2736 return mImpl->getExtraMemoryTarget();
2737 }
2738
2751 bool isValid() const noexcept
2752 {
2753 return mImpl->isValid();
2754 }
2755
2799 char const* inputName, OptProfileSelector select, int64_t const* values, int32_t nbValues) noexcept
2800 {
2801 return mImpl->setShapeValuesV2(inputName, select, values, nbValues);
2802 }
2803
2811 int64_t const* getShapeValuesV2(char const* inputName, OptProfileSelector select) const noexcept
2812 {
2813 return mImpl->getShapeValuesV2(inputName, select);
2814 }
2815
2816protected:
2817 apiv::VOptimizationProfile* mImpl;
2818 virtual ~IOptimizationProfile() noexcept = 0;
2819};
2820
2821inline IOptimizationProfile::~IOptimizationProfile() noexcept = default;
2822
2830enum class TacticSource : int32_t
2831{
2836
2840};
2841
2843template <>
2845{
2846 static constexpr int32_t kVALUE = 2;
2847};
2848
2855using TacticSources = uint32_t;
2856
2866enum class ProfilingVerbosity : int32_t
2867{
2868 kLAYER_NAMES_ONLY = 0,
2869 kNONE = 1,
2870 kDETAILED = 2,
2871};
2872
2874template <>
2876{
2877 static constexpr int32_t kVALUE = 3;
2878};
2879
2886using SerializationFlags = uint32_t;
2887
2895enum class SerializationFlag : int32_t
2896{
2897 kEXCLUDE_WEIGHTS = 0,
2899 kINCLUDE_REFIT = 2,
2900};
2901
2903template <>
2905{
2906 static constexpr int32_t kVALUE = 3;
2907};
2908
2917{
2918public:
2919 virtual ~ISerializationConfig() noexcept = 0;
2920
2932 bool setFlags(SerializationFlags serializationFlags) noexcept
2933 {
2934 return mImpl->setFlags(serializationFlags);
2935 }
2936
2945 {
2946 return mImpl->getFlags();
2947 }
2948
2956 bool clearFlag(SerializationFlag serializationFlag) noexcept
2957 {
2958 return mImpl->clearFlag(serializationFlag);
2959 }
2960
2968 bool setFlag(SerializationFlag serializationFlag) noexcept
2969 {
2970 return mImpl->setFlag(serializationFlag);
2971 }
2972
2980 bool getFlag(SerializationFlag serializationFlag) const noexcept
2981 {
2982 return mImpl->getFlag(serializationFlag);
2983 }
2984
2985protected:
2986 apiv::VSerializationConfig* mImpl;
2987};
2988
2989inline ISerializationConfig::~ISerializationConfig() noexcept = default;
2990
3003{
3004 kSTATIC = 0,
3005 kON_PROFILE_CHANGE = 1,
3006 kUSER_MANAGED = 2,
3007};
3008
3011template <>
3013{
3014 static constexpr int32_t kVALUE = 3;
3015};
3016
3017
3025{
3026public:
3027 virtual ~IRuntimeConfig() noexcept = 0;
3028
3034 void setExecutionContextAllocationStrategy(ExecutionContextAllocationStrategy strategy) noexcept
3035 {
3036 return mImpl->setExecutionContextAllocationStrategy(strategy);
3037 }
3038
3045 {
3046 return mImpl->getExecutionContextAllocationStrategy();
3047 }
3048
3049
3050protected:
3051 apiv::VRuntimeConfig* mImpl;
3052}; // class IRuntimeConfig
3053
3054inline IRuntimeConfig::~IRuntimeConfig() noexcept = default;
3055
3064enum class EngineStat : int32_t
3065{
3068
3071};
3072
3074template <>
3076{
3077 static constexpr int32_t kVALUE = 2;
3078};
3079
3087class ICudaEngine : public INoCopy
3088{
3089public:
3090 virtual ~ICudaEngine() noexcept = 0;
3091
3102 Dims getTensorShape(char const* tensorName) const noexcept
3103 {
3104 return mImpl->getTensorShape(tensorName);
3105 }
3106
3117 DataType getTensorDataType(char const* tensorName) const noexcept
3118 {
3119 return mImpl->getTensorDataType(tensorName);
3120 }
3121
3131 int32_t getNbLayers() const noexcept
3132 {
3133 return mImpl->getNbLayers();
3134 }
3135
3145 IHostMemory* serialize() const noexcept
3146 {
3147 return mImpl->serialize();
3148 }
3149
3164 {
3165 return mImpl->createExecutionContext(strategy);
3166 }
3167
3180 TensorLocation getTensorLocation(char const* tensorName) const noexcept
3181 {
3182 return mImpl->getTensorLocation(tensorName);
3183 }
3184
3200 bool isShapeInferenceIO(char const* tensorName) const noexcept
3201 {
3202 return mImpl->isShapeInferenceIO(tensorName);
3203 }
3204
3214 TensorIOMode getTensorIOMode(char const* tensorName) const noexcept
3215 {
3216 return mImpl->getTensorIOMode(tensorName);
3217 }
3218
3233 TRT_NODISCARD char const* getAliasedInputTensor(char const* tensorName) const noexcept
3234 {
3235 return mImpl->getAliasedInputTensor(tensorName);
3236 }
3237
3246 {
3247 return mImpl->createExecutionContextWithRuntimeConfig(runtimeConfig);
3248 }
3249
3259 {
3260 return mImpl->createRuntimeConfig();
3261 }
3262
3263
3273 int64_t getDeviceMemorySizeV2() const noexcept
3274 {
3275 return mImpl->getDeviceMemorySizeV2();
3276 }
3277
3287 int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
3288 {
3289 return mImpl->getDeviceMemorySizeForProfileV2(profileIndex);
3290 }
3291
3297 bool isRefittable() const noexcept
3298 {
3299 return mImpl->isRefittable();
3300 }
3301
3318 int32_t getTensorBytesPerComponent(char const* tensorName) const noexcept
3319 {
3320 return mImpl->getTensorBytesPerComponent(tensorName);
3321 }
3322
3336 int32_t getTensorBytesPerComponent(char const* tensorName, int32_t profileIndex) const noexcept
3337 {
3338 return mImpl->getTensorBytesPerComponentV2(tensorName, profileIndex);
3339 }
3340
3357 int32_t getTensorComponentsPerElement(char const* tensorName) const noexcept
3358 {
3359 return mImpl->getTensorComponentsPerElement(tensorName);
3360 }
3361
3375 int32_t getTensorComponentsPerElement(char const* tensorName, int32_t profileIndex) const noexcept
3376 {
3377 return mImpl->getTensorComponentsPerElementV2(tensorName, profileIndex);
3378 }
3379
3390 TensorFormat getTensorFormat(char const* tensorName) const noexcept
3391 {
3392 return mImpl->getTensorFormat(tensorName);
3393 }
3394
3404 TensorFormat getTensorFormat(char const* tensorName, int32_t profileIndex) const noexcept
3405 {
3406 return mImpl->getTensorFormatV2(tensorName, profileIndex);
3407 }
3408
3428 char const* getTensorFormatDesc(char const* tensorName) const noexcept
3429 {
3430 return mImpl->getTensorFormatDesc(tensorName);
3431 }
3432
3451 char const* getTensorFormatDesc(char const* tensorName, int32_t profileIndex) const noexcept
3452 {
3453 return mImpl->getTensorFormatDescV2(tensorName, profileIndex);
3454 }
3455
3468 int32_t getTensorVectorizedDim(char const* tensorName) const noexcept
3469 {
3470 return mImpl->getTensorVectorizedDim(tensorName);
3471 }
3472
3484 int32_t getTensorVectorizedDim(char const* tensorName, int32_t profileIndex) const noexcept
3485 {
3486 return mImpl->getTensorVectorizedDimV2(tensorName, profileIndex);
3487 }
3488
3499 char const* getName() const noexcept
3500 {
3501 return mImpl->getName();
3502 }
3503
3510 int32_t getNbOptimizationProfiles() const noexcept
3511 {
3512 return mImpl->getNbOptimizationProfiles();
3513 }
3514
3530 Dims getProfileShape(char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
3531 {
3532 return mImpl->getProfileShape(tensorName, profileIndex, select);
3533 }
3534
3546 {
3547 return mImpl->getEngineCapability();
3548 }
3549
3564 void setErrorRecorder(IErrorRecorder* recorder) noexcept
3565 {
3566 return mImpl->setErrorRecorder(recorder);
3567 }
3568
3580 {
3581 return mImpl->getErrorRecorder();
3582 }
3583
3596 {
3597 return mImpl->getTacticSources();
3598 }
3599
3608 {
3609 return mImpl->getProfilingVerbosity();
3610 }
3611
3618 {
3619 return mImpl->createEngineInspector();
3620 }
3621
3630 int32_t getNbIOTensors() const noexcept
3631 {
3632 return mImpl->getNbIOTensors();
3633 }
3634
3642 char const* getIOTensorName(int32_t index) const noexcept
3643 {
3644 return mImpl->getIOTensorName(index);
3645 }
3646
3654 {
3655 return mImpl->getHardwareCompatibilityLevel();
3656 }
3657
3668 int32_t getNbAuxStreams() const noexcept
3669 {
3670 return mImpl->getNbAuxStreams();
3671 }
3672
3679 {
3680 return mImpl->createSerializationConfig();
3681 }
3682
3699 {
3700 return mImpl->serializeWithConfig(config);
3701 }
3702
3714 int64_t getStreamableWeightsSize() const noexcept
3715 {
3716 return mImpl->getStreamableWeightsSize();
3717 }
3718
3753 bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
3754 {
3755 return mImpl->setWeightStreamingBudgetV2(gpuMemoryBudget);
3756 }
3757
3769 int64_t getWeightStreamingBudgetV2() const noexcept
3770 {
3771 return mImpl->getWeightStreamingBudgetV2();
3772 }
3773
3792 int64_t getWeightStreamingAutomaticBudget() const noexcept
3793 {
3794 return mImpl->getWeightStreamingAutomaticBudget();
3795 }
3796
3819 {
3820 return mImpl->getWeightStreamingScratchMemorySize();
3821 }
3822
3832 bool isDebugTensor(char const* name) const noexcept
3833 {
3834 return mImpl->isDebugTensor(name);
3835 }
3836
3855 char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
3856 {
3857 return mImpl->getProfileTensorValuesV2(tensorName, profileIndex, select);
3858 }
3859
3882 int64_t getEngineStat(EngineStat stat) const noexcept
3883 {
3884 return mImpl->getEngineStat(stat);
3885 }
3886
3887protected:
3888 apiv::VCudaEngine* mImpl;
3889};
3890
3891inline ICudaEngine::~ICudaEngine() noexcept = default;
3892
3893namespace v_1_0
3894{
3896{
3897public:
3901 InterfaceInfo getInterfaceInfo() const noexcept override
3902 {
3903 return {"IOutputAllocator", 1, 0};
3904 }
3905
3926 char const* /* tensorName */, void* /* currentMemory */, uint64_t /* size */, uint64_t /* alignment */) noexcept
3927 {
3928 return nullptr;
3929 }
3930
3954 [[maybe_unused]] char const* tensorName, [[maybe_unused]] void* currentMemory, [[maybe_unused]] uint64_t size,
3955 [[maybe_unused]] uint64_t alignment, cudaStream_t /* stream */)
3956 {
3957 return reallocateOutput(tensorName, currentMemory, size, alignment);
3958 }
3959
3968 virtual void notifyShape(char const* tensorName, Dims const& dims) noexcept = 0;
3969};
3970} // namespace v_1_0
3971
3980
3981namespace v_1_0
3982{
3984{
3985public:
3989 InterfaceInfo getInterfaceInfo() const noexcept override
3990 {
3991 return {"IDebugListener", 1, 0};
3992 }
3993
4007 virtual bool processDebugTensor(void const* addr, TensorLocation location, DataType type, Dims const& shape,
4008 char const* name, cudaStream_t stream)
4009 = 0;
4010
4011 ~IDebugListener() override = default;
4012};
4013} // namespace v_1_0
4014
4021
4033{
4034public:
4035 virtual ~IExecutionContext() noexcept = 0;
4036
4045 void setDebugSync(bool sync) noexcept
4046 {
4047 mImpl->setDebugSync(sync);
4048 }
4049
4055 bool getDebugSync() const noexcept
4056 {
4057 return mImpl->getDebugSync();
4058 }
4059
4065 void setProfiler(IProfiler* profiler) noexcept
4066 {
4067 mImpl->setProfiler(profiler);
4068 }
4069
4075 IProfiler* getProfiler() const noexcept
4076 {
4077 return mImpl->getProfiler();
4078 }
4079
4085 ICudaEngine const& getEngine() const noexcept
4086 {
4087 return mImpl->getEngine();
4088 }
4089
4099 void setName(char const* name) noexcept
4100 {
4101 mImpl->setName(name);
4102 }
4103
4109 char const* getName() const noexcept
4110 {
4111 return mImpl->getName();
4112 }
4113
4135 void setDeviceMemory(void* memory) noexcept
4136 {
4137 mImpl->setDeviceMemory(memory);
4138 }
4139
4156 void setDeviceMemoryV2(void* memory, int64_t size) noexcept
4157 {
4158 return mImpl->setDeviceMemoryV2(memory, size);
4159 }
4160
4177 Dims getTensorStrides(char const* tensorName) const noexcept
4178 {
4179 return mImpl->getTensorStrides(tensorName);
4180 }
4181
4182public:
4192 int32_t getOptimizationProfile() const noexcept
4193 {
4194 return mImpl->getOptimizationProfile();
4195 }
4196
4210 bool setInputShape(char const* tensorName, Dims const& dims) noexcept
4211 {
4212 return mImpl->setInputShape(tensorName, dims);
4213 }
4214
4247 Dims getTensorShape(char const* tensorName) const noexcept
4248 {
4249 return mImpl->getTensorShape(tensorName);
4250 }
4251
4263 bool allInputDimensionsSpecified() const noexcept
4264 {
4265 return mImpl->allInputDimensionsSpecified();
4266 }
4267
4282 void setErrorRecorder(IErrorRecorder* recorder) noexcept
4283 {
4284 mImpl->setErrorRecorder(recorder);
4285 }
4286
4298 {
4299 return mImpl->getErrorRecorder();
4300 }
4301
4314 bool executeV2(void* const* bindings) noexcept
4315 {
4316 return mImpl->executeV2(bindings);
4317 }
4318
4358 bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
4359 {
4360 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
4361 }
4362
4374 void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
4375 {
4376 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
4377 }
4378
4386 bool getEnqueueEmitsProfile() const noexcept
4387 {
4388 return mImpl->getEnqueueEmitsProfile();
4389 }
4390
4416 bool reportToProfiler() const noexcept
4417 {
4418 return mImpl->reportToProfiler();
4419 }
4420
4460 bool setTensorAddress(char const* tensorName, void* data) noexcept
4461 {
4462 return mImpl->setTensorAddress(tensorName, data);
4463 }
4464
4477 void const* getTensorAddress(char const* tensorName) const noexcept
4478 {
4479 return mImpl->getTensorAddress(tensorName);
4480 }
4481
4500 bool setOutputTensorAddress(char const* tensorName, void* data) noexcept
4501 {
4502 return mImpl->setOutputTensorAddress(tensorName, data);
4503 }
4504
4522 bool setInputTensorAddress(char const* tensorName, void const* data) noexcept
4523 {
4524 return mImpl->setInputTensorAddress(tensorName, data);
4525 }
4526
4541 void* getOutputTensorAddress(char const* tensorName) const noexcept
4542 {
4543 return mImpl->getOutputTensorAddress(tensorName);
4544 }
4545
4574 int32_t inferShapes(int32_t nbMaxNames, char const** tensorNames) noexcept
4575 {
4576 return mImpl->inferShapes(nbMaxNames, tensorNames);
4577 }
4578
4592 {
4593 return mImpl->updateDeviceMemorySizeForShapes();
4594 }
4595
4607 bool setInputConsumedEvent(cudaEvent_t event) noexcept
4608 {
4609 return mImpl->setInputConsumedEvent(event);
4610 }
4611
4617 cudaEvent_t getInputConsumedEvent() const noexcept
4618 {
4619 return mImpl->getInputConsumedEvent();
4620 }
4621
4636 bool setOutputAllocator(char const* tensorName, IOutputAllocator* outputAllocator) noexcept
4637 {
4638 return mImpl->setOutputAllocator(tensorName, outputAllocator);
4639 }
4640
4649 IOutputAllocator* getOutputAllocator(char const* tensorName) const noexcept
4650 {
4651 return mImpl->getOutputAllocator(tensorName);
4652 }
4653
4667 int64_t getMaxOutputSize(char const* tensorName) const noexcept
4668 {
4669 return mImpl->getMaxOutputSize(tensorName);
4670 }
4671
4688 {
4689 return mImpl->setTemporaryStorageAllocator(allocator);
4690 }
4691
4698 {
4699 return mImpl->getTemporaryStorageAllocator();
4700 }
4701
4721 bool enqueueV3(cudaStream_t stream) noexcept
4722 {
4723 return mImpl->enqueueV3(stream);
4724 }
4725
4737 void setPersistentCacheLimit(size_t size) noexcept
4738 {
4739 mImpl->setPersistentCacheLimit(size);
4740 }
4741
4748 size_t getPersistentCacheLimit() const noexcept
4749 {
4750 return mImpl->getPersistentCacheLimit();
4751 }
4752
4772 bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
4773 {
4774 return mImpl->setNvtxVerbosity(verbosity);
4775 }
4776
4785 {
4786 return mImpl->getNvtxVerbosity();
4787 }
4788
4815 void setAuxStreams(cudaStream_t* auxStreams, int32_t nbStreams) noexcept
4816 {
4817 mImpl->setAuxStreams(auxStreams, nbStreams);
4818 }
4819
4827 bool setDebugListener(IDebugListener* listener) noexcept
4828 {
4829 return mImpl->setDebugListener(listener);
4830 }
4831
4838 {
4839 return mImpl->getDebugListener();
4840 }
4841
4856 bool setTensorDebugState(char const* name, bool flag) noexcept
4857 {
4858 return mImpl->setTensorDebugState(name, flag);
4859 }
4860
4868 bool getDebugState(char const* name) const noexcept
4869 {
4870 return mImpl->getDebugState(name);
4871 }
4872
4879 {
4880 return mImpl->getRuntimeConfig();
4881 }
4882
4891 bool setAllTensorsDebugState(bool flag) noexcept
4892 {
4893 return mImpl->setAllTensorsDebugState(flag);
4894 }
4895
4907 bool setUnfusedTensorsDebugState(bool flag) noexcept
4908 {
4909 return mImpl->setUnfusedTensorsDebugState(flag);
4910 }
4911
4917 bool getUnfusedTensorsDebugState() const noexcept
4918 {
4919 return mImpl->getUnfusedTensorsDebugState();
4920 }
4921
4935 bool setCommunicator(void* communicator) noexcept
4936 {
4937 return mImpl->setCommunicator(communicator);
4938 }
4939
4940protected:
4941 apiv::VExecutionContext* mImpl;
4942}; // class IExecutionContext
4943
4944inline IExecutionContext::~IExecutionContext() noexcept = default;
4945
4953enum class LayerInformationFormat : int32_t
4954{
4955 kONELINE = 0,
4956 kJSON = 1,
4957};
4958
4960template <>
4962{
4963 static constexpr int32_t kVALUE = 2;
4964};
4965
4982{
4983public:
4984 virtual ~IEngineInspector() noexcept = 0;
4985
4998 bool setExecutionContext(IExecutionContext const* context) noexcept
4999 {
5000 return mImpl->setExecutionContext(context);
5001 }
5002
5011 {
5012 return mImpl->getExecutionContext();
5013 }
5014
5035 char const* getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
5036 {
5037 return mImpl->getLayerInformation(layerIndex, format);
5038 }
5039
5058 char const* getEngineInformation(LayerInformationFormat format) const noexcept
5059 {
5060 return mImpl->getEngineInformation(format);
5061 }
5062
5077 void setErrorRecorder(IErrorRecorder* recorder) noexcept
5078 {
5079 mImpl->setErrorRecorder(recorder);
5080 }
5081
5093 {
5094 return mImpl->getErrorRecorder();
5095 }
5096
5097protected:
5098 apiv::VEngineInspector* mImpl;
5099}; // class IEngineInspector
5100
5101inline IEngineInspector::~IEngineInspector() noexcept = default;
5102
5103} // namespace nvinfer1
5104
5109extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
5110
5115extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
5116
5120extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry() noexcept;
5121
5127extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
5128
5129namespace nvinfer1
5130{
5131namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this
5132 // header.
5133{
5139inline IRuntime* createInferRuntime(ILogger& logger) noexcept
5140{
5141 return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
5142}
5143
5150inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
5151{
5152 return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
5153}
5154
5155} // namespace
5156
5168template <typename T>
5170{
5171public:
5173 {
5174 getPluginRegistry()->registerCreator(instance, "");
5175 }
5176
5177private:
5179 T instance{};
5180};
5181
5182} // namespace nvinfer1
5183
5184#define REGISTER_TENSORRT_PLUGIN(name) \
5185 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
5186
5187namespace nvinfer1
5188{
5191namespace v_1_0
5192{
5202{
5203public:
5207 InterfaceInfo getInterfaceInfo() const noexcept override
5208 {
5209 return {"ILoggerFinder", 1, 0};
5210 }
5211
5219 virtual ILogger* findLogger() = 0;
5220
5221protected:
5223 ~ILoggerFinder() override = default;
5224};
5225
5226} // namespace v_1_0
5227
5229
5232namespace v_1_0
5233{
5234
5236{
5237public:
5239 ~IGpuAsyncAllocator() override = default;
5240
5270 void* allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags,
5271 cudaStream_t /*stream*/) noexcept override = 0;
5272
5298 bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept override = 0;
5299
5324 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept override
5325 {
5326 return allocateAsync(size, alignment, flags, nullptr);
5327 }
5328
5347 TRT_DEPRECATED bool deallocate(void* const memory) noexcept override
5348 {
5349 return deallocateAsync(memory, nullptr);
5350 }
5351
5355 InterfaceInfo getInterfaceInfo() const noexcept override
5356 {
5357 return {"IGpuAllocator", 1, 0};
5358 }
5359};
5360
5362{
5363public:
5367 InterfaceInfo getInterfaceInfo() const noexcept override
5368 {
5369 return InterfaceInfo{"PLUGIN CREATOR_V3ONE", 1, 0};
5370 }
5371
5389 AsciiChar const* name, PluginFieldCollection const* fc, TensorRTPhase phase) noexcept = 0;
5390
5397 virtual PluginFieldCollection const* getFieldNames() noexcept = 0;
5398
5405 virtual AsciiChar const* getPluginName() const noexcept = 0;
5406
5413 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
5414
5421 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
5422
5424 virtual ~IPluginCreatorV3One() = default;
5425
5426protected:
5429 IPluginCreatorV3One& operator=(IPluginCreatorV3One const&) & = default;
5430 IPluginCreatorV3One& operator=(IPluginCreatorV3One&&) & = default;
5431};
5432
5433} // namespace v_1_0
5434
5449
5459
5460} // namespace nvinfer1
5461
5465extern "C" TENSORRTAPI int32_t getInferLibMajorVersion() noexcept;
5469extern "C" TENSORRTAPI int32_t getInferLibMinorVersion() noexcept;
5473extern "C" TENSORRTAPI int32_t getInferLibPatchVersion() noexcept;
5477extern "C" TENSORRTAPI int32_t getInferLibBuildVersion() noexcept;
5478
5479#endif // NV_INFER_RUNTIME_H
TENSORRTAPI nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
TENSORRTAPI nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
TENSORRTAPI int32_t getInferLibMinorVersion() noexcept
Return the library minor version number.
TENSORRTAPI int32_t getInferLibMajorVersion() noexcept
Return the library major version number.
TENSORRTAPI int32_t getInferLibPatchVersion() noexcept
Return the library patch version number.
TENSORRTAPI int32_t getInferLibBuildVersion() noexcept
Return the library build version number.
#define TENSORRTAPI
Definition: NvInferRuntimeBase.h:70
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:102
#define TRT_NODISCARD
A stand-in for [[nodiscard]] and [[nodiscard(REASON)]] that works with older compilers.
Definition: NvInferRuntimeBase.h:57
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeBase.h:224
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:227
Analog of class Dims with expressions instead of constants for the dimensions.
Definition: NvInferRuntime.h:361
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:363
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3088
int32_t getTensorBytesPerComponent(char const *tensorName) const noexcept
Return the number of bytes per component of an element, or -1 if the tensor is not vectorized or prov...
Definition: NvInferRuntime.h:3318
ISerializationConfig * createSerializationConfig() noexcept
Create a serialization configuration object.
Definition: NvInferRuntime.h:3678
char const * getIOTensorName(int32_t index) const noexcept
Return name of an IO tensor.
Definition: NvInferRuntime.h:3642
int64_t getWeightStreamingBudgetV2() const noexcept
Returns the current weight streaming device memory budget in bytes.
Definition: NvInferRuntime.h:3769
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:3545
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:3579
TensorFormat getTensorFormat(char const *tensorName, int32_t profileIndex) const noexcept
Return the tensor format of given profile, or TensorFormat::kLINEAR if the provided name does not map...
Definition: NvInferRuntime.h:3404
int64_t const * getProfileTensorValuesV2(char const *tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum values (not dimensions) for an input tensor given its name under ...
Definition: NvInferRuntime.h:3854
apiv::VCudaEngine * mImpl
Definition: NvInferRuntime.h:3888
IExecutionContext * createExecutionContext(ExecutionContextAllocationStrategy strategy=ExecutionContextAllocationStrategy::kSTATIC) noexcept
Create an execution context and specify the strategy for allocating internal activation memory.
Definition: NvInferRuntime.h:3162
char const * getTensorFormatDesc(char const *tensorName) const noexcept
Return the human readable description of the tensor format, or empty string if the provided name does...
Definition: NvInferRuntime.h:3428
Dims getProfileShape(char const *tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for an input tensor given its name under an optimizati...
Definition: NvInferRuntime.h:3530
bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
Limit the maximum amount of GPU memory usable for network weights in bytes.
Definition: NvInferRuntime.h:3753
IExecutionContext * createExecutionContext(IRuntimeConfig *runtimeConfig) noexcept
Create an execution context with TensorRT JIT runtime config.
Definition: NvInferRuntime.h:3245
int32_t getNbAuxStreams() const noexcept
Return the number of auxiliary streams used by this engine.
Definition: NvInferRuntime.h:3668
int64_t getStreamableWeightsSize() const noexcept
Get the total size in bytes of all streamable weights.
Definition: NvInferRuntime.h:3714
DataType getTensorDataType(char const *tensorName) const noexcept
Determine the required data type for a buffer from its tensor name.
Definition: NvInferRuntime.h:3117
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:3564
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine.
Definition: NvInferRuntime.h:3595
TRT_NODISCARD char const * getAliasedInputTensor(char const *tensorName) const noexcept
Get the input tensor name that an output tensor should alias with.
Definition: NvInferRuntime.h:3233
IHostMemory * serializeWithConfig(ISerializationConfig &config) const noexcept
Serialize the network to a stream with the provided SerializationConfig.
Definition: NvInferRuntime.h:3698
int64_t getWeightStreamingAutomaticBudget() const noexcept
TensorRT automatically determines a device memory budget for the model to run. The budget is close to...
Definition: NvInferRuntime.h:3792
bool isDebugTensor(char const *name) const noexcept
Check if a tensor is marked as a debug tensor.
Definition: NvInferRuntime.h:3832
int32_t getTensorVectorizedDim(char const *tensorName, int32_t profileIndex) const noexcept
Return the dimension index that the buffer is vectorized of given profile, or -1 if the provided name...
Definition: NvInferRuntime.h:3484
char const * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:3499
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:3607
bool isShapeInferenceIO(char const *tensorName) const noexcept
True if tensor is required as input for shape calculations or is output from shape calculations.
Definition: NvInferRuntime.h:3200
int64_t getWeightStreamingScratchMemorySize() const noexcept
Returns the size of the scratch memory required by the current weight streaming budget.
Definition: NvInferRuntime.h:3818
int64_t getDeviceMemorySizeV2() const noexcept
Return the maximum device memory required by the context over all profiles.
Definition: NvInferRuntime.h:3273
int32_t getTensorVectorizedDim(char const *tensorName) const noexcept
Return the dimension index that the buffer is vectorized, or -1 if the provided name does not map to ...
Definition: NvInferRuntime.h:3468
int32_t getTensorComponentsPerElement(char const *tensorName, int32_t profileIndex) const noexcept
Return the number of components included in one element of given profile, or -1 if tensor is not vect...
Definition: NvInferRuntime.h:3375
int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
Return the maximum device memory required by the context for a profile.
Definition: NvInferRuntime.h:3287
IRuntimeConfig * createRuntimeConfig() noexcept
Create a runtime config for TensorRT JIT. The caller is responsible for ownership of the returned IRu...
Definition: NvInferRuntime.h:3258
TensorFormat getTensorFormat(char const *tensorName) const noexcept
Return the tensor format, or TensorFormat::kLINEAR if the provided name does not map to an input or o...
Definition: NvInferRuntime.h:3390
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:3145
int64_t getEngineStat(EngineStat stat) const noexcept
Get engine statistics according to the given enum value.
Definition: NvInferRuntime.h:3882
TensorLocation getTensorLocation(char const *tensorName) const noexcept
Get whether an input or output tensor must be on GPU or CPU.
Definition: NvInferRuntime.h:3180
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:3617
int32_t getTensorBytesPerComponent(char const *tensorName, int32_t profileIndex) const noexcept
Return the number of bytes per component of an element given of given profile, or -1 if the tensor is...
Definition: NvInferRuntime.h:3336
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Return the hardware compatibility level of this engine.
Definition: NvInferRuntime.h:3653
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:3510
char const * getTensorFormatDesc(char const *tensorName, int32_t profileIndex) const noexcept
Return the human readable description of the tensor format of given profile, or empty string if the p...
Definition: NvInferRuntime.h:3451
TensorIOMode getTensorIOMode(char const *tensorName) const noexcept
Determine whether a tensor is an input or output tensor.
Definition: NvInferRuntime.h:3214
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:3131
int32_t getNbIOTensors() const noexcept
Return number of IO tensors.
Definition: NvInferRuntime.h:3630
virtual ~ICudaEngine() noexcept=0
int32_t getTensorComponentsPerElement(char const *tensorName) const noexcept
Return the number of components included in one element, or -1 if tensor is not vectorized or if the ...
Definition: NvInferRuntime.h:3357
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:3297
An IDimensionExpr represents an integer expression constructed from constants, input dimensions,...
Definition: NvInferRuntime.h:239
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:244
bool isSizeTensor() const noexcept
Return true if this denotes the value of a size tensor.
Definition: NvInferRuntime.h:270
virtual ~IDimensionExpr() noexcept=0
apiv::VDimensionExpr * mImpl
Definition: NvInferRuntime.h:261
int64_t getConstantValue() const noexcept
Get the value of the constant.
Definition: NvInferRuntime.h:255
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:4982
char const * getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
Get a string describing the information about a specific layer in the current engine or the execution...
Definition: NvInferRuntime.h:5035
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:5092
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:5077
virtual ~IEngineInspector() noexcept=0
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:5010
apiv::VEngineInspector * mImpl
Definition: NvInferRuntime.h:5098
char const * getEngineInformation(LayerInformationFormat format) const noexcept
Get a string describing the information about all the layers in the current engine or the execution c...
Definition: NvInferRuntime.h:5058
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:4033
IOutputAllocator * getOutputAllocator(char const *tensorName) const noexcept
Get output allocator associated with output tensor of given name, or nullptr if the provided name doe...
Definition: NvInferRuntime.h:4649
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:4297
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:4416
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:4135
bool setTensorDebugState(char const *name, bool flag) noexcept
Set debug state of tensor given the tensor name.
Definition: NvInferRuntime.h:4856
char const * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:4109
IGpuAllocator * getTemporaryStorageAllocator() const noexcept
Get allocator set by setTemporaryStorageAllocator.
Definition: NvInferRuntime.h:4697
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:4374
bool setUnfusedTensorsDebugState(bool flag) noexcept
Turn the debug state of unfused tensors on or off.
Definition: NvInferRuntime.h:4907
Dims getTensorShape(char const *tensorName) const noexcept
Return the shape of the given input or output.
Definition: NvInferRuntime.h:4247
bool getDebugState(char const *name) const noexcept
Get the debug state.
Definition: NvInferRuntime.h:4868
bool setInputShape(char const *tensorName, Dims const &dims) noexcept
Set shape of given input.
Definition: NvInferRuntime.h:4210
bool executeV2(void *const *bindings) noexcept
Synchronously execute a network.
Definition: NvInferRuntime.h:4314
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:4386
void const * getTensorAddress(char const *tensorName) const noexcept
Get memory address bound to given input or output tensor, or nullptr if the provided name does not ma...
Definition: NvInferRuntime.h:4477
bool setOutputAllocator(char const *tensorName, IOutputAllocator *outputAllocator) noexcept
Set output allocator to use for output tensor of given name. Pass nullptr to outputAllocator to unset...
Definition: NvInferRuntime.h:4636
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:4358
apiv::VExecutionContext * mImpl
Definition: NvInferRuntime.h:4941
bool setOutputTensorAddress(char const *tensorName, void *data) noexcept
Set the memory address for a given output tensor.
Definition: NvInferRuntime.h:4500
void setPersistentCacheLimit(size_t size) noexcept
Set the maximum size for persistent cache usage.
Definition: NvInferRuntime.h:4737
virtual ~IExecutionContext() noexcept=0
size_t getPersistentCacheLimit() const noexcept
Get the maximum size for persistent cache usage.
Definition: NvInferRuntime.h:4748
bool setAllTensorsDebugState(bool flag) noexcept
Turn the debug state of all debug tensors on or off.
Definition: NvInferRuntime.h:4891
ICudaEngine const & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:4085
ProfilingVerbosity getNvtxVerbosity() const noexcept
Get the NVTX verbosity of the execution context.
Definition: NvInferRuntime.h:4784
size_t updateDeviceMemorySizeForShapes() noexcept
Recompute the internal activation buffer sizes based on the current input shapes, and return the tota...
Definition: NvInferRuntime.h:4591
void setAuxStreams(cudaStream_t *auxStreams, int32_t nbStreams) noexcept
Set the auxiliary streams that TensorRT should launch kernels on in the next enqueueV3() call.
Definition: NvInferRuntime.h:4815
int64_t getMaxOutputSize(char const *tensorName) const noexcept
Get upper bound on an output tensor's size, in bytes, based on the current optimization profile and i...
Definition: NvInferRuntime.h:4667
int32_t inferShapes(int32_t nbMaxNames, char const **tensorNames) noexcept
Run shape calculations.
Definition: NvInferRuntime.h:4574
bool setDebugListener(IDebugListener *listener) noexcept
Set DebugListener for this execution context.
Definition: NvInferRuntime.h:4827
bool setTensorAddress(char const *tensorName, void *data) noexcept
Set memory address for given input or output tensor.
Definition: NvInferRuntime.h:4460
bool setTemporaryStorageAllocator(IGpuAllocator *allocator) noexcept
Specify allocator to use for internal temporary storage.
Definition: NvInferRuntime.h:4687
void * getOutputTensorAddress(char const *tensorName) const noexcept
Get memory address for given output.
Definition: NvInferRuntime.h:4541
bool enqueueV3(cudaStream_t stream) noexcept
Enqueue inference on a stream.
Definition: NvInferRuntime.h:4721
IDebugListener * getDebugListener() noexcept
Get the DebugListener of this execution context.
Definition: NvInferRuntime.h:4837
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:4192
bool setInputTensorAddress(char const *tensorName, void const *data) noexcept
Set memory address for given input.
Definition: NvInferRuntime.h:4522
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:4055
bool setInputConsumedEvent(cudaEvent_t event) noexcept
Mark input as consumed.
Definition: NvInferRuntime.h:4607
Dims getTensorStrides(char const *tensorName) const noexcept
Return the strides of the buffer for the given tensor name.
Definition: NvInferRuntime.h:4177
bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
Set the verbosity of the NVTX markers in the execution context.
Definition: NvInferRuntime.h:4772
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:4075
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:4282
bool setCommunicator(void *communicator) noexcept
Set the NCCL communicator for the execution context.
Definition: NvInferRuntime.h:4935
void setDeviceMemoryV2(void *memory, int64_t size) noexcept
Set the device memory and its corresponding size for use by this execution context.
Definition: NvInferRuntime.h:4156
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:4263
bool getUnfusedTensorsDebugState() const noexcept
Get the debug state of unfused tensors.
Definition: NvInferRuntime.h:4917
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:4065
void setName(char const *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:4099
cudaEvent_t getInputConsumedEvent() const noexcept
The event associated with consuming the input.
Definition: NvInferRuntime.h:4617
IRuntimeConfig * getRuntimeConfig() const noexcept
Get the runtime config object used during execution context creation.
Definition: NvInferRuntime.h:4878
Object for constructing IDimensionExpr.
Definition: NvInferRuntime.h:296
IDimensionExpr const * operation(DimensionOperation op, IDimensionExpr const &first, IDimensionExpr const &second) noexcept
Get the operation.
Definition: NvInferRuntime.h:312
IDimensionExpr const * constant(int64_t value) noexcept
Return pointer to IDimensionExpr for given value.
Definition: NvInferRuntime.h:301
apiv::VExprBuilder * mImpl
Definition: NvInferRuntime.h:319
virtual ~IExprBuilder() noexcept=0
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:150
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:155
virtual ~IHostMemory() noexcept=0
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:167
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:161
apiv::VHostMemory * mImpl
Definition: NvInferRuntime.h:173
Forward declaration of IEngineInspector for use by other interfaces.
Definition: 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
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:2650
apiv::VOptimizationProfile * mImpl
Definition: NvInferRuntime.h:2817
Dims getDimensions(char const *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:2691
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:2734
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:2722
bool setDimensions(char const *inputName, OptProfileSelector select, Dims const &dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:2679
virtual ~IOptimizationProfile() noexcept=0
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:2751
int64_t const * getShapeValuesV2(char const *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:2811
bool setShapeValuesV2(char const *inputName, OptProfileSelector select, int64_t const *values, int32_t nbValues) noexcept
Set the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:2798
int32_t getNbShapeValues(char const *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:2704
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:56
virtual bool registerCreator(IPluginCreatorInterface &creator, AsciiChar const *const pluginNamespace) noexcept=0
Register a plugin creator. Returns false if a plugin creator with the same type is already registered...
Interface for plugins to access per context resources provided by TensorRT.
Definition: NvInferRuntime.h:803
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
Get the error recorder associated with the resource context.
IPluginResourceContext & operator=(IPluginResourceContext const &) &=default
virtual IGpuAllocator * getGpuAllocator() const noexcept=0
Get the GPU allocator associated with the resource context.
Similar to IPluginV2Ext, but with support for dynamic shapes.
Definition: NvInferRuntime.h:418
IPluginV2DynamicExt * clone() const noexcept override=0
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin...
virtual ~IPluginV2DynamicExt() noexcept
Definition: NvInferRuntime.h:567
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:474
Updates weights in an engine.
Definition: NvInferRuntime.h:2238
bool refitCudaEngineAsync(cudaStream_t stream) noexcept
Enqueue weights refitting of the associated engine on the given stream.
Definition: NvInferRuntime.h:2574
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the refitter.
Definition: NvInferRuntime.h:2447
TensorLocation getWeightsLocation(char const *weightsName) const noexcept
Get location for the weights associated with the given name.
Definition: NvInferRuntime.h:2506
bool setNamedWeights(char const *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:2371
int32_t getAllWeights(int32_t size, char const **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:2407
virtual ~IRefitter() noexcept=0
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:2417
bool refitCudaEngine() noexcept
Refits associated engine.
Definition: NvInferRuntime.h:2274
int32_t getMissingWeights(int32_t size, char const **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:2391
int32_t getMissing(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:2295
Weights getNamedWeights(char const *weightsName) const noexcept
Get weights associated with the given name.
Definition: NvInferRuntime.h:2490
bool unsetNamedWeights(char const *weightsName) noexcept
Unset weights associated with the given name.
Definition: NvInferRuntime.h:2522
Weights getWeightsPrototype(char const *weightsName) const noexcept
Get the Weights prototype associated with the given name.
Definition: NvInferRuntime.h:2592
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:2433
bool setNamedWeights(char const *name, Weights weights, TensorLocation location) noexcept
Specify new weights on a specified device of given name.
Definition: NvInferRuntime.h:2474
void setWeightsValidation(bool weightsValidation) noexcept
Set whether to validate weights during refitting.
Definition: NvInferRuntime.h:2538
apiv::VRefitter * mImpl
Definition: NvInferRuntime.h:2598
int32_t getAll(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:2312
bool getWeightsValidation() const noexcept
Get whether to validate weights values during refitting.
Definition: NvInferRuntime.h:2546
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2331
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2346
A class for runtime configuration. This class is used during execution context creation.
Definition: NvInferRuntime.h:3025
apiv::VRuntimeConfig * mImpl
Definition: NvInferRuntime.h:3051
virtual ~IRuntimeConfig() noexcept=0
ExecutionContextAllocationStrategy getExecutionContextAllocationStrategy() const noexcept
Get the execution context allocation strategy.
Definition: NvInferRuntime.h:3044
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:1901
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:2080
IRuntime * loadRuntime(char const *path) noexcept
Load IRuntime from the file.
Definition: NvInferRuntime.h:2196
bool getEngineHostCodeAllowed() const noexcept
Get whether the runtime is allowed to deserialize engines with host executable code.
Definition: NvInferRuntime.h:2218
TempfileControlFlags getTempfileControlFlags() const noexcept
Get the tempfile control flags for this runtime.
Definition: NvInferRuntime.h:2168
void setEngineHostCodeAllowed(bool allowed) noexcept
Set whether the runtime is allowed to deserialize engines with host executable code.
Definition: NvInferRuntime.h:2208
void setTemporaryDirectory(char const *path) noexcept
Set the directory that will be used by this runtime for temporary files.
Definition: NvInferRuntime.h:2129
bool setDLAWorkspaceAllocationStrategy(DLAWorkspaceAllocationStrategy strategy) noexcept
Sets the strategy used for DLA workspace allocation by subsequent engine deserializations.
Definition: NvInferRuntime.h:1954
IPluginRegistry & getPluginRegistry() noexcept
Get the local plugin registry that can be used by the runtime.
Definition: NvInferRuntime.h:2178
TRT_NODISCARD DLAWorkspaceAllocationStrategy getDLAWorkspaceAllocationStrategy() const noexcept
Returns the DLA workspace allocation strategy used for subsequent engine deserializations.
Definition: NvInferRuntime.h:1964
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible or 0 if DLA is unavailable.
Definition: NvInferRuntime.h:1937
ICudaEngine * deserializeCudaEngine(void const *blob, std::size_t size) noexcept
Deserialize an engine from host memory.
Definition: NvInferRuntime.h:2032
virtual ~IRuntime() noexcept=0
void setTempfileControlFlags(TempfileControlFlags flags) noexcept
Set the tempfile control flags for this runtime.
Definition: NvInferRuntime.h:2156
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:1929
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:1980
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2014
ICudaEngine * deserializeCudaEngine(IStreamReaderV2 &streamReader)
Deserialize an engine from a stream. IStreamReaderV2 is expected to support reading to both host and ...
Definition: NvInferRuntime.h:2055
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:2065
int32_t getMaxThreads() const noexcept
Get the maximum number of threads that can be used by the runtime.
Definition: NvInferRuntime.h:2094
char const * getTemporaryDirectory() const noexcept
Get the directory that will be used by this runtime for temporary files.
Definition: NvInferRuntime.h:2140
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1999
Holds properties for configuring an engine to serialize the binary.
Definition: NvInferRuntime.h:2917
bool clearFlag(SerializationFlag serializationFlag) noexcept
clear a serialization flag.
Definition: NvInferRuntime.h:2956
virtual ~ISerializationConfig() noexcept=0
bool setFlag(SerializationFlag serializationFlag) noexcept
Set a serialization flag.
Definition: NvInferRuntime.h:2968
SerializationFlags getFlags() const noexcept
Get the serialization flags for this config.
Definition: NvInferRuntime.h:2944
bool getFlag(SerializationFlag serializationFlag) const noexcept
Returns true if the serialization flag is set.
Definition: NvInferRuntime.h:2980
apiv::VSerializationConfig * mImpl
Definition: NvInferRuntime.h:2986
An Interface class for version control.
Definition: NvInferRuntimeBase.h:284
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:249
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:5170
PluginRegistrar()
Definition: NvInferRuntime.h:5172
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:132
DataType type
The type of the weights.
Definition: NvInferRuntime.h:134
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:136
void const * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:135
Definition: NvInferRuntime.h:3984
virtual bool processDebugTensor(void const *addr, TensorLocation location, DataType type, Dims const &shape, char const *name, cudaStream_t stream)=0
Callback function that is called when a debug tensor’s value is updated and the debug state of the te...
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:3989
~IDebugListener() override=default
Definition: NvInferRuntimeBase.h:421
Definition: NvInferRuntime.h:1691
virtual void * allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t) noexcept
A thread-safe callback implemented by the application to handle stream-ordered acquisition of GPU mem...
Definition: NvInferRuntime.h:1813
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1854
virtual TRT_DEPRECATED bool deallocate(void *const memory) noexcept=0
A thread-safe callback implemented by the application to handle release of GPU memory.
~IGpuAllocator() override=default
virtual void * reallocate(void *const, uint64_t, uint64_t) noexcept
A thread-safe callback implemented by the application to resize an existing allocation.
Definition: NvInferRuntime.h:1760
virtual TRT_DEPRECATED void * allocate(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept=0
A thread-safe callback implemented by the application to handle acquisition of GPU memory.
virtual bool deallocateAsync(void *const memory, cudaStream_t) noexcept
A thread-safe callback implemented by the application to handle stream-ordered release of GPU memory.
Definition: NvInferRuntime.h:1846
Definition: NvInferRuntime.h:5236
bool deallocateAsync(void *const memory, cudaStream_t) noexcept override=0
A thread-safe callback implemented by the application to handle stream-ordered asynchronous release o...
void * allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t) noexcept override=0
A thread-safe callback implemented by the application to handle stream-ordered asynchronous acquisiti...
TRT_DEPRECATED void * allocate(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept override
A thread-safe callback implemented by the application to handle acquisition of GPU memory.
Definition: NvInferRuntime.h:5323
TRT_DEPRECATED bool deallocate(void *const memory) noexcept override
A thread-safe callback implemented by the application to handle release of GPU memory.
Definition: NvInferRuntime.h:5347
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:5355
~IGpuAsyncAllocator() override=default
A virtual base class to find a logger. Allows a plugin to find an instance of a logger if it needs to...
Definition: NvInferRuntime.h:5202
virtual ILogger * findLogger()=0
Get the logger used by the engine or execution context which called the plugin method.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:5207
~ILoggerFinder() override=default
Protected: TRT owns ILoggerFinder instances and passes non-owning pointers to plugins.
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntime.h:1614
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1619
~ILogger() override=default
Severity
The severity corresponding to a log message.
Definition: NvInferRuntime.h:1630
virtual void log(Severity severity, AsciiChar const *msg) noexcept=0
A callback implemented by the application to handle logging messages;.
Definition: NvInferRuntime.h:3896
virtual TRT_DEPRECATED void * reallocateOutput(char const *, void *, uint64_t, uint64_t) noexcept
Return a pointer to memory for an output tensor, or nullptr if memory cannot be allocated....
Definition: NvInferRuntime.h:3925
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:3901
virtual void * reallocateOutputAsync(char const *tensorName, void *currentMemory, uint64_t size, uint64_t alignment, cudaStream_t)
Return a pointer to memory for an output tensor, or nullptr if memory cannot be allocated....
Definition: NvInferRuntime.h:3953
virtual void notifyShape(char const *tensorName, Dims const &dims) noexcept=0
Called by TensorRT when the shape of the output tensor is known.
Definition: NvInferPluginBase.h:141
Definition: NvInferPluginBase.h:193
Definition: NvInferRuntime.h:5362
virtual PluginFieldCollection const * getFieldNames() noexcept=0
Return a list of fields that need to be passed to createPlugin() when creating a plugin for use in th...
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:5367
virtual IPluginV3 * createPlugin(AsciiChar const *name, PluginFieldCollection const *fc, TensorRTPhase phase) noexcept=0
Return a plugin object. Return nullptr in case of error.
Definition: NvInferPluginBase.h:206
Definition: NvInferRuntime.h:874
virtual int32_t getFormatCombinationLimit() noexcept
Return the maximum number of format combinations that will be timed by TensorRT during the build phas...
Definition: NvInferRuntime.h:1078
virtual int32_t getNbOutputs() const noexcept=0
Get the number of outputs from the plugin.
virtual int32_t configurePlugin(DynamicPluginTensorDesc const *in, int32_t nbInputs, DynamicPluginTensorDesc const *out, int32_t nbOutputs) noexcept=0
Configure the plugin.
virtual int32_t getNbTactics() noexcept
Query for the number of custom tactics the plugin intends to use.
Definition: NvInferRuntime.h:1054
virtual char const * getMetadataString() noexcept
Query for a string representing the configuration of the plugin. May be called anytime after plugin c...
Definition: NvInferRuntime.h:1089
virtual char const * getTimingCacheID() noexcept
Called to query the suffix to use for the timing cache ID. May be called anytime after plugin creatio...
Definition: NvInferRuntime.h:1070
virtual bool supportsFormatCombination(int32_t pos, DynamicPluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs) noexcept=0
Return true if plugin supports the format and datatype for the input/output indexed by pos.
virtual int32_t getValidTactics(int32_t *, int32_t) noexcept
Query for any custom tactics that the plugin intends to use.
Definition: NvInferRuntime.h:1046
virtual int32_t getOutputDataTypes(DataType *outputTypes, int32_t nbOutputs, const DataType *inputTypes, int32_t nbInputs) const noexcept=0
Provide the data types of the plugin outputs if the input tensors have the data types provided.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:886
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
Provide expressions for computing dimensions of the output tensors from dimensions of the input tenso...
Definition: NvInferRuntime.h:831
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:836
virtual AsciiChar const * getPluginName() const noexcept=0
Return the plugin name. Should match the plugin name returned by the corresponding plugin creator.
Definition: NvInferRuntime.h:1096
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1101
virtual int32_t onShapeChange(PluginTensorDesc const *in, int32_t nbInputs, PluginTensorDesc const *out, int32_t nbOutputs) noexcept=0
Called when a plugin is being prepared for execution for specific dimensions. This could happen multi...
virtual PluginFieldCollection const * getFieldsToSerialize() noexcept=0
Get the plugin fields which should be serialized.
virtual int32_t setTactic(int32_t) noexcept
Set the tactic to be used in the subsequent call to enqueue(). If no custom tactics were advertised,...
Definition: NvInferRuntime.h:1113
virtual int32_t enqueue(PluginTensorDesc const *inputDesc, PluginTensorDesc const *outputDesc, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept=0
Execute the layer.
virtual IPluginV3 * attachToContext(IPluginResourceContext *context) noexcept=0
Clone the plugin, attach the cloned plugin object to a execution context and grant the cloned plugin ...
Definition: NvInferRuntime.h:1286
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1291
~IProfiler() override=default
virtual void reportLayerTime(char const *layerName, float ms) noexcept=0
Layer time reporting callback.
Definition: NvInferRuntime.h:619
~IStreamReader() override=default
IStreamReader & operator=(IStreamReader const &) &=default
IStreamReader & operator=(IStreamReader &&) &=default
virtual int64_t read(void *destination, int64_t nbBytes)=0
Read the next number of bytes in the stream.
IStreamReader(IStreamReader &&)=default
IStreamReader(IStreamReader const &)=default
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:631
Definition: NvInferRuntime.h:731
IStreamReaderV2 & operator=(IStreamReaderV2 const &) &=default
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:743
IStreamReaderV2(IStreamReaderV2 &&)=default
~IStreamReaderV2() override=default
virtual int64_t read(void *destination, int64_t nbBytes, cudaStream_t stream) noexcept=0
Read the next number of bytes in the stream asynchronously.
IStreamReaderV2(IStreamReaderV2 const &)=default
virtual bool seek(int64_t offset, SeekPosition where) noexcept=0
Sets the position of the stream to the given offset.
IStreamReaderV2 & operator=(IStreamReaderV2 &&) &=default
Definition: NvInferRuntime.h:654
IStreamWriter & operator=(IStreamWriter const &) &=default
IStreamWriter(IStreamWriter &&)=default
virtual int64_t write(void const *data, int64_t nbBytes)=0
write nbBytes of data into the stream.
IStreamWriter(IStreamWriter const &)=default
IStreamWriter & operator=(IStreamWriter &&) &=default
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:666
~IStreamWriter() override=default
Definition: NvInferRuntime.h:1193
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1195
virtual int32_t getAliasedInput(int32_t) noexcept
Communicates to TensorRT that the output at the specified output index is aliased to the input at the...
Definition: NvInferRuntime.h:1229
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:5150
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:5139
The TensorRT API version 1 namespace.
Definition: NvInferSafePlugin.h:33
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2855
v_1_0::IOutputAllocator IOutputAllocator
Definition: NvInferRuntime.h:3979
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:76
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:189
@ kCEIL_DIV
Division rounding up.
v_1_0::IPluginV3OneCore IPluginV3OneCore
Definition: NvInferRuntime.h:1246
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:664
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10407
SerializationFlag
List of valid flags that the engine can enable when serializing the bytes.
Definition: NvInferRuntime.h:2896
@ kEXCLUDE_WEIGHTS
Exclude the weights that can be refitted.
@ kINCLUDE_REFIT
Remain refittable if originally so.
DLAWorkspaceAllocationStrategy
Describes how DLA workspace memory is allocated.
Definition: NvInferRuntime.h:1576
v_1_0::IStreamWriter IStreamWriter
Definition: NvInferRuntime.h:710
v_1_0::IProfiler IProfiler
Definition: NvInferRuntime.h:1320
SeekPosition
Controls the seek mode of IStreamReaderV2.
Definition: NvInferRuntime.h:717
@ kSET
From the beginning of the file.
@ kCUR
From the current position of the file.
@ kEND
From the tail of the file.
v_1_0::IStreamReaderV2 IStreamReaderV2
Definition: NvInferRuntime.h:787
uint32_t TempfileControlFlags
Represents a collection of one or more TempfileControlFlag values combined using bitwise-OR operation...
Definition: NvInferRuntime.h:1398
EngineStat
The kind of engine statistics that queried from the ICudaEngine.
Definition: NvInferRuntime.h:3065
@ kTOTAL_WEIGHTS_SIZE
Return the total weight size in bytes.
@ kSTRIPPED_WEIGHTS_SIZE
Return the stripped weight size in bytes for engines built with BuilderFlag::kSTRIP_PLAN.
v_1_0::IGpuAllocator IGpuAllocator
Definition: NvInferRuntime.h:1890
v_1_0::ILogger ILogger
Definition: NvInferRuntimeBase.h:125
char_t AsciiChar
Definition: NvInferRuntimeBase.h:116
TensorRTPhase
Indicates a phase of operation of TensorRT.
Definition: NvInferPluginBase.h:116
@ kV2_DYNAMICEXT
IPluginV2DynamicExt.
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:151
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1352
@ kSCALE
Scale layer.
@ kCONSTANT
Constant layer.
@ kDEFAULT
Similar to ONNX Gather.
v_1_0::IDebugListener IDebugListener
Definition: NvInferRuntime.h:4020
TempfileControlFlag
Flags used to control TensorRT's behavior when creating executable temporary files.
Definition: NvInferRuntime.h:1375
@ kALLOW_IN_MEMORY_FILES
Allow creating and loading files in-memory (or unnamed files).
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:1330
@ kSHIFT
shift part of IScaleLayer
@ kANY
Any other weights role.
@ kBIAS
bias for IConvolutionLayer or IDeconvolutionLayer
@ kKERNEL
kernel for IConvolutionLayer or IDeconvolutionLayer
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:2867
@ kLAYER_NAMES_ONLY
Print only the layer names. This is the default setting.
@ kDETAILED
Print detailed layer information including layer names and layer parameters.
TacticSource
List of tactic sources for TensorRT.
Definition: NvInferRuntime.h:2831
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimePlugin.h:54
v_1_0::IPluginV3OneRuntime IPluginV3OneRuntime
Definition: NvInferRuntime.h:1270
@ kSUB
Subtract the second element from the first.
@ kSUM
Sum of the two elements.
@ kPROD
Product of the two elements.
@ kFLOOR_DIV
Floor division of the first element by the second.
@ kEQUAL
Check if two elements are equal.
@ kMIN
Minimum of the two elements.
@ kLESS
Check if element in first tensor is less than corresponding element in second tensor.
uint32_t SerializationFlags
Represents one or more SerializationFlag values using binary OR operations, e.g., 1U << Serialization...
Definition: NvInferRuntime.h:2886
@ kLINEAR
Supports linear (1D), bilinear (2D), and trilinear (3D) interpolation.
v_1_0::IPluginV3OneBuild IPluginV3OneBuild
Definition: NvInferRuntime.h:1258
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntime.h:1432
ExecutionContextAllocationStrategy
Different memory allocation behaviors for IExecutionContext.
Definition: NvInferRuntime.h:3003
@ kSTATIC
Default static allocation with the maximum size across all profiles.
@ kUSER_MANAGED
The user supplies custom allocation to the execution context.
@ kON_PROFILE_CHANGE
Reallocate for a profile when it's selected.
v_1_0::ILoggerFinder ILoggerFinder
Definition: NvInferRuntime.h:5228
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:4954
@ kJSON
Print layer information in JSON format.
@ kONELINE
Print layer information in one line per layer.
v_1_0::IStreamReader IStreamReader
Definition: NvInferRuntime.h:700
AllocatorFlag
Allowed type of memory allocation.
Definition: NvInferRuntime.h:1553
@ kRESIZABLE
TensorRT may call realloc() on this allocation.
@ kMAX
Maximum over elements.
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:214
@ kHOST
Data stored on host.
@ kDEVICE
Data stored on device.
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:2614
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
uint32_t AllocatorFlags
Definition: NvInferRuntime.h:1566
Severity
Enumerates severity levels for messages issued by the message recorder.
Definition: NvInferSafeRecorder.h:55
Summarizes tensors that a plugin might see for an input or output.
Definition: NvInferRuntime.h:373
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:378
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:381
Dims opt
Optimum value of tensor’s dimensions specified for auto-tuning.
Definition: NvInferRuntime.h:384
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:375
Plugin field collection struct.
Definition: NvInferPluginBase.h:103
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimePlugin.h:73
Declaration of EnumMaxImpl struct to store the exclusive upper bound of an enumeration type.
Definition: NvInferRuntimeBase.h:132

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact