TensorRT for RTX 1.5.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
121{
122public:
124 void const* values;
125 int64_t count;
126};
127
138class IHostMemory : public INoCopy
139{
140public:
141 virtual ~IHostMemory() noexcept = 0;
142
144 void* data() const noexcept
145 {
146 return mImpl->data();
147 }
148
150 std::size_t size() const noexcept
151 {
152 return mImpl->size();
153 }
154
156 DataType type() const noexcept
157 {
158 return mImpl->type();
159 }
160
161protected:
162 apiv::VHostMemory* mImpl;
163};
164
165inline IHostMemory::~IHostMemory() noexcept = default;
166
177enum class DimensionOperation : int32_t
178{
179 kSUM = 0,
180 kPROD = 1,
181 kMAX = 2,
182 kMIN = 3,
183 kSUB = 4,
184 kEQUAL = 5,
185 kLESS = 6,
186 kFLOOR_DIV = 7,
187 kCEIL_DIV = 8
188};
189
191template <>
193{
194 static constexpr int32_t kVALUE = 9;
195};
196
202enum class TensorLocation : int32_t
203{
204 kDEVICE = 0,
205 kHOST = 1,
206};
207
209template <>
211{
212 static constexpr int32_t kVALUE = 2;
213};
214
228{
229public:
233 bool isConstant() const noexcept
234 {
235 return mImpl->isConstant();
236 }
237
244 int64_t getConstantValue() const noexcept
245 {
246 return mImpl->getConstantValue();
247 }
248
249protected:
250 apiv::VDimensionExpr* mImpl;
251 virtual ~IDimensionExpr() noexcept = 0;
252
253public:
259 bool isSizeTensor() const noexcept
260 {
261 return mImpl->isSizeTensor();
262 }
263};
264
265inline IDimensionExpr::~IDimensionExpr() noexcept = default;
266
284class IExprBuilder : public INoCopy
285{
286public:
290 IDimensionExpr const* constant(int64_t value) noexcept
291 {
292 return mImpl->constant(value);
293 }
294
302 DimensionOperation op, IDimensionExpr const& first, IDimensionExpr const& second) noexcept
303 {
304 return mImpl->operation(op, first, second);
305 }
306
307protected:
308 apiv::VExprBuilder* mImpl;
309 virtual ~IExprBuilder() noexcept = 0;
310
311public:
336 IDimensionExpr const* declareSizeTensor(int32_t outputIndex, IDimensionExpr const& opt, IDimensionExpr const& upper)
337 {
338 return mImpl->declareSizeTensor(outputIndex, opt, upper);
339 }
340};
341
342inline IExprBuilder::~IExprBuilder() noexcept = default;
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
513 virtual void configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
514 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
515
525 virtual size_t getWorkspaceSize(PluginTensorDesc const* inputs, int32_t nbInputs, PluginTensorDesc const* outputs,
526 int32_t nbOutputs) const noexcept = 0;
527
540 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
541 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
542
543protected:
551 int32_t getTensorRTVersion() const noexcept override
552 {
553 return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
554 }
555
556 virtual ~IPluginV2DynamicExt() noexcept {}
557
558private:
559 // Following are obsolete base class methods, and must not be implemented or used.
560
564 void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
565 bool const*, PluginFormat, int32_t) noexcept final
566 {
567 }
568
572 bool supportsFormat(DataType, PluginFormat) const noexcept final
573 {
574 return false;
575 }
576
580 Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept final
581 {
582 return Dims{-1, {}};
583 }
584
588 size_t getWorkspaceSize(int32_t) const noexcept final
589 {
590 return 0;
591 }
592
596 int32_t enqueue(int32_t, void const* const*, void* const*, void*, cudaStream_t) noexcept final
597 {
598 return 1;
599 }
600};
601
602namespace v_1_0
603{
608{
609public:
614 ~IStreamReader() override = default;
615 IStreamReader() = default;
616
620 InterfaceInfo getInterfaceInfo() const noexcept override
621 {
622 return InterfaceInfo{"IStreamReader", 1, 0};
623 }
624
633 virtual int64_t read(void* destination, int64_t nbBytes) = 0;
634
635protected:
636 IStreamReader(IStreamReader const&) = default;
640};
641
643{
644public:
649 ~IStreamWriter() override = default;
650 IStreamWriter() = default;
651
655 InterfaceInfo getInterfaceInfo() const noexcept override
656 {
657 return InterfaceInfo{"IStreamWriter", 1, 0};
658 }
659
669 virtual int64_t write(void const* data, int64_t nbBytes) = 0;
670
671protected:
672 IStreamWriter(IStreamWriter const&) = default;
676};
677} // namespace v_1_0
678
690
700
705enum class SeekPosition : int32_t
706{
708 kSET = 0,
709
711 kCUR = 1,
712
714 kEND = 2,
715};
716
717namespace v_1_0
718{
720{
721public:
726 ~IStreamReaderV2() override = default;
727 IStreamReaderV2() = default;
728
732 InterfaceInfo getInterfaceInfo() const noexcept override
733 {
734 return InterfaceInfo{"IStreamReaderV2", 1, 0};
735 }
736
747 virtual int64_t read(void* destination, int64_t nbBytes, cudaStream_t stream) noexcept = 0;
748
757 virtual bool seek(int64_t offset, SeekPosition where) noexcept = 0;
758
759protected:
764};
765} // namespace v_1_0
766
777
792{
793public:
798 virtual IGpuAllocator* getGpuAllocator() const noexcept = 0;
799
804 virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
805 virtual ~IPluginResourceContext() noexcept = 0;
806
807protected:
811 IPluginResourceContext& operator=(IPluginResourceContext const&) & = default;
813};
814
815inline IPluginResourceContext::~IPluginResourceContext() noexcept = default;
816
817namespace v_1_0
818{
820{
821public:
825 InterfaceInfo getInterfaceInfo() const noexcept override
826 {
827 return InterfaceInfo{"PLUGIN_V3ONE_CORE", 1, 0};
828 }
829
838 virtual AsciiChar const* getPluginName() const noexcept = 0;
839
848 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
849
859 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
860};
861
863{
864public:
870 static constexpr int32_t kDEFAULT_FORMAT_COMBINATION_LIMIT = 100;
871
875 InterfaceInfo getInterfaceInfo() const noexcept override
876 {
877 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 1, 0};
878 }
879
899 virtual int32_t configurePlugin(DynamicPluginTensorDesc const* in, int32_t nbInputs,
900 DynamicPluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
901
918 virtual int32_t getOutputDataTypes(
919 DataType* outputTypes, int32_t nbOutputs, const DataType* inputTypes, int32_t nbInputs) const noexcept = 0;
920
942 virtual int32_t getOutputShapes(DimsExprs const* inputs, int32_t nbInputs, DimsExprs const* shapeInputs,
943 int32_t nbShapeInputs, DimsExprs* outputs, int32_t nbOutputs, IExprBuilder& exprBuilder) noexcept = 0;
944
980 int32_t pos, DynamicPluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
981
987 virtual int32_t getNbOutputs() const noexcept = 0;
988
998 virtual size_t getWorkspaceSize(DynamicPluginTensorDesc const* /* inputs */, int32_t /* nbInputs */,
999 DynamicPluginTensorDesc const* /* outputs */, int32_t /* nbOutputs */) const noexcept
1000 {
1001 return 0;
1002 }
1003
1035 virtual int32_t getValidTactics(int32_t* /* tactics */, int32_t /* nbTactics */) noexcept
1036 {
1037 return 0;
1038 }
1039
1043 virtual int32_t getNbTactics() noexcept
1044 {
1045 return 0;
1046 }
1047
1059 virtual char const* getTimingCacheID() noexcept
1060 {
1061 return nullptr;
1062 }
1063
1067 virtual int32_t getFormatCombinationLimit() noexcept
1068 {
1069 return kDEFAULT_FORMAT_COMBINATION_LIMIT;
1070 }
1071
1078 virtual char const* getMetadataString() noexcept
1079 {
1080 return nullptr;
1081 }
1082};
1083
1085{
1086public:
1090 InterfaceInfo getInterfaceInfo() const noexcept override
1091 {
1092 return InterfaceInfo{"PLUGIN_V3ONE_RUNTIME", 1, 0};
1093 }
1094
1102 virtual int32_t setTactic(int32_t /* tactic */) noexcept
1103 {
1104 return 0;
1105 }
1106
1125 virtual int32_t onShapeChange(
1126 PluginTensorDesc const* in, int32_t nbInputs, PluginTensorDesc const* out, int32_t nbOutputs) noexcept = 0;
1127
1141 virtual int32_t enqueue(PluginTensorDesc const* inputDesc, PluginTensorDesc const* outputDesc,
1142 void const* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept = 0;
1143
1163 virtual IPluginV3* attachToContext(IPluginResourceContext* context) noexcept = 0;
1164
1170
1174 virtual PluginFieldCollection const* getFieldsToSerialize() noexcept = 0;
1175};
1176} // namespace v_1_0
1177
1178namespace v_2_0
1179{
1180
1182{
1183public:
1184 InterfaceInfo getInterfaceInfo() const noexcept override
1185 {
1186 return InterfaceInfo{"PLUGIN_V3ONE_BUILD", 2, 0};
1187 }
1188
1218 virtual int32_t getAliasedInput(int32_t /* outputIndex */) noexcept
1219 {
1220 return -1;
1221 }
1222};
1223
1224} // namespace v_2_0
1225
1236
1248
1260
1269
1272namespace v_1_0
1273{
1275{
1276public:
1280 InterfaceInfo getInterfaceInfo() const noexcept override
1281 {
1282 return {"IProfiler", 1, 0};
1283 }
1284
1292 virtual void reportLayerTime(char const* layerName, float ms) noexcept = 0;
1293
1294 ~IProfiler() override = default;
1295};
1296} // namespace v_1_0
1297
1310
1318enum class WeightsRole : int32_t
1319{
1320 kKERNEL = 0,
1321 kBIAS = 1,
1322 kSHIFT = 2,
1323 kSCALE = 3,
1324 kCONSTANT = 4,
1325 kANY = 5,
1326};
1327
1329template <>
1331{
1332 static constexpr int32_t kVALUE = 6;
1333};
1334
1340enum class DeviceType : int32_t
1341{
1342 kGPU = 0,
1343 kDLA = 1,
1344};
1345
1347template <>
1349{
1350 static constexpr int32_t kVALUE = 2;
1351};
1352
1363enum class TempfileControlFlag : int32_t
1364{
1367
1372};
1373
1375template <>
1377{
1378 static constexpr int32_t kVALUE = 2;
1379};
1380
1387using TempfileControlFlags = uint32_t;
1388
1420enum class TensorFormat : int32_t
1421{
1428 kLINEAR = 0,
1429
1434 kCHW2 = 1,
1435
1439 kHWC8 = 2,
1440
1454 kCHW4 = 3,
1455
1462 kCHW16 = 4,
1463
1471 kCHW32 = 5,
1472
1477 kDHWC8 = 6,
1478
1483 kCDHW32 = 7,
1484
1488 kHWC = 8,
1489
1498 kDLA_LINEAR = 9,
1499
1513 kDLA_HWC4 = 10,
1514
1519 kHWC16 = 11,
1520
1525 kDHWC = 12
1526};
1527
1529template <>
1531{
1533 static constexpr int32_t kVALUE = 13;
1534};
1535
1541enum class AllocatorFlag : int32_t
1542{
1544 kRESIZABLE = 0,
1545};
1546
1548template <>
1550{
1552 static constexpr int32_t kVALUE = 1;
1553};
1554
1555using AllocatorFlags = uint32_t;
1556
1559namespace v_1_0
1560{
1561
1575{
1576public:
1580 InterfaceInfo getInterfaceInfo() const noexcept override
1581 {
1582 return {"ILogger", 1, 0};
1583 }
1584
1590 enum class Severity : int32_t
1591 {
1593 kINTERNAL_ERROR = 0,
1595 kERROR = 1,
1597 kWARNING = 2,
1599 kINFO = 3,
1601 kVERBOSE = 4,
1602 };
1603
1622 virtual void log(Severity severity, AsciiChar const* msg) noexcept = 0;
1623
1624 ILogger() = default;
1625 ~ILogger() override = default;
1626
1627protected:
1628 // @cond SuppressDoxyWarnings
1629 ILogger(ILogger const&) = default;
1630 ILogger(ILogger&&) = default;
1631 ILogger& operator=(ILogger const&) & = default;
1632 ILogger& operator=(ILogger&&) & = default;
1633 // @endcond
1634};
1635
1636} // namespace v_1_0
1637
1638using ILogger = v_1_0::ILogger;
1639
1641template <>
1643{
1645 static constexpr int32_t kVALUE = 5;
1646};
1647
1648namespace v_1_0
1649{
1650
1652{
1653public:
1679 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept = 0;
1680
1681 ~IGpuAllocator() override = default;
1682 IGpuAllocator() = default;
1683
1721 virtual void* reallocate(void* const /*baseAddr*/, uint64_t /*alignment*/, uint64_t /*newSize*/) noexcept
1722 {
1723 return nullptr;
1724 }
1725
1744 TRT_DEPRECATED virtual bool deallocate(void* const memory) noexcept = 0;
1745
1774 virtual void* allocateAsync(
1775 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags, cudaStream_t /*stream*/) noexcept
1776 {
1777 return allocate(size, alignment, flags);
1778 }
1807 virtual bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept
1808 {
1809 return deallocate(memory);
1810 }
1811
1815 InterfaceInfo getInterfaceInfo() const noexcept override
1816 {
1817 return {"IGpuAllocator", 1, 0};
1818 }
1819
1820protected:
1821 // @cond SuppressDoxyWarnings
1822 IGpuAllocator(IGpuAllocator const&) = default;
1823 IGpuAllocator(IGpuAllocator&&) = default;
1824 IGpuAllocator& operator=(IGpuAllocator const&) & = default;
1825 IGpuAllocator& operator=(IGpuAllocator&&) & = default;
1826 // @endcond
1827};
1828
1829} // namespace v_1_0
1830
1852
1858enum class EngineValidity : int32_t
1859{
1861 kVALID = 0,
1862
1864 kSUBOPTIMAL = 1,
1865
1867 kINVALID = 2,
1868};
1869
1871template <>
1873{
1874 static constexpr int32_t kVALUE = 3;
1875};
1876
1881enum class EngineInvalidityDiagnostics : uint64_t
1882{
1884 kVERSION_MISMATCH = 1ULL << 0,
1885
1887 kUNSUPPORTED_CC = 1ULL << 1,
1888
1890 kOLD_CUDA_DRIVER = 1ULL << 2,
1891
1893 kOLD_CUDA_RUNTIME = 1ULL << 3,
1894
1896 kINSUFFICIENT_GPU_MEMORY = 1ULL << 4,
1897
1899 kMALFORMED_ENGINE = 1ULL << 5,
1900
1902 kCUDA_ERROR = 1ULL << 6,
1903};
1904
1905
1913class IRuntime : public INoCopy
1914{
1915public:
1916 virtual ~IRuntime() noexcept = 0;
1917
1929 void setDLACore(int32_t dlaCore) noexcept
1930 {
1931 mImpl->setDLACore(dlaCore);
1932 }
1933
1939 int32_t getDLACore() const noexcept
1940 {
1941 return mImpl->getDLACore();
1942 }
1943
1947 int32_t getNbDLACores() const noexcept
1948 {
1949 return mImpl->getNbDLACores();
1950 }
1951
1963 void setGpuAllocator(IGpuAllocator* allocator) noexcept
1964 {
1965 mImpl->setGpuAllocator(allocator);
1966 }
1967
1979 //
1982 void setErrorRecorder(IErrorRecorder* recorder) noexcept
1983 {
1984 mImpl->setErrorRecorder(recorder);
1985 }
1986
1998 {
1999 return mImpl->getErrorRecorder();
2000 }
2001
2015 ICudaEngine* deserializeCudaEngine(void const* blob, std::size_t size) noexcept
2016 {
2017 return mImpl->deserializeCudaEngine(blob, size);
2018 }
2019
2039 {
2040 return mImpl->deserializeCudaEngineV2(streamReader);
2041 }
2042
2048 ILogger* getLogger() const noexcept
2049 {
2050 return mImpl->getLogger();
2051 }
2052
2063 bool setMaxThreads(int32_t maxThreads) noexcept
2064 {
2065 return mImpl->setMaxThreads(maxThreads);
2066 }
2067
2077 int32_t getMaxThreads() const noexcept
2078 {
2079 return mImpl->getMaxThreads();
2080 }
2081
2112 void setTemporaryDirectory(char const* path) noexcept
2113 {
2114 return mImpl->setTemporaryDirectory(path);
2115 }
2116
2123 char const* getTemporaryDirectory() const noexcept
2124 {
2125 return mImpl->getTemporaryDirectory();
2126 }
2127
2140 {
2141 return mImpl->setTempfileControlFlags(flags);
2142 }
2143
2152 {
2153 return mImpl->getTempfileControlFlags();
2154 }
2155
2162 {
2163 return mImpl->getPluginRegistry();
2164 }
2165
2179 IRuntime* loadRuntime(char const* path) noexcept
2180 {
2181 return mImpl->loadRuntime(path);
2182 }
2183
2191 void setEngineHostCodeAllowed(bool allowed) noexcept
2192 {
2193 return mImpl->setEngineHostCodeAllowed(allowed);
2194 }
2195
2201 bool getEngineHostCodeAllowed() const noexcept
2202 {
2203 return mImpl->getEngineHostCodeAllowed();
2204 }
2205
2213 int64_t getEngineHeaderSize() const noexcept {
2214 return mImpl->getEngineHeaderSize();
2215 }
2216
2240 EngineValidity getEngineValidity(void const* blob, int64_t blobSize, uint64_t* diagnostics) const noexcept {
2241 return mImpl->getEngineValidity(blob, blobSize, diagnostics);
2242 }
2243
2244
2245protected:
2246 apiv::VRuntime* mImpl{};
2247};
2248
2249inline IRuntime::~IRuntime() noexcept = default;
2250
2258class IRefitter : public INoCopy
2259{
2260public:
2261 virtual ~IRefitter() noexcept = 0;
2262
2278 bool setWeights(char const* layerName, WeightsRole role, Weights weights) noexcept
2279 {
2280 return mImpl->setWeights(layerName, role, weights);
2281 }
2282
2295 bool refitCudaEngine() noexcept
2296 {
2297 return mImpl->refitCudaEngine();
2298 }
2299
2316 int32_t getMissing(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2317 {
2318 return mImpl->getMissing(size, layerNames, roles);
2319 }
2320
2333 int32_t getAll(int32_t size, char const** layerNames, WeightsRole* roles) noexcept
2334 {
2335 return mImpl->getAll(size, layerNames, roles);
2336 }
2337
2349 //
2352 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2353 {
2354 mImpl->setErrorRecorder(recorder);
2355 }
2356
2368 {
2369 return mImpl->getErrorRecorder();
2370 }
2371
2392 bool setNamedWeights(char const* name, Weights weights) noexcept
2393 {
2394 return mImpl->setNamedWeights(name, weights);
2395 }
2396
2412 int32_t getMissingWeights(int32_t size, char const** weightsNames) noexcept
2413 {
2414 return mImpl->getMissingWeights(size, weightsNames);
2415 }
2416
2428 int32_t getAllWeights(int32_t size, char const** weightsNames) noexcept
2429 {
2430 return mImpl->getAllWeights(size, weightsNames);
2431 }
2432
2438 ILogger* getLogger() const noexcept
2439 {
2440 return mImpl->getLogger();
2441 }
2442
2454 bool setMaxThreads(int32_t maxThreads) noexcept
2455 {
2456 return mImpl->setMaxThreads(maxThreads);
2457 }
2458
2468 int32_t getMaxThreads() const noexcept
2469 {
2470 return mImpl->getMaxThreads();
2471 }
2472
2495 bool setNamedWeights(char const* name, Weights weights, TensorLocation location) noexcept
2496 {
2497 return mImpl->setNamedWeightsWithLocation(name, weights, location);
2498 }
2499
2511 Weights getNamedWeights(char const* weightsName) const noexcept
2512 {
2513 return mImpl->getNamedWeights(weightsName);
2514 }
2515
2527 TensorLocation getWeightsLocation(char const* weightsName) const noexcept
2528 {
2529 return mImpl->getWeightsLocation(weightsName);
2530 }
2531
2543 bool unsetNamedWeights(char const* weightsName) noexcept
2544 {
2545 return mImpl->unsetNamedWeights(weightsName);
2546 }
2547
2559 void setWeightsValidation(bool weightsValidation) noexcept
2560 {
2561 return mImpl->setWeightsValidation(weightsValidation);
2562 }
2563
2567 bool getWeightsValidation() const noexcept
2568 {
2569 return mImpl->getWeightsValidation();
2570 }
2571
2589 bool refitCudaEngineAsync(cudaStream_t stream) noexcept
2590 {
2591 return mImpl->refitCudaEngineAsync(stream);
2592 }
2593
2607 Weights getWeightsPrototype(char const* weightsName) const noexcept
2608 {
2609 return mImpl->getWeightsPrototype(weightsName);
2610 }
2611
2612protected:
2613 apiv::VRefitter* mImpl;
2614};
2615
2616inline IRefitter::~IRefitter() noexcept = default;
2617
2628enum class OptProfileSelector : int32_t
2629{
2630 kMIN = 0,
2631 kOPT = 1,
2632 kMAX = 2
2633};
2634
2636template <>
2638{
2639 static constexpr int32_t kVALUE = 3;
2640};
2641
2665{
2666public:
2694 bool setDimensions(char const* inputName, OptProfileSelector select, Dims const& dims) noexcept
2695 {
2696 return mImpl->setDimensions(inputName, select, dims);
2697 }
2698
2706 Dims getDimensions(char const* inputName, OptProfileSelector select) const noexcept
2707 {
2708 return mImpl->getDimensions(inputName, select);
2709 }
2710
2719 int32_t getNbShapeValues(char const* inputName) const noexcept
2720 {
2721 return mImpl->getNbShapeValues(inputName);
2722 }
2723
2737 bool setExtraMemoryTarget(float target) noexcept
2738 {
2739 return mImpl->setExtraMemoryTarget(target);
2740 }
2741
2749 float getExtraMemoryTarget() const noexcept
2750 {
2751 return mImpl->getExtraMemoryTarget();
2752 }
2753
2766 bool isValid() const noexcept
2767 {
2768 return mImpl->isValid();
2769 }
2770
2814 char const* inputName, OptProfileSelector select, int64_t const* values, int32_t nbValues) noexcept
2815 {
2816 return mImpl->setShapeValuesV2(inputName, select, values, nbValues);
2817 }
2818
2826 int64_t const* getShapeValuesV2(char const* inputName, OptProfileSelector select) const noexcept
2827 {
2828 return mImpl->getShapeValuesV2(inputName, select);
2829 }
2830
2831protected:
2832 apiv::VOptimizationProfile* mImpl;
2833 virtual ~IOptimizationProfile() noexcept = 0;
2834};
2835
2836inline IOptimizationProfile::~IOptimizationProfile() noexcept = default;
2837
2845enum class TacticSource : int32_t
2846{
2851
2855};
2856
2858template <>
2860{
2861 static constexpr int32_t kVALUE = 2;
2862};
2863
2870using TacticSources = uint32_t;
2871
2881enum class ProfilingVerbosity : int32_t
2882{
2883 kLAYER_NAMES_ONLY = 0,
2884 kNONE = 1,
2885 kDETAILED = 2,
2886};
2887
2889template <>
2891{
2892 static constexpr int32_t kVALUE = 3;
2893};
2894
2901using SerializationFlags = uint32_t;
2902
2910enum class SerializationFlag : int32_t
2911{
2912 kEXCLUDE_WEIGHTS = 0,
2914 kINCLUDE_REFIT = 2,
2915};
2916
2918template <>
2920{
2921 static constexpr int32_t kVALUE = 3;
2922};
2923
2932{
2933public:
2934 virtual ~ISerializationConfig() noexcept = 0;
2935
2947 bool setFlags(SerializationFlags serializationFlags) noexcept
2948 {
2949 return mImpl->setFlags(serializationFlags);
2950 }
2951
2960 {
2961 return mImpl->getFlags();
2962 }
2963
2971 bool clearFlag(SerializationFlag serializationFlag) noexcept
2972 {
2973 return mImpl->clearFlag(serializationFlag);
2974 }
2975
2983 bool setFlag(SerializationFlag serializationFlag) noexcept
2984 {
2985 return mImpl->setFlag(serializationFlag);
2986 }
2987
2995 bool getFlag(SerializationFlag serializationFlag) const noexcept
2996 {
2997 return mImpl->getFlag(serializationFlag);
2998 }
2999
3000protected:
3001 apiv::VSerializationConfig* mImpl;
3002};
3003
3004inline ISerializationConfig::~ISerializationConfig() noexcept = default;
3005
3018{
3019 kSTATIC = 0,
3020 kON_PROFILE_CHANGE = 1,
3021 kUSER_MANAGED = 2,
3022};
3023
3026template <>
3028{
3029 static constexpr int32_t kVALUE = 3;
3030};
3031
3040{
3041public:
3042 virtual ~IRuntimeCache() noexcept = 0;
3043
3049 IHostMemory* serialize() const noexcept
3050 {
3051 return mImpl->serialize();
3052 }
3053
3060 bool deserialize(void const* blob, size_t size) noexcept
3061 {
3062 return mImpl->deserialize(blob, size);
3063 }
3064
3068 bool reset() noexcept
3069 {
3070 return mImpl->reset();
3071 }
3072
3073protected:
3074 apiv::VRuntimeCache* mImpl;
3075};
3076
3077inline IRuntimeCache::~IRuntimeCache() noexcept = default;
3078
3091{
3097 kLAZY = 0,
3098
3103 kEAGER = 1,
3104
3108 kNONE = 2,
3109};
3110
3113template <>
3115{
3116 static constexpr int32_t kVALUE = 3;
3117};
3118
3126enum class CudaGraphStrategy : int32_t
3127{
3131 kDISABLED = 0,
3132
3141};
3142
3144template <>
3146{
3147 static constexpr int32_t kVALUE = 2;
3148};
3149
3150
3158{
3159public:
3160 virtual ~IRuntimeConfig() noexcept = 0;
3161
3167 void setExecutionContextAllocationStrategy(ExecutionContextAllocationStrategy strategy) noexcept
3168 {
3169 return mImpl->setExecutionContextAllocationStrategy(strategy);
3170 }
3171
3178 {
3179 return mImpl->getExecutionContextAllocationStrategy();
3180 }
3181
3188 {
3189 return mImpl->createRuntimeCache();
3190 }
3191
3197 bool setRuntimeCache(IRuntimeCache const& cache) noexcept
3198 {
3199 return mImpl->setRuntimeCache(cache);
3200 }
3201
3208 {
3209 return mImpl->getRuntimeCache();
3210 }
3211
3218 DynamicShapesKernelSpecializationStrategy dynamicShapesKernelSpecializationStrategy) noexcept
3219 {
3220 return mImpl->setDynamicShapesKernelSpecializationStrategy(dynamicShapesKernelSpecializationStrategy);
3221 }
3222
3229 {
3230 return mImpl->getDynamicShapesKernelSpecializationStrategy();
3231 }
3232
3253 {
3254 return mImpl->setCudaGraphStrategy(strategy);
3255 }
3256
3263 {
3264 return mImpl->getCudaGraphStrategy();
3265 }
3266
3267protected:
3268 apiv::VRuntimeConfig* mImpl;
3269}; // class IRuntimeConfig
3270
3271inline IRuntimeConfig::~IRuntimeConfig() noexcept = default;
3272
3281enum class EngineStat : int32_t
3282{
3285
3288};
3289
3291template <>
3293{
3294 static constexpr int32_t kVALUE = 2;
3295};
3296
3304class ICudaEngine : public INoCopy
3305{
3306public:
3307 virtual ~ICudaEngine() noexcept = 0;
3308
3319 Dims getTensorShape(char const* tensorName) const noexcept
3320 {
3321 return mImpl->getTensorShape(tensorName);
3322 }
3323
3334 DataType getTensorDataType(char const* tensorName) const noexcept
3335 {
3336 return mImpl->getTensorDataType(tensorName);
3337 }
3338
3348 int32_t getNbLayers() const noexcept
3349 {
3350 return mImpl->getNbLayers();
3351 }
3352
3362 IHostMemory* serialize() const noexcept
3363 {
3364 return mImpl->serialize();
3365 }
3366
3381 {
3382 return mImpl->createExecutionContext(strategy);
3383 }
3384
3397 TensorLocation getTensorLocation(char const* tensorName) const noexcept
3398 {
3399 return mImpl->getTensorLocation(tensorName);
3400 }
3401
3417 bool isShapeInferenceIO(char const* tensorName) const noexcept
3418 {
3419 return mImpl->isShapeInferenceIO(tensorName);
3420 }
3421
3431 TensorIOMode getTensorIOMode(char const* tensorName) const noexcept
3432 {
3433 return mImpl->getTensorIOMode(tensorName);
3434 }
3435
3450 TRT_NODISCARD char const* getAliasedInputTensor(char const* tensorName) const noexcept
3451 {
3452 return mImpl->getAliasedInputTensor(tensorName);
3453 }
3454
3463 {
3464 return mImpl->createExecutionContextWithRuntimeConfig(runtimeConfig);
3465 }
3466
3476 {
3477 return mImpl->createRuntimeConfig();
3478 }
3479
3489 int64_t getDeviceMemorySizeV2() const noexcept
3490 {
3491 return mImpl->getDeviceMemorySizeV2();
3492 }
3493
3503 int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
3504 {
3505 return mImpl->getDeviceMemorySizeForProfileV2(profileIndex);
3506 }
3507
3513 bool isRefittable() const noexcept
3514 {
3515 return mImpl->isRefittable();
3516 }
3517
3534 int32_t getTensorBytesPerComponent(char const* tensorName) const noexcept
3535 {
3536 return mImpl->getTensorBytesPerComponent(tensorName);
3537 }
3538
3552 int32_t getTensorBytesPerComponent(char const* tensorName, int32_t profileIndex) const noexcept
3553 {
3554 return mImpl->getTensorBytesPerComponentV2(tensorName, profileIndex);
3555 }
3556
3573 int32_t getTensorComponentsPerElement(char const* tensorName) const noexcept
3574 {
3575 return mImpl->getTensorComponentsPerElement(tensorName);
3576 }
3577
3591 int32_t getTensorComponentsPerElement(char const* tensorName, int32_t profileIndex) const noexcept
3592 {
3593 return mImpl->getTensorComponentsPerElementV2(tensorName, profileIndex);
3594 }
3595
3606 TensorFormat getTensorFormat(char const* tensorName) const noexcept
3607 {
3608 return mImpl->getTensorFormat(tensorName);
3609 }
3610
3620 TensorFormat getTensorFormat(char const* tensorName, int32_t profileIndex) const noexcept
3621 {
3622 return mImpl->getTensorFormatV2(tensorName, profileIndex);
3623 }
3624
3644 char const* getTensorFormatDesc(char const* tensorName) const noexcept
3645 {
3646 return mImpl->getTensorFormatDesc(tensorName);
3647 }
3648
3667 char const* getTensorFormatDesc(char const* tensorName, int32_t profileIndex) const noexcept
3668 {
3669 return mImpl->getTensorFormatDescV2(tensorName, profileIndex);
3670 }
3671
3684 int32_t getTensorVectorizedDim(char const* tensorName) const noexcept
3685 {
3686 return mImpl->getTensorVectorizedDim(tensorName);
3687 }
3688
3700 int32_t getTensorVectorizedDim(char const* tensorName, int32_t profileIndex) const noexcept
3701 {
3702 return mImpl->getTensorVectorizedDimV2(tensorName, profileIndex);
3703 }
3704
3715 char const* getName() const noexcept
3716 {
3717 return mImpl->getName();
3718 }
3719
3726 int32_t getNbOptimizationProfiles() const noexcept
3727 {
3728 return mImpl->getNbOptimizationProfiles();
3729 }
3730
3746 Dims getProfileShape(char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
3747 {
3748 return mImpl->getProfileShape(tensorName, profileIndex, select);
3749 }
3750
3762 {
3763 return mImpl->getEngineCapability();
3764 }
3765
3780 void setErrorRecorder(IErrorRecorder* recorder) noexcept
3781 {
3782 return mImpl->setErrorRecorder(recorder);
3783 }
3784
3796 {
3797 return mImpl->getErrorRecorder();
3798 }
3799
3812 {
3813 return mImpl->getTacticSources();
3814 }
3815
3824 {
3825 return mImpl->getProfilingVerbosity();
3826 }
3827
3834 {
3835 return mImpl->createEngineInspector();
3836 }
3837
3846 int32_t getNbIOTensors() const noexcept
3847 {
3848 return mImpl->getNbIOTensors();
3849 }
3850
3858 char const* getIOTensorName(int32_t index) const noexcept
3859 {
3860 return mImpl->getIOTensorName(index);
3861 }
3862
3870 {
3871 return mImpl->getHardwareCompatibilityLevel();
3872 }
3873
3884 int32_t getNbAuxStreams() const noexcept
3885 {
3886 return mImpl->getNbAuxStreams();
3887 }
3888
3895 {
3896 return mImpl->createSerializationConfig();
3897 }
3898
3915 {
3916 return mImpl->serializeWithConfig(config);
3917 }
3918
3930 int64_t getStreamableWeightsSize() const noexcept
3931 {
3932 return mImpl->getStreamableWeightsSize();
3933 }
3934
3969 bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
3970 {
3971 return mImpl->setWeightStreamingBudgetV2(gpuMemoryBudget);
3972 }
3973
3985 int64_t getWeightStreamingBudgetV2() const noexcept
3986 {
3987 return mImpl->getWeightStreamingBudgetV2();
3988 }
3989
4008 int64_t getWeightStreamingAutomaticBudget() const noexcept
4009 {
4010 return mImpl->getWeightStreamingAutomaticBudget();
4011 }
4012
4035 {
4036 return mImpl->getWeightStreamingScratchMemorySize();
4037 }
4038
4048 bool isDebugTensor(char const* name) const noexcept
4049 {
4050 return mImpl->isDebugTensor(name);
4051 }
4052
4071 char const* tensorName, int32_t profileIndex, OptProfileSelector select) const noexcept
4072 {
4073 return mImpl->getProfileTensorValuesV2(tensorName, profileIndex, select);
4074 }
4075
4098 int64_t getEngineStat(EngineStat stat) const noexcept
4099 {
4100 return mImpl->getEngineStat(stat);
4101 }
4102
4103protected:
4104 apiv::VCudaEngine* mImpl;
4105};
4106
4107inline ICudaEngine::~ICudaEngine() noexcept = default;
4108
4109namespace v_1_0
4110{
4112{
4113public:
4117 InterfaceInfo getInterfaceInfo() const noexcept override
4118 {
4119 return {"IOutputAllocator", 1, 0};
4120 }
4121
4145 [[maybe_unused]] char const* tensorName, [[maybe_unused]] void* currentMemory, [[maybe_unused]] uint64_t size,
4146 [[maybe_unused]] uint64_t alignment, cudaStream_t /* stream */)
4147 {
4148 return nullptr;
4149 }
4150
4159 virtual void notifyShape(char const* tensorName, Dims const& dims) noexcept = 0;
4160};
4161} // namespace v_1_0
4162
4171
4172namespace v_1_0
4173{
4175{
4176public:
4180 InterfaceInfo getInterfaceInfo() const noexcept override
4181 {
4182 return {"IDebugListener", 1, 0};
4183 }
4184
4198 virtual bool processDebugTensor(void const* addr, TensorLocation location, DataType type, Dims const& shape,
4199 char const* name, cudaStream_t stream)
4200 = 0;
4201
4202 ~IDebugListener() override = default;
4203};
4204} // namespace v_1_0
4205
4212
4224{
4225public:
4226 virtual ~IExecutionContext() noexcept = 0;
4227
4236 void setDebugSync(bool sync) noexcept
4237 {
4238 mImpl->setDebugSync(sync);
4239 }
4240
4246 bool getDebugSync() const noexcept
4247 {
4248 return mImpl->getDebugSync();
4249 }
4250
4256 void setProfiler(IProfiler* profiler) noexcept
4257 {
4258 mImpl->setProfiler(profiler);
4259 }
4260
4266 IProfiler* getProfiler() const noexcept
4267 {
4268 return mImpl->getProfiler();
4269 }
4270
4276 ICudaEngine const& getEngine() const noexcept
4277 {
4278 return mImpl->getEngine();
4279 }
4280
4290 void setName(char const* name) noexcept
4291 {
4292 mImpl->setName(name);
4293 }
4294
4300 char const* getName() const noexcept
4301 {
4302 return mImpl->getName();
4303 }
4304
4326 void setDeviceMemory(void* memory) noexcept
4327 {
4328 mImpl->setDeviceMemory(memory);
4329 }
4330
4347 void setDeviceMemoryV2(void* memory, int64_t size) noexcept
4348 {
4349 return mImpl->setDeviceMemoryV2(memory, size);
4350 }
4351
4368 Dims getTensorStrides(char const* tensorName) const noexcept
4369 {
4370 return mImpl->getTensorStrides(tensorName);
4371 }
4372
4373public:
4383 int32_t getOptimizationProfile() const noexcept
4384 {
4385 return mImpl->getOptimizationProfile();
4386 }
4387
4401 bool setInputShape(char const* tensorName, Dims const& dims) noexcept
4402 {
4403 return mImpl->setInputShape(tensorName, dims);
4404 }
4405
4438 Dims getTensorShape(char const* tensorName) const noexcept
4439 {
4440 return mImpl->getTensorShape(tensorName);
4441 }
4442
4454 bool allInputDimensionsSpecified() const noexcept
4455 {
4456 return mImpl->allInputDimensionsSpecified();
4457 }
4458
4473 void setErrorRecorder(IErrorRecorder* recorder) noexcept
4474 {
4475 mImpl->setErrorRecorder(recorder);
4476 }
4477
4489 {
4490 return mImpl->getErrorRecorder();
4491 }
4492
4505 bool executeV2(void* const* bindings) noexcept
4506 {
4507 return mImpl->executeV2(bindings);
4508 }
4509
4549 bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
4550 {
4551 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
4552 }
4553
4565 void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
4566 {
4567 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
4568 }
4569
4577 bool getEnqueueEmitsProfile() const noexcept
4578 {
4579 return mImpl->getEnqueueEmitsProfile();
4580 }
4581
4607 bool reportToProfiler() const noexcept
4608 {
4609 return mImpl->reportToProfiler();
4610 }
4611
4651 bool setTensorAddress(char const* tensorName, void* data) noexcept
4652 {
4653 return mImpl->setTensorAddress(tensorName, data);
4654 }
4655
4668 void const* getTensorAddress(char const* tensorName) const noexcept
4669 {
4670 return mImpl->getTensorAddress(tensorName);
4671 }
4672
4691 bool setOutputTensorAddress(char const* tensorName, void* data) noexcept
4692 {
4693 return mImpl->setOutputTensorAddress(tensorName, data);
4694 }
4695
4713 bool setInputTensorAddress(char const* tensorName, void const* data) noexcept
4714 {
4715 return mImpl->setInputTensorAddress(tensorName, data);
4716 }
4717
4732 void* getOutputTensorAddress(char const* tensorName) const noexcept
4733 {
4734 return mImpl->getOutputTensorAddress(tensorName);
4735 }
4736
4765 int32_t inferShapes(int32_t nbMaxNames, char const** tensorNames) noexcept
4766 {
4767 return mImpl->inferShapes(nbMaxNames, tensorNames);
4768 }
4769
4783 {
4784 return mImpl->updateDeviceMemorySizeForShapes();
4785 }
4786
4798 bool setInputConsumedEvent(cudaEvent_t event) noexcept
4799 {
4800 return mImpl->setInputConsumedEvent(event);
4801 }
4802
4808 cudaEvent_t getInputConsumedEvent() const noexcept
4809 {
4810 return mImpl->getInputConsumedEvent();
4811 }
4812
4827 bool setOutputAllocator(char const* tensorName, IOutputAllocator* outputAllocator) noexcept
4828 {
4829 return mImpl->setOutputAllocator(tensorName, outputAllocator);
4830 }
4831
4840 IOutputAllocator* getOutputAllocator(char const* tensorName) const noexcept
4841 {
4842 return mImpl->getOutputAllocator(tensorName);
4843 }
4844
4858 int64_t getMaxOutputSize(char const* tensorName) const noexcept
4859 {
4860 return mImpl->getMaxOutputSize(tensorName);
4861 }
4862
4879 {
4880 return mImpl->setTemporaryStorageAllocator(allocator);
4881 }
4882
4889 {
4890 return mImpl->getTemporaryStorageAllocator();
4891 }
4892
4912 bool enqueueV3(cudaStream_t stream) noexcept
4913 {
4914 return mImpl->enqueueV3(stream);
4915 }
4916
4928 void setPersistentCacheLimit(size_t size) noexcept
4929 {
4930 mImpl->setPersistentCacheLimit(size);
4931 }
4932
4939 size_t getPersistentCacheLimit() const noexcept
4940 {
4941 return mImpl->getPersistentCacheLimit();
4942 }
4943
4963 bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
4964 {
4965 return mImpl->setNvtxVerbosity(verbosity);
4966 }
4967
4976 {
4977 return mImpl->getNvtxVerbosity();
4978 }
4979
5006 void setAuxStreams(cudaStream_t* auxStreams, int32_t nbStreams) noexcept
5007 {
5008 mImpl->setAuxStreams(auxStreams, nbStreams);
5009 }
5010
5018 bool setDebugListener(IDebugListener* listener) noexcept
5019 {
5020 return mImpl->setDebugListener(listener);
5021 }
5022
5029 {
5030 return mImpl->getDebugListener();
5031 }
5032
5047 bool setTensorDebugState(char const* name, bool flag) noexcept
5048 {
5049 return mImpl->setTensorDebugState(name, flag);
5050 }
5051
5059 bool getDebugState(char const* name) const noexcept
5060 {
5061 return mImpl->getDebugState(name);
5062 }
5063
5070 {
5071 return mImpl->getRuntimeConfig();
5072 }
5073
5082 bool setAllTensorsDebugState(bool flag) noexcept
5083 {
5084 return mImpl->setAllTensorsDebugState(flag);
5085 }
5086
5098 bool setUnfusedTensorsDebugState(bool flag) noexcept
5099 {
5100 return mImpl->setUnfusedTensorsDebugState(flag);
5101 }
5102
5108 bool getUnfusedTensorsDebugState() const noexcept
5109 {
5110 return mImpl->getUnfusedTensorsDebugState();
5111 }
5130 bool isStreamCapturable(cudaStream_t stream) const noexcept {
5131 return mImpl->isStreamCapturable(stream);
5132 }
5133
5147 bool setCommunicator(void* communicator) noexcept
5148 {
5149 return mImpl->setCommunicator(communicator);
5150 }
5151
5152protected:
5153 apiv::VExecutionContext* mImpl;
5154}; // class IExecutionContext
5155
5156inline IExecutionContext::~IExecutionContext() noexcept = default;
5157
5165enum class LayerInformationFormat : int32_t
5166{
5167 kONELINE = 0,
5168 kJSON = 1,
5169};
5170
5172template <>
5174{
5175 static constexpr int32_t kVALUE = 2;
5176};
5177
5194{
5195public:
5196 virtual ~IEngineInspector() noexcept = 0;
5197
5210 bool setExecutionContext(IExecutionContext const* context) noexcept
5211 {
5212 return mImpl->setExecutionContext(context);
5213 }
5214
5223 {
5224 return mImpl->getExecutionContext();
5225 }
5226
5247 char const* getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
5248 {
5249 return mImpl->getLayerInformation(layerIndex, format);
5250 }
5251
5270 char const* getEngineInformation(LayerInformationFormat format) const noexcept
5271 {
5272 return mImpl->getEngineInformation(format);
5273 }
5274
5289 void setErrorRecorder(IErrorRecorder* recorder) noexcept
5290 {
5291 mImpl->setErrorRecorder(recorder);
5292 }
5293
5305 {
5306 return mImpl->getErrorRecorder();
5307 }
5308
5309protected:
5310 apiv::VEngineInspector* mImpl;
5311}; // class IEngineInspector
5312
5313inline IEngineInspector::~IEngineInspector() noexcept = default;
5314
5315} // namespace nvinfer1
5316
5321extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
5322
5327extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
5328
5332extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry() noexcept;
5333
5339extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
5340
5341namespace nvinfer1
5342{
5343namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this
5344 // header.
5345{
5351inline IRuntime* createInferRuntime(ILogger& logger) noexcept
5352{
5353 return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
5354}
5355
5362inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
5363{
5364 return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
5365}
5366
5367} // namespace
5368
5380template <typename T>
5382{
5383public:
5385 {
5386 getPluginRegistry()->registerCreator(instance, "");
5387 }
5388
5389private:
5391 T instance{};
5392};
5393
5394} // namespace nvinfer1
5395
5396#define REGISTER_TENSORRT_PLUGIN(name) \
5397 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
5398
5399namespace nvinfer1
5400{
5403namespace v_1_0
5404{
5414{
5415public:
5419 InterfaceInfo getInterfaceInfo() const noexcept override
5420 {
5421 return {"ILoggerFinder", 1, 0};
5422 }
5423
5431 virtual ILogger* findLogger() = 0;
5432
5433protected:
5435 ~ILoggerFinder() override = default;
5436};
5437
5438} // namespace v_1_0
5439
5441
5444namespace v_1_0
5445{
5446
5448{
5449public:
5451 ~IGpuAsyncAllocator() override = default;
5452
5482 void* allocateAsync(uint64_t const size, uint64_t const alignment, AllocatorFlags const flags,
5483 cudaStream_t /*stream*/) noexcept override = 0;
5484
5510 bool deallocateAsync(void* const memory, cudaStream_t /*stream*/) noexcept override = 0;
5511
5536 uint64_t const size, uint64_t const alignment, AllocatorFlags const flags) noexcept override
5537 {
5538 return allocateAsync(size, alignment, flags, nullptr);
5539 }
5540
5559 TRT_DEPRECATED bool deallocate(void* const memory) noexcept override
5560 {
5561 return deallocateAsync(memory, nullptr);
5562 }
5563
5567 InterfaceInfo getInterfaceInfo() const noexcept override
5568 {
5569 return {"IGpuAllocator", 1, 0};
5570 }
5571};
5572
5574{
5575public:
5579 InterfaceInfo getInterfaceInfo() const noexcept override
5580 {
5581 return InterfaceInfo{"PLUGIN CREATOR_V3ONE", 1, 0};
5582 }
5583
5601 AsciiChar const* name, PluginFieldCollection const* fc, TensorRTPhase phase) noexcept = 0;
5602
5609 virtual PluginFieldCollection const* getFieldNames() noexcept = 0;
5610
5617 virtual AsciiChar const* getPluginName() const noexcept = 0;
5618
5625 virtual AsciiChar const* getPluginVersion() const noexcept = 0;
5626
5633 virtual AsciiChar const* getPluginNamespace() const noexcept = 0;
5634
5636 virtual ~IPluginCreatorV3One() = default;
5637
5638protected:
5641 IPluginCreatorV3One& operator=(IPluginCreatorV3One const&) & = default;
5642 IPluginCreatorV3One& operator=(IPluginCreatorV3One&&) & = default;
5643};
5644
5645} // namespace v_1_0
5646
5661
5671
5672} // namespace nvinfer1
5673
5677extern "C" TENSORRTAPI int32_t getInferLibMajorVersion() noexcept;
5681extern "C" TENSORRTAPI int32_t getInferLibMinorVersion() noexcept;
5685extern "C" TENSORRTAPI int32_t getInferLibPatchVersion() noexcept;
5689extern "C" TENSORRTAPI int32_t getInferLibBuildVersion() noexcept;
5690
5691#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:222
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeBase.h:225
Analog of class Dims with expressions instead of constants for the dimensions.
Definition: NvInferRuntime.h:350
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:352
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:3305
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:3534
ISerializationConfig * createSerializationConfig() noexcept
Create a serialization configuration object.
Definition: NvInferRuntime.h:3894
char const * getIOTensorName(int32_t index) const noexcept
Return name of an IO tensor.
Definition: NvInferRuntime.h:3858
int64_t getWeightStreamingBudgetV2() const noexcept
Returns the current weight streaming device memory budget in bytes.
Definition: NvInferRuntime.h:3985
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:3761
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:3795
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:3620
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:4070
apiv::VCudaEngine * mImpl
Definition: NvInferRuntime.h:4104
IExecutionContext * createExecutionContext(ExecutionContextAllocationStrategy strategy=ExecutionContextAllocationStrategy::kSTATIC) noexcept
Create an execution context and specify the strategy for allocating internal activation memory.
Definition: NvInferRuntime.h:3379
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:3644
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:3746
bool setWeightStreamingBudgetV2(int64_t gpuMemoryBudget) noexcept
Limit the maximum amount of GPU memory usable for network weights in bytes.
Definition: NvInferRuntime.h:3969
IExecutionContext * createExecutionContext(IRuntimeConfig *runtimeConfig) noexcept
Create an execution context with TensorRT JIT runtime config.
Definition: NvInferRuntime.h:3462
int32_t getNbAuxStreams() const noexcept
Return the number of auxiliary streams used by this engine.
Definition: NvInferRuntime.h:3884
int64_t getStreamableWeightsSize() const noexcept
Get the total size in bytes of all streamable weights.
Definition: NvInferRuntime.h:3930
DataType getTensorDataType(char const *tensorName) const noexcept
Determine the required data type for a buffer from its tensor name.
Definition: NvInferRuntime.h:3334
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:3780
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine.
Definition: NvInferRuntime.h:3811
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:3450
IHostMemory * serializeWithConfig(ISerializationConfig &config) const noexcept
Serialize the network to a stream with the provided SerializationConfig.
Definition: NvInferRuntime.h:3914
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:4008
bool isDebugTensor(char const *name) const noexcept
Check if a tensor is marked as a debug tensor.
Definition: NvInferRuntime.h:4048
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:3700
char const * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:3715
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:3823
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:3417
int64_t getWeightStreamingScratchMemorySize() const noexcept
Returns the size of the scratch memory required by the current weight streaming budget.
Definition: NvInferRuntime.h:4034
int64_t getDeviceMemorySizeV2() const noexcept
Return the maximum device memory required by the context over all profiles.
Definition: NvInferRuntime.h:3489
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:3684
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:3591
int64_t getDeviceMemorySizeForProfileV2(int32_t profileIndex) const noexcept
Return the maximum device memory required by the context for a profile.
Definition: NvInferRuntime.h:3503
IRuntimeConfig * createRuntimeConfig() noexcept
Create a runtime config for TensorRT JIT. The caller is responsible for ownership of the returned IRu...
Definition: NvInferRuntime.h:3475
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:3606
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:3362
int64_t getEngineStat(EngineStat stat) const noexcept
Get engine statistics according to the given enum value.
Definition: NvInferRuntime.h:4098
TensorLocation getTensorLocation(char const *tensorName) const noexcept
Get whether an input or output tensor must be on GPU or CPU.
Definition: NvInferRuntime.h:3397
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:3833
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:3552
HardwareCompatibilityLevel getHardwareCompatibilityLevel() const noexcept
Return the hardware compatibility level of this engine.
Definition: NvInferRuntime.h:3869
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:3726
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:3667
TensorIOMode getTensorIOMode(char const *tensorName) const noexcept
Determine whether a tensor is an input or output tensor.
Definition: NvInferRuntime.h:3431
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:3348
int32_t getNbIOTensors() const noexcept
Return number of IO tensors.
Definition: NvInferRuntime.h:3846
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:3573
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:3513
An IDimensionExpr represents an integer expression constructed from constants, input dimensions,...
Definition: NvInferRuntime.h:228
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:233
bool isSizeTensor() const noexcept
Return true if this denotes the value of a size tensor.
Definition: NvInferRuntime.h:259
virtual ~IDimensionExpr() noexcept=0
apiv::VDimensionExpr * mImpl
Definition: NvInferRuntime.h:250
int64_t getConstantValue() const noexcept
Get the value of the constant.
Definition: NvInferRuntime.h:244
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:5194
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:5247
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:5304
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:5289
virtual ~IEngineInspector() noexcept=0
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:5222
apiv::VEngineInspector * mImpl
Definition: NvInferRuntime.h:5310
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:5270
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:4224
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:4840
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:4488
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:4607
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:4326
bool setTensorDebugState(char const *name, bool flag) noexcept
Set debug state of tensor given the tensor name.
Definition: NvInferRuntime.h:5047
char const * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:4300
IGpuAllocator * getTemporaryStorageAllocator() const noexcept
Get allocator set by setTemporaryStorageAllocator.
Definition: NvInferRuntime.h:4888
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:4565
bool setUnfusedTensorsDebugState(bool flag) noexcept
Turn the debug state of unfused tensors on or off.
Definition: NvInferRuntime.h:5098
Dims getTensorShape(char const *tensorName) const noexcept
Return the shape of the given input or output.
Definition: NvInferRuntime.h:4438
bool getDebugState(char const *name) const noexcept
Get the debug state.
Definition: NvInferRuntime.h:5059
bool setInputShape(char const *tensorName, Dims const &dims) noexcept
Set shape of given input.
Definition: NvInferRuntime.h:4401
bool executeV2(void *const *bindings) noexcept
Synchronously execute a network.
Definition: NvInferRuntime.h:4505
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:4577
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:4668
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:4827
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:4549
bool isStreamCapturable(cudaStream_t stream) const noexcept
Check if a subsequent call to enqueueV3 is graph-capturable on the provided stream.
Definition: NvInferRuntime.h:5130
apiv::VExecutionContext * mImpl
Definition: NvInferRuntime.h:5153
bool setOutputTensorAddress(char const *tensorName, void *data) noexcept
Set the memory address for a given output tensor.
Definition: NvInferRuntime.h:4691
void setPersistentCacheLimit(size_t size) noexcept
Set the maximum size for persistent cache usage.
Definition: NvInferRuntime.h:4928
virtual ~IExecutionContext() noexcept=0
size_t getPersistentCacheLimit() const noexcept
Get the maximum size for persistent cache usage.
Definition: NvInferRuntime.h:4939
bool setAllTensorsDebugState(bool flag) noexcept
Turn the debug state of all debug tensors on or off.
Definition: NvInferRuntime.h:5082
ICudaEngine const & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:4276
ProfilingVerbosity getNvtxVerbosity() const noexcept
Get the NVTX verbosity of the execution context.
Definition: NvInferRuntime.h:4975
size_t updateDeviceMemorySizeForShapes() noexcept
Recompute the internal activation buffer sizes based on the current input shapes, and return the tota...
Definition: NvInferRuntime.h:4782
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:5006
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:4858
int32_t inferShapes(int32_t nbMaxNames, char const **tensorNames) noexcept
Run shape calculations.
Definition: NvInferRuntime.h:4765
bool setDebugListener(IDebugListener *listener) noexcept
Set DebugListener for this execution context.
Definition: NvInferRuntime.h:5018
bool setTensorAddress(char const *tensorName, void *data) noexcept
Set memory address for given input or output tensor.
Definition: NvInferRuntime.h:4651
bool setTemporaryStorageAllocator(IGpuAllocator *allocator) noexcept
Specify allocator to use for internal temporary storage.
Definition: NvInferRuntime.h:4878
void * getOutputTensorAddress(char const *tensorName) const noexcept
Get memory address for given output.
Definition: NvInferRuntime.h:4732
bool enqueueV3(cudaStream_t stream) noexcept
Enqueue inference on a stream.
Definition: NvInferRuntime.h:4912
IDebugListener * getDebugListener() noexcept
Get the DebugListener of this execution context.
Definition: NvInferRuntime.h:5028
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:4383
bool setInputTensorAddress(char const *tensorName, void const *data) noexcept
Set memory address for given input.
Definition: NvInferRuntime.h:4713
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:4246
bool setInputConsumedEvent(cudaEvent_t event) noexcept
Mark input as consumed.
Definition: NvInferRuntime.h:4798
Dims getTensorStrides(char const *tensorName) const noexcept
Return the strides of the buffer for the given tensor name.
Definition: NvInferRuntime.h:4368
bool setNvtxVerbosity(ProfilingVerbosity verbosity) noexcept
Set the verbosity of the NVTX markers in the execution context.
Definition: NvInferRuntime.h:4963
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:4266
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:4473
bool setCommunicator(void *communicator) noexcept
Set the NCCL communicator for the execution context.
Definition: NvInferRuntime.h:5147
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:4347
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:4454
bool getUnfusedTensorsDebugState() const noexcept
Get the debug state of unfused tensors.
Definition: NvInferRuntime.h:5108
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:4256
void setName(char const *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:4290
cudaEvent_t getInputConsumedEvent() const noexcept
The event associated with consuming the input.
Definition: NvInferRuntime.h:4808
IRuntimeConfig * getRuntimeConfig() const noexcept
Get the runtime config object used during execution context creation.
Definition: NvInferRuntime.h:5069
Object for constructing IDimensionExpr.
Definition: NvInferRuntime.h:285
IDimensionExpr const * operation(DimensionOperation op, IDimensionExpr const &first, IDimensionExpr const &second) noexcept
Get the operation.
Definition: NvInferRuntime.h:301
IDimensionExpr const * constant(int64_t value) noexcept
Return pointer to IDimensionExpr for given value.
Definition: NvInferRuntime.h:290
apiv::VExprBuilder * mImpl
Definition: NvInferRuntime.h:308
virtual ~IExprBuilder() noexcept=0
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:139
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:144
virtual ~IHostMemory() noexcept=0
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:156
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:150
apiv::VHostMemory * mImpl
Definition: NvInferRuntime.h:162
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:2665
apiv::VOptimizationProfile * mImpl
Definition: NvInferRuntime.h:2832
Dims getDimensions(char const *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:2706
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:2749
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:2737
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:2694
virtual ~IOptimizationProfile() noexcept=0
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:2766
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:2826
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:2813
int32_t getNbShapeValues(char const *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:2719
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:792
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:407
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:556
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:474
Updates weights in an engine.
Definition: NvInferRuntime.h:2259
bool refitCudaEngineAsync(cudaStream_t stream) noexcept
Enqueue weights refitting of the associated engine on the given stream.
Definition: NvInferRuntime.h:2589
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the refitter.
Definition: NvInferRuntime.h:2468
TensorLocation getWeightsLocation(char const *weightsName) const noexcept
Get location for the weights associated with the given name.
Definition: NvInferRuntime.h:2527
bool setNamedWeights(char const *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:2392
int32_t getAllWeights(int32_t size, char const **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:2428
virtual ~IRefitter() noexcept=0
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:2438
bool refitCudaEngine() noexcept
Refits associated engine.
Definition: NvInferRuntime.h:2295
int32_t getMissingWeights(int32_t size, char const **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:2412
int32_t getMissing(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:2316
Weights getNamedWeights(char const *weightsName) const noexcept
Get weights associated with the given name.
Definition: NvInferRuntime.h:2511
bool unsetNamedWeights(char const *weightsName) noexcept
Unset weights associated with the given name.
Definition: NvInferRuntime.h:2543
Weights getWeightsPrototype(char const *weightsName) const noexcept
Get the Weights prototype associated with the given name.
Definition: NvInferRuntime.h:2607
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:2454
bool setNamedWeights(char const *name, Weights weights, TensorLocation location) noexcept
Specify new weights on a specified device of given name.
Definition: NvInferRuntime.h:2495
void setWeightsValidation(bool weightsValidation) noexcept
Set whether to validate weights during refitting.
Definition: NvInferRuntime.h:2559
apiv::VRefitter * mImpl
Definition: NvInferRuntime.h:2613
int32_t getAll(int32_t size, char const **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:2333
bool getWeightsValidation() const noexcept
Get whether to validate weights values during refitting.
Definition: NvInferRuntime.h:2567
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2352
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2367
A class for Runtime cache currently used for TensorRT JIT compilation. This cache can be serialized a...
Definition: NvInferRuntime.h:3040
bool deserialize(void const *blob, size_t size) noexcept
Deserialize the Runtime cache from a stream that contains serialized Runtime cache.
Definition: NvInferRuntime.h:3060
bool reset() noexcept
Reset the Runtime cache. Clears all content within the cache.
Definition: NvInferRuntime.h:3068
apiv::VRuntimeCache * mImpl
Definition: NvInferRuntime.h:3074
virtual ~IRuntimeCache() noexcept=0
A class for runtime configuration. This class is used during execution context creation.
Definition: NvInferRuntime.h:3158
bool setCudaGraphStrategy(CudaGraphStrategy strategy) noexcept
Set the strategy used for CUDA graphs for JIT (Just-In-Time) inference. Default is kDISABLED.
Definition: NvInferRuntime.h:3252
DynamicShapesKernelSpecializationStrategy getDynamicShapesKernelSpecializationStrategy() const noexcept
Return the dynamic shape specialization strategy of this config.
Definition: NvInferRuntime.h:3228
apiv::VRuntimeConfig * mImpl
Definition: NvInferRuntime.h:3268
IRuntimeCache * createRuntimeCache() const noexcept
Create an empty Runtime cache.
Definition: NvInferRuntime.h:3187
virtual ~IRuntimeConfig() noexcept=0
ExecutionContextAllocationStrategy getExecutionContextAllocationStrategy() const noexcept
Get the execution context allocation strategy.
Definition: NvInferRuntime.h:3177
bool setRuntimeCache(IRuntimeCache const &cache) noexcept
Set Runtime cache to the runtime config. Enables Runtime caching.
Definition: NvInferRuntime.h:3197
void setDynamicShapesKernelSpecializationStrategy(DynamicShapesKernelSpecializationStrategy dynamicShapesKernelSpecializationStrategy) noexcept
Set the dynamic shape kernel specialization strategy for this config.
Definition: NvInferRuntime.h:3217
IRuntimeCache * getRuntimeCache() const noexcept
Get the Runtime cache from the runtime config.
Definition: NvInferRuntime.h:3207
CudaGraphStrategy getCudaGraphStrategy() const noexcept
Return the strategy used for CUDA graphs for JIT (Just-In-Time) inference.
Definition: NvInferRuntime.h:3262
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:1914
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:2063
IRuntime * loadRuntime(char const *path) noexcept
Load IRuntime from the file.
Definition: NvInferRuntime.h:2179
bool getEngineHostCodeAllowed() const noexcept
Get whether the runtime is allowed to deserialize engines with host executable code.
Definition: NvInferRuntime.h:2201
int64_t getEngineHeaderSize() const noexcept
Get size of engine header in bytes.
Definition: NvInferRuntime.h:2213
TempfileControlFlags getTempfileControlFlags() const noexcept
Get the tempfile control flags for this runtime.
Definition: NvInferRuntime.h:2151
void setEngineHostCodeAllowed(bool allowed) noexcept
Set whether the runtime is allowed to deserialize engines with host executable code.
Definition: NvInferRuntime.h:2191
void setTemporaryDirectory(char const *path) noexcept
Set the directory that will be used by this runtime for temporary files.
Definition: NvInferRuntime.h:2112
IPluginRegistry & getPluginRegistry() noexcept
Get the local plugin registry that can be used by the runtime.
Definition: NvInferRuntime.h:2161
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible or 0 if DLA is unavailable.
Definition: NvInferRuntime.h:1947
EngineValidity getEngineValidity(void const *blob, int64_t blobSize, uint64_t *diagnostics) const noexcept
Check for engine validity by inspecting the serialized engine header.
Definition: NvInferRuntime.h:2240
ICudaEngine * deserializeCudaEngine(void const *blob, std::size_t size) noexcept
Deserialize an engine from host memory.
Definition: NvInferRuntime.h:2015
virtual ~IRuntime() noexcept=0
void setTempfileControlFlags(TempfileControlFlags flags) noexcept
Set the tempfile control flags for this runtime.
Definition: NvInferRuntime.h:2139
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:1939
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:1963
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1997
ICudaEngine * deserializeCudaEngine(IStreamReaderV2 &streamReader)
Deserialize an engine from a stream. IStreamReaderV2 is expected to support reading to both host and ...
Definition: NvInferRuntime.h:2038
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:2048
int32_t getMaxThreads() const noexcept
Get the maximum number of threads that can be used by the runtime.
Definition: NvInferRuntime.h:2077
char const * getTemporaryDirectory() const noexcept
Get the directory that will be used by this runtime for temporary files.
Definition: NvInferRuntime.h:2123
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1982
Holds properties for configuring an engine to serialize the binary.
Definition: NvInferRuntime.h:2932
bool clearFlag(SerializationFlag serializationFlag) noexcept
clear a serialization flag.
Definition: NvInferRuntime.h:2971
virtual ~ISerializationConfig() noexcept=0
bool setFlag(SerializationFlag serializationFlag) noexcept
Set a serialization flag.
Definition: NvInferRuntime.h:2983
SerializationFlags getFlags() const noexcept
Get the serialization flags for this config.
Definition: NvInferRuntime.h:2959
bool getFlag(SerializationFlag serializationFlag) const noexcept
Returns true if the serialization flag is set.
Definition: NvInferRuntime.h:2995
apiv::VSerializationConfig * mImpl
Definition: NvInferRuntime.h:3001
An Interface class for version control.
Definition: NvInferRuntimeBase.h:282
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:247
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:5382
PluginRegistrar()
Definition: NvInferRuntime.h:5384
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:121
DataType type
The type of the weights.
Definition: NvInferRuntime.h:123
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:125
void const * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:124
Definition: NvInferRuntime.h:4175
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:4180
~IDebugListener() override=default
Definition: NvInferRuntimeBase.h:419
Definition: NvInferRuntime.h:1652
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:1774
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1815
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:1721
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:1807
Definition: NvInferRuntime.h:5448
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:5535
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:5559
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:5567
~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:5414
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:5419
~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:1575
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1580
~ILogger() override=default
Severity
The severity corresponding to a log message.
Definition: NvInferRuntime.h:1591
virtual void log(Severity severity, AsciiChar const *msg) noexcept=0
A callback implemented by the application to handle logging messages;.
Definition: NvInferRuntime.h:4112
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:4117
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:4144
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:5574
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:5579
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:863
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:1067
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:1043
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:1078
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:1059
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:1035
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:875
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:820
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:825
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:1085
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1090
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:1102
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:1275
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1280
~IProfiler() override=default
virtual void reportLayerTime(char const *layerName, float ms) noexcept=0
Layer time reporting callback.
Definition: NvInferRuntime.h:608
~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:620
Definition: NvInferRuntime.h:720
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:732
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:643
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:655
~IStreamWriter() override=default
Definition: NvInferRuntime.h:1182
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferRuntime.h:1184
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:1218
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:5362
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:5351
The TensorRT API version 1 namespace.
Definition: NvInferPluginBase.h:29
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:2870
v_1_0::IOutputAllocator IOutputAllocator
Definition: NvInferRuntime.h:4170
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:178
@ kCEIL_DIV
Division rounding up.
v_1_0::IPluginV3OneCore IPluginV3OneCore
Definition: NvInferRuntime.h:1235
EngineInvalidityDiagnostics
Bitmask indicating the reason(s) why an engine is invalid.
Definition: NvInferRuntime.h:1882
@ kUNSUPPORTED_CC
Unsupported compute capability on current system.
@ kMALFORMED_ENGINE
Serialized engine does not conform to the expected format.
@ kINSUFFICIENT_GPU_MEMORY
Insufficient GPU memory to hold all engine weights.
@ kCUDA_ERROR
Incorrect installation of the CUDA driver or runtime.
@ kOLD_CUDA_DRIVER
CUDA driver too old (driver downgrade compared to when engine was built).
@ kOLD_CUDA_RUNTIME
CUDA runtime too old (runtime downgrade compared to when engine was built).
@ kVERSION_MISMATCH
TensorRT-RTX version mismatch to when engine was built.
TensorIOMode
Definition of tensor IO Mode.
Definition: NvInferRuntimeBase.h:662
@ kNONE
Tensor is not an input or output.
HardwareCompatibilityLevel
Describes requirements of compatibility with GPU architectures other than that of the GPU on which th...
Definition: NvInfer.h:10293
SerializationFlag
List of valid flags that the engine can enable when serializing the bytes.
Definition: NvInferRuntime.h:2911
@ kEXCLUDE_WEIGHTS
Exclude the weights that can be refitted.
@ kINCLUDE_REFIT
Remain refittable if originally so.
v_1_0::IStreamWriter IStreamWriter
Definition: NvInferRuntime.h:699
v_1_0::IProfiler IProfiler
Definition: NvInferRuntime.h:1309
DynamicShapesKernelSpecializationStrategy
Different kernel specialization strategies for dynamic shapes.
Definition: NvInferRuntime.h:3091
SeekPosition
Controls the seek mode of IStreamReaderV2.
Definition: NvInferRuntime.h:706
@ 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:776
uint32_t TempfileControlFlags
Represents a collection of one or more TempfileControlFlag values combined using bitwise-OR operation...
Definition: NvInferRuntime.h:1387
EngineStat
The kind of engine statistics that queried from the ICudaEngine.
Definition: NvInferRuntime.h:3282
@ 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.
CudaGraphStrategy
Strategies available for CUDA graphs optimizations for JIT (Just-In-Time) inference.
Definition: NvInferRuntime.h:3127
v_1_0::IGpuAllocator IGpuAllocator
Definition: NvInferRuntime.h:1851
EngineValidity
Whether a TensorRT-RTX engine is likely to be valid on the current system.
Definition: NvInferRuntime.h:1859
@ kINVALID
Engine is invalid on the current system.
@ kSUBOPTIMAL
Engine is likely to be valid on the current system, but may show reduced performance.
@ kVALID
Engine is likely to be valid on the current system, based on the information in the header.
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:149
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:1341
@ kSCALE
Scale layer.
@ kCONSTANT
Constant layer.
v_1_0::IDebugListener IDebugListener
Definition: NvInferRuntime.h:4211
TempfileControlFlag
Flags used to control TensorRT's behavior when creating executable temporary files.
Definition: NvInferRuntime.h:1364
@ kALLOW_IN_MEMORY_FILES
Allow creating and loading files in-memory (or unnamed files).
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:1319
@ 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:2882
@ 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:2846
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimePlugin.h:54
v_1_0::IPluginV3OneRuntime IPluginV3OneRuntime
Definition: NvInferRuntime.h:1259
@ 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:2901
@ kLINEAR
Supports linear (1D), bilinear (2D), and trilinear (3D) interpolation.
v_1_0::IPluginV3OneBuild IPluginV3OneBuild
Definition: NvInferRuntime.h:1247
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntime.h:1421
ExecutionContextAllocationStrategy
Different memory allocation behaviors for IExecutionContext.
Definition: NvInferRuntime.h:3018
@ 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:5440
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:5166
@ kJSON
Print layer information in JSON format.
@ kONELINE
Print layer information in one line per layer.
v_1_0::IStreamReader IStreamReader
Definition: NvInferRuntime.h:689
AllocatorFlag
Allowed type of memory allocation.
Definition: NvInferRuntime.h:1542
@ 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:203
@ 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:2629
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
uint32_t AllocatorFlags
Definition: NvInferRuntime.h:1555
Summarizes tensors that a plugin might see for an input or output.
Definition: NvInferRuntime.h:362
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:367
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:370
Dims opt
Optimum value of tensor’s dimensions specified for auto-tuning.
Definition: NvInferRuntime.h:373
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:364
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:131

  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