TensorRT 8.4.0
NvInferRuntime.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1993-2022, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NOTICE TO LICENSEE:
5 *
6 * This source code and/or documentation ("Licensed Deliverables") are
7 * subject to NVIDIA intellectual property rights under U.S. and
8 * international Copyright laws.
9 *
10 * These Licensed Deliverables contained herein is PROPRIETARY and
11 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12 * conditions of a form of NVIDIA software license agreement by and
13 * between NVIDIA and Licensee ("License Agreement") or electronically
14 * accepted by Licensee. Notwithstanding any terms or conditions to
15 * the contrary in the License Agreement, reproduction or disclosure
16 * of the Licensed Deliverables to any third party without the express
17 * written consent of NVIDIA is prohibited.
18 *
19 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
22 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32 * OF THESE LICENSED DELIVERABLES.
33 *
34 * U.S. Government End Users. These Licensed Deliverables are a
35 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36 * 1995), consisting of "commercial computer software" and "commercial
37 * computer software documentation" as such terms are used in 48
38 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39 * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
40 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41 * U.S. Government End Users acquire the Licensed Deliverables with
42 * only those rights set forth herein.
43 *
44 * Any use of the Licensed Deliverables in individual and commercial
45 * software must include, in the user documentation and internal
46 * comments to the code, the above Disclaimer and U.S. Government End
47 * Users Notice.
48 */
49
50#ifndef NV_INFER_RUNTIME_H
51#define NV_INFER_RUNTIME_H
52
58
59#include "NvInferImpl.h"
61
62namespace nvinfer1
63{
64
65class IExecutionContext;
66class ICudaEngine;
67class IPluginFactory;
68class IEngineInspector;
69
78
80{
81protected:
82 INoCopy() = default;
83 virtual ~INoCopy() = default;
84 INoCopy(const INoCopy& other) = delete;
85 INoCopy& operator=(const INoCopy& other) = delete;
86 INoCopy(INoCopy&& other) = delete;
87 INoCopy& operator=(INoCopy&& other) = delete;
88};
89
104
105enum class EngineCapability : int32_t
106{
111 kSTANDARD = 0,
112
115
122 kSAFETY = 1,
123
126
132 kDLA_STANDALONE = 2,
133
136};
137
138namespace impl
139{
141template <>
143{
144 static constexpr int32_t kVALUE = 3;
145};
146} // namespace impl
147
163{
164public:
166 const void* values;
167 int64_t count;
168};
169
180class IHostMemory : public INoCopy
181{
182public:
183 virtual ~IHostMemory() noexcept = default;
184
186 void* data() const noexcept
187 {
188 return mImpl->data();
189 }
190
192 std::size_t size() const noexcept
193 {
194 return mImpl->size();
195 }
196
198 DataType type() const noexcept
199 {
200 return mImpl->type();
201 }
209 TRT_DEPRECATED void destroy() noexcept
210 {
211 delete this;
212 }
213
214protected:
215 apiv::VHostMemory* mImpl;
216};
217
228enum class DimensionOperation : int32_t
229{
230 kSUM = 0,
231 kPROD = 1,
232 kMAX = 2,
233 kMIN = 3,
234 kSUB = 4,
235 kEQUAL = 5,
236 kLESS = 6,
237 kFLOOR_DIV = 7,
238 kCEIL_DIV = 8
239};
240
242template <>
243constexpr inline int32_t EnumMax<DimensionOperation>() noexcept
244{
245 return 9;
246}
247
252enum class TensorLocation : int32_t
253{
254 kDEVICE = 0,
255 kHOST = 1,
256};
257
258namespace impl
259{
261template <>
263{
264 static constexpr int32_t kVALUE = 2;
265};
266} // namespace impl
267
281{
282public:
284 bool isConstant() const noexcept
285 {
286 return mImpl->isConstant();
287 }
288
291 int32_t getConstantValue() const noexcept
292 {
293 return mImpl->getConstantValue();
294 }
295
296protected:
297 apiv::VDimensionExpr* mImpl;
298 virtual ~IDimensionExpr() noexcept = default;
299};
300
318class IExprBuilder : public INoCopy
319{
320public:
322 const IDimensionExpr* constant(int32_t value) noexcept
323 {
324 return mImpl->constant(value);
325 }
326
330 DimensionOperation op, const IDimensionExpr& first, const IDimensionExpr& second) noexcept
331 {
332 return mImpl->operation(op, first, second);
333 }
334
335protected:
336 apiv::VExprBuilder* mImpl;
337 virtual ~IExprBuilder() noexcept = default;
338};
339
346{
347public:
348 int32_t nbDims;
350};
351
358{
361
364
367};
368
388{
389public:
390 IPluginV2DynamicExt* clone() const noexcept override = 0;
391
416 virtual DimsExprs getOutputDimensions(
417 int32_t outputIndex, const DimsExprs* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept
418 = 0;
419
423 static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
424
457 virtual bool supportsFormatCombination(
458 int32_t pos, const PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
459 = 0;
460
499 virtual void configurePlugin(const DynamicPluginTensorDesc* in, int32_t nbInputs,
500 const DynamicPluginTensorDesc* out, int32_t nbOutputs) noexcept
501 = 0;
502
512 virtual size_t getWorkspaceSize(const PluginTensorDesc* inputs, int32_t nbInputs, const PluginTensorDesc* outputs,
513 int32_t nbOutputs) const noexcept
514 = 0;
515
528 virtual int32_t enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc,
529 const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept
530 = 0;
531
532protected:
540 int32_t getTensorRTVersion() const noexcept override
541 {
542 return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
543 }
544
545 virtual ~IPluginV2DynamicExt() noexcept {}
546
547private:
548 // Following are obsolete base class methods, and must not be implemented or used.
549
550 void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
551 bool const*, PluginFormat, int32_t) noexcept override final
552 {
553 }
554
555 bool supportsFormat(DataType, PluginFormat) const noexcept override final
556 {
557 return false;
558 }
559
560 Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept override final
561 {
562 return Dims{-1, {}};
563 }
564
565 bool isOutputBroadcastAcrossBatch(int32_t, bool const*, int32_t) const noexcept override final
566 {
567 return false;
568 }
569
570 bool canBroadcastInputAcrossBatch(int32_t) const noexcept override final
571 {
572 return true;
573 }
574
575 size_t getWorkspaceSize(int32_t) const noexcept override final
576 {
577 return 0;
578 }
579
580 int32_t enqueue(int32_t, const void* const*, void* const*, void*, cudaStream_t) noexcept override final
581 {
582 return 1;
583 }
584};
585
597{
598public:
605 virtual void reportLayerTime(const char* layerName, float ms) noexcept = 0;
606
607 virtual ~IProfiler() noexcept {}
608};
609
616enum class WeightsRole : int32_t
617{
618 kKERNEL = 0,
619 kBIAS = 1,
620 kSHIFT = 2,
621 kSCALE = 3,
622 kCONSTANT = 4,
623 kANY = 5,
624};
625
627template <>
628constexpr inline int32_t EnumMax<WeightsRole>() noexcept
629{
630 return 6;
631}
632
638enum class DeviceType : int32_t
639{
640 kGPU,
641 kDLA,
642};
643
645template <>
646constexpr inline int32_t EnumMax<DeviceType>() noexcept
647{
648 return 2;
649}
650
658class IRuntime : public INoCopy
659{
660public:
661 virtual ~IRuntime() noexcept = default;
662
678 TRT_DEPRECATED nvinfer1::ICudaEngine* deserializeCudaEngine(
679 const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept
680 {
681 return mImpl->deserializeCudaEngine(blob, size, nullptr);
682 }
683
691 void setDLACore(int32_t dlaCore) noexcept
692 {
693 mImpl->setDLACore(dlaCore);
694 }
695
702 int32_t getDLACore() const noexcept
703 {
704 return mImpl->getDLACore();
705 }
706
710 int32_t getNbDLACores() const noexcept
711 {
712 return mImpl->getNbDLACores();
713 }
714
722 TRT_DEPRECATED void destroy() noexcept
723 {
724 delete this;
725 }
726
736 void setGpuAllocator(IGpuAllocator* allocator) noexcept
737 {
738 mImpl->setGpuAllocator(allocator);
739 }
740
752 //
755 void setErrorRecorder(IErrorRecorder* recorder) noexcept
756 {
757 mImpl->setErrorRecorder(recorder);
758 }
759
771 {
772 return mImpl->getErrorRecorder();
773 }
774
785 ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
786 {
787 return mImpl->deserializeCudaEngine(blob, size, nullptr);
788 }
789
795 ILogger* getLogger() const noexcept
796 {
797 return mImpl->getLogger();
798 }
799
809 bool setMaxThreads(int32_t maxThreads) noexcept
810 {
811 return mImpl->setMaxThreads(maxThreads);
812 }
813
823 int32_t getMaxThreads() const noexcept
824 {
825 return mImpl->getMaxThreads();
826 }
827
828protected:
829 apiv::VRuntime* mImpl;
830};
831
839class IRefitter : public INoCopy
840{
841public:
842 virtual ~IRefitter() noexcept = default;
843
854 bool setWeights(const char* layerName, WeightsRole role, Weights weights) noexcept
855 {
856 return mImpl->setWeights(layerName, role, weights);
857 }
858
869 bool refitCudaEngine() noexcept
870 {
871 return mImpl->refitCudaEngine();
872 }
873
890 int32_t getMissing(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
891 {
892 return mImpl->getMissing(size, layerNames, roles);
893 }
894
907 int32_t getAll(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
908 {
909 return mImpl->getAll(size, layerNames, roles);
910 }
911
917 TRT_DEPRECATED void destroy() noexcept
918 {
919 delete this;
920 }
921
934 bool setDynamicRange(const char* tensorName, float min, float max) noexcept
935 {
936 return mImpl->setDynamicRange(tensorName, min, max);
937 }
938
946 float getDynamicRangeMin(const char* tensorName) const noexcept
947 {
948 return mImpl->getDynamicRangeMin(tensorName);
949 }
950
958 float getDynamicRangeMax(const char* tensorName) const noexcept
959 {
960 return mImpl->getDynamicRangeMax(tensorName);
961 }
962
974 int32_t getTensorsWithDynamicRange(int32_t size, const char** tensorNames) const noexcept
975 {
976 return mImpl->getTensorsWithDynamicRange(size, tensorNames);
977 }
978
990 //
993 void setErrorRecorder(IErrorRecorder* recorder) noexcept
994 {
995 mImpl->setErrorRecorder(recorder);
996 }
997
1009 {
1010 return mImpl->getErrorRecorder();
1011 }
1012
1026 bool setNamedWeights(const char* name, Weights weights) noexcept
1027 {
1028 return mImpl->setNamedWeights(name, weights);
1029 }
1030
1046 int32_t getMissingWeights(int32_t size, const char** weightsNames) noexcept
1047 {
1048 return mImpl->getMissingWeights(size, weightsNames);
1049 }
1050
1062 int32_t getAllWeights(int32_t size, const char** weightsNames) noexcept
1063 {
1064 return mImpl->getAllWeights(size, weightsNames);
1065 }
1066
1072 ILogger* getLogger() const noexcept
1073 {
1074 return mImpl->getLogger();
1075 }
1076
1086 bool setMaxThreads(int32_t maxThreads) noexcept
1087 {
1088 return mImpl->setMaxThreads(maxThreads);
1089 }
1090
1100 int32_t getMaxThreads() const noexcept
1101 {
1102 return mImpl->getMaxThreads();
1103 }
1104
1105protected:
1106 apiv::VRefitter* mImpl;
1107};
1108
1119enum class OptProfileSelector : int32_t
1120{
1121 kMIN = 0,
1122 kOPT = 1,
1123 kMAX = 2
1124};
1125
1131template <>
1132constexpr inline int32_t EnumMax<OptProfileSelector>() noexcept
1133{
1134 return 3;
1135}
1136
1160{
1161public:
1187 bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept
1188 {
1189 return mImpl->setDimensions(inputName, select, dims);
1190 }
1191
1197 Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept
1198 {
1199 return mImpl->getDimensions(inputName, select);
1200 }
1201
1241 const char* inputName, OptProfileSelector select, const int32_t* values, int32_t nbValues) noexcept
1242 {
1243 return mImpl->setShapeValues(inputName, select, values, nbValues);
1244 }
1245
1252 int32_t getNbShapeValues(const char* inputName) const noexcept
1253 {
1254 return mImpl->getNbShapeValues(inputName);
1255 }
1256
1262 int32_t const* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept
1263 {
1264 return mImpl->getShapeValues(inputName, select);
1265 }
1266
1280 bool setExtraMemoryTarget(float target) noexcept
1281 {
1282 return mImpl->setExtraMemoryTarget(target);
1283 }
1284
1288 float getExtraMemoryTarget() const noexcept
1289 {
1290 return mImpl->getExtraMemoryTarget();
1291 }
1292
1304 bool isValid() const noexcept
1305 {
1306 return mImpl->isValid();
1307 }
1308
1309protected:
1310 apiv::VOptimizationProfile* mImpl;
1311 virtual ~IOptimizationProfile() noexcept = default;
1312};
1313
1321enum class TacticSource : int32_t
1322{
1324 kCUBLAS = 0,
1325 kCUBLAS_LT = 1,
1326 kCUDNN = 2
1327};
1328
1329template <>
1330constexpr inline int32_t EnumMax<TacticSource>() noexcept
1331{
1332 return 3;
1333}
1334
1341using TacticSources = uint32_t;
1342
1352enum class ProfilingVerbosity : int32_t
1353{
1354 kLAYER_NAMES_ONLY = 0,
1355 kNONE = 1,
1356 kDETAILED = 2,
1357
1362};
1363
1365template <>
1366constexpr inline int32_t EnumMax<ProfilingVerbosity>() noexcept
1367{
1368 return 3;
1369}
1370
1378class ICudaEngine : public INoCopy
1379{
1380public:
1381 virtual ~ICudaEngine() noexcept = default;
1382
1393 int32_t getNbBindings() const noexcept
1394 {
1395 return mImpl->getNbBindings();
1396 }
1397
1415 int32_t getBindingIndex(const char* name) const noexcept
1416 {
1417 return mImpl->getBindingIndex(name);
1418 }
1419
1435 const char* getBindingName(int32_t bindingIndex) const noexcept
1436 {
1437 return mImpl->getBindingName(bindingIndex);
1438 }
1439
1448 bool bindingIsInput(int32_t bindingIndex) const noexcept
1449 {
1450 return mImpl->bindingIsInput(bindingIndex);
1451 }
1452
1473 Dims getBindingDimensions(int32_t bindingIndex) const noexcept
1474 {
1475 return mImpl->getBindingDimensions(bindingIndex);
1476 }
1477
1486 DataType getBindingDataType(int32_t bindingIndex) const noexcept
1487 {
1488 return mImpl->getBindingDataType(bindingIndex);
1489 }
1490
1498 int32_t getMaxBatchSize() const noexcept
1499 {
1500 return mImpl->getMaxBatchSize();
1501 }
1502
1512 int32_t getNbLayers() const noexcept
1513 {
1514 return mImpl->getNbLayers();
1515 }
1516
1526 IHostMemory* serialize() const noexcept
1527 {
1528 return mImpl->serialize();
1529 }
1530
1543 {
1544 return mImpl->createExecutionContext();
1545 }
1546
1554 TRT_DEPRECATED void destroy() noexcept
1555 {
1556 delete this;
1557 }
1558
1569 TensorLocation getLocation(int32_t bindingIndex) const noexcept
1570 {
1571 return mImpl->getLocation(bindingIndex);
1572 }
1573
1579 {
1580 return mImpl->createExecutionContextWithoutDeviceMemory();
1581 }
1582
1588 size_t getDeviceMemorySize() const noexcept
1589 {
1590 return mImpl->getDeviceMemorySize();
1591 }
1592
1598 bool isRefittable() const noexcept
1599 {
1600 return mImpl->isRefittable();
1601 }
1602
1612 int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
1613 {
1614 return mImpl->getBindingBytesPerComponent(bindingIndex);
1615 }
1616
1626 int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
1627 {
1628 return mImpl->getBindingComponentsPerElement(bindingIndex);
1629 }
1630
1636 TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
1637 {
1638 return mImpl->getBindingFormat(bindingIndex);
1639 }
1640
1655 const char* getBindingFormatDesc(int32_t bindingIndex) const noexcept
1656 {
1657 return mImpl->getBindingFormatDesc(bindingIndex);
1658 }
1659
1667 int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
1668 {
1669 return mImpl->getBindingVectorizedDim(bindingIndex);
1670 }
1671
1682 const char* getName() const noexcept
1683 {
1684 return mImpl->getName();
1685 }
1686
1693 int32_t getNbOptimizationProfiles() const noexcept
1694 {
1695 return mImpl->getNbOptimizationProfiles();
1696 }
1697
1720 Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept
1721 {
1722 return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1723 }
1724
1746 const int32_t* getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const
1747 noexcept
1748 {
1749 return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1750 }
1751
1783 bool isShapeBinding(int32_t bindingIndex) const noexcept
1784 {
1785 return mImpl->isShapeBinding(bindingIndex);
1786 }
1787
1797 bool isExecutionBinding(int32_t bindingIndex) const noexcept
1798 {
1799 return mImpl->isExecutionBinding(bindingIndex);
1800 }
1801
1813 {
1814 return mImpl->getEngineCapability();
1815 }
1816
1827 //
1830 void setErrorRecorder(IErrorRecorder* recorder) noexcept
1831 {
1832 return mImpl->setErrorRecorder(recorder);
1833 }
1834
1846 {
1847 return mImpl->getErrorRecorder();
1848 }
1849
1864 bool hasImplicitBatchDimension() const noexcept
1865 {
1866 return mImpl->hasImplicitBatchDimension();
1867 }
1868
1874 {
1875 return mImpl->getTacticSources();
1876 }
1877
1885 {
1886 return mImpl->getProfilingVerbosity();
1887 }
1888
1895 {
1896 return mImpl->createEngineInspector();
1897 }
1898
1899protected:
1900 apiv::VCudaEngine* mImpl;
1901};
1902
1914{
1915public:
1916 virtual ~IExecutionContext() noexcept = default;
1917
1935 bool execute(int32_t batchSize, void* const* bindings) noexcept
1936 {
1937 return mImpl->execute(batchSize, bindings);
1938 }
1939
1964 bool enqueue(int32_t batchSize, void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1965 {
1966 return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1967 }
1968
1977 void setDebugSync(bool sync) noexcept
1978 {
1979 mImpl->setDebugSync(sync);
1980 }
1981
1987 bool getDebugSync() const noexcept
1988 {
1989 return mImpl->getDebugSync();
1990 }
1991
1997 void setProfiler(IProfiler* profiler) noexcept
1998 {
1999 mImpl->setProfiler(profiler);
2000 }
2001
2007 IProfiler* getProfiler() const noexcept
2008 {
2009 return mImpl->getProfiler();
2010 }
2011
2017 const ICudaEngine& getEngine() const noexcept
2018 {
2019 return mImpl->getEngine();
2020 }
2021
2029 TRT_DEPRECATED void destroy() noexcept
2030 {
2031 delete this;
2032 }
2033
2041 void setName(const char* name) noexcept
2042 {
2043 mImpl->setName(name);
2044 }
2045
2051 const char* getName() const noexcept
2052 {
2053 return mImpl->getName();
2054 }
2055
2067 void setDeviceMemory(void* memory) noexcept
2068 {
2069 mImpl->setDeviceMemory(memory);
2070 }
2071
2088 Dims getStrides(int32_t bindingIndex) const noexcept
2089 {
2090 return mImpl->getStrides(bindingIndex);
2091 }
2092
2093public:
2131 bool setOptimizationProfile(int32_t profileIndex) noexcept
2132 {
2133 return mImpl->setOptimizationProfile(profileIndex);
2134 }
2135
2143 int32_t getOptimizationProfile() const noexcept
2144 {
2145 return mImpl->getOptimizationProfile();
2146 }
2147
2180 bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
2181 {
2182 return mImpl->setBindingDimensions(bindingIndex, dimensions);
2183 }
2184
2210 Dims getBindingDimensions(int32_t bindingIndex) const noexcept
2211 {
2212 return mImpl->getBindingDimensions(bindingIndex);
2213 }
2214
2240 bool setInputShapeBinding(int32_t bindingIndex, int32_t const* data) noexcept
2241 {
2242 return mImpl->setInputShapeBinding(bindingIndex, data);
2243 }
2244
2262 bool getShapeBinding(int32_t bindingIndex, int32_t* data) const noexcept
2263 {
2264 return mImpl->getShapeBinding(bindingIndex, data);
2265 }
2266
2277 bool allInputDimensionsSpecified() const noexcept
2278 {
2279 return mImpl->allInputDimensionsSpecified();
2280 }
2281
2291 bool allInputShapesSpecified() const noexcept
2292
2293 {
2294 return mImpl->allInputShapesSpecified();
2295 }
2296
2308 //
2311 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2312 {
2313 mImpl->setErrorRecorder(recorder);
2314 }
2315
2327 {
2328 return mImpl->getErrorRecorder();
2329 }
2330
2343 bool executeV2(void* const* bindings) noexcept
2344 {
2345 return mImpl->executeV2(bindings);
2346 }
2347
2371 bool enqueueV2(void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
2372 {
2373 return mImpl->enqueueV2(bindings, stream, inputConsumed);
2374 }
2375
2419 bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
2420 {
2421 return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2422 }
2423
2434 void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
2435 {
2436 mImpl->setEnqueueEmitsProfile(enqueueEmitsProfile);
2437 }
2438
2445 bool getEnqueueEmitsProfile() const noexcept
2446 {
2447 return mImpl->getEnqueueEmitsProfile();
2448 }
2449
2472 bool reportToProfiler() const noexcept
2473 {
2474 return mImpl->reportToProfiler();
2475 }
2476
2477protected:
2478 apiv::VExecutionContext* mImpl;
2479}; // class IExecutionContext
2480
2488enum class LayerInformationFormat : int32_t
2489{
2490 kONELINE = 0,
2491 kJSON = 1,
2492};
2493
2496template <>
2497constexpr inline int32_t EnumMax<LayerInformationFormat>() noexcept
2498{
2499 return 2;
2500}
2501
2518{
2519public:
2520 virtual ~IEngineInspector() noexcept = default;
2521
2534 bool setExecutionContext(IExecutionContext const* context) noexcept
2535 {
2536 return mImpl->setExecutionContext(context);
2537 }
2538
2547 {
2548 return mImpl->getExecutionContext();
2549 }
2550
2571 AsciiChar const* getLayerInformation(int32_t layerIndex, LayerInformationFormat format) const noexcept
2572 {
2573 return mImpl->getLayerInformation(layerIndex, format);
2574 }
2575
2597 {
2598 return mImpl->getEngineInformation(format);
2599 }
2600
2612 //
2615 void setErrorRecorder(IErrorRecorder* recorder) noexcept
2616 {
2617 mImpl->setErrorRecorder(recorder);
2618 }
2619
2631 {
2632 return mImpl->getErrorRecorder();
2633 }
2634
2635protected:
2636 apiv::VEngineInspector* mImpl;
2637}; // class IEngineInspector
2638
2639} // namespace nvinfer1
2640
2645extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
2646
2651extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
2652
2657
2663extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
2664
2665namespace nvinfer1
2666{
2667namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this
2668 // header.
2669{
2675inline IRuntime* createInferRuntime(ILogger& logger) noexcept
2676{
2677 return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2678}
2679
2685inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
2686{
2687 return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2688}
2689
2690} // namespace
2691
2703template <typename T>
2705{
2706public:
2708 {
2709 getPluginRegistry()->registerCreator(instance, "");
2710 }
2711
2712private:
2714 T instance{};
2715};
2716
2717} // namespace nvinfer1
2718
2719#define REGISTER_TENSORRT_PLUGIN(name) \
2720 static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
2721#endif // NV_INFER_RUNTIME_H
nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
#define TENSORRTAPI
Definition: NvInferRuntimeCommon.h:91
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeCommon.h:110
#define TRT_DEPRECATED
Definition: NvInferRuntimeCommon.h:77
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeCommon.h:78
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:190
static constexpr int32_t MAX_DIMS
The maximum rank (number of dimensions) supported for a tensor.
Definition: NvInferRuntimeCommon.h:193
Definition: NvInferRuntime.h:346
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:348
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1379
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1612
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1626
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1783
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1864
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1682
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1812
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1554
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1845
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1636
apiv::VCudaEngine * mImpl
Definition: NvInferRuntime.h:1900
const int32_t * getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const noexcept
Get minimum / optimum / maximum values for an input shape binding under an optimization profile.
Definition: NvInferRuntime.h:1746
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1569
Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a particular binding under an optimization profile...
Definition: NvInferRuntime.h:1720
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1473
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1667
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1498
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1830
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1588
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1873
virtual ~ICudaEngine() noexcept=default
ProfilingVerbosity getProfilingVerbosity() const noexcept
Return the ProfilingVerbosity the builder config was set to when the engine was built.
Definition: NvInferRuntime.h:1884
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1526
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1578
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1415
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1486
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1542
IEngineInspector * createEngineInspector() const noexcept
Create a new engine inspector which prints the layer information in an engine or an execution context...
Definition: NvInferRuntime.h:1894
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1435
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1693
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1512
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1655
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1448
bool isExecutionBinding(int32_t bindingIndex) const noexcept
True if pointer to tensor data is required for execution phase, false if nullptr can be supplied.
Definition: NvInferRuntime.h:1797
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1598
Definition: NvInferRuntime.h:281
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:284
virtual ~IDimensionExpr() noexcept=default
apiv::VDimensionExpr * mImpl
Definition: NvInferRuntime.h:297
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:291
An engine inspector which prints out the layer information of an engine or an execution context.
Definition: NvInferRuntime.h:2518
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2630
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2615
AsciiChar 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:2596
IExecutionContext const * getExecutionContext() const noexcept
Get the context currently being inspected.
Definition: NvInferRuntime.h:2546
apiv::VEngineInspector * mImpl
Definition: NvInferRuntime.h:2636
virtual ~IEngineInspector() noexcept=default
AsciiChar 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:2571
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1699
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1914
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2326
bool reportToProfiler() const noexcept
Calculate layer timing info for the current optimization profile in IExecutionContext and update the ...
Definition: NvInferRuntime.h:2472
virtual ~IExecutionContext() noexcept=default
void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:2067
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2210
bool getShapeBinding(int32_t bindingIndex, int32_t *data) const noexcept
Get values of an input tensor required for shape calculations or an output tensor produced by shape c...
Definition: NvInferRuntime.h:2262
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1977
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2371
void setEnqueueEmitsProfile(bool enqueueEmitsProfile) noexcept
Set whether enqueue emits layer timing to the profiler.
Definition: NvInferRuntime.h:2434
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2180
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2240
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2343
bool getEnqueueEmitsProfile() const noexcept
Get the enqueueEmitsProfile state.
Definition: NvInferRuntime.h:2445
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2419
apiv::VExecutionContext * mImpl
Definition: NvInferRuntime.h:2478
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2143
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1964
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:2029
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1987
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:2051
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:2088
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:2007
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2311
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:2131
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2277
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:2017
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1997
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2291
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:2041
Definition: NvInferRuntime.h:319
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:322
virtual ~IExprBuilder() noexcept=default
apiv::VExprBuilder * mImpl
Definition: NvInferRuntime.h:336
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:329
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1372
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:181
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:186
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:198
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:209
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:192
apiv::VHostMemory * mImpl
Definition: NvInferRuntime.h:215
virtual ~IHostMemory() noexcept=default
Application-implemented logging interface for the builder, refitter and runtime.
Definition: NvInferRuntimeCommon.h:1510
Forward declaration of IEngineInspector for use by other interfaces.
Definition: NvInferRuntime.h:80
INoCopy & operator=(INoCopy &&other)=delete
INoCopy & operator=(const INoCopy &other)=delete
INoCopy(INoCopy &&other)=delete
virtual ~INoCopy()=default
INoCopy(const INoCopy &other)=delete
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1160
apiv::VOptimizationProfile * mImpl
Definition: NvInferRuntime.h:1310
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1187
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1252
virtual ~IOptimizationProfile() noexcept=default
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1288
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1197
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1280
int32_t const * getShapeValues(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:1262
bool setShapeValues(const char *inputName, OptProfileSelector select, const int32_t *values, int32_t nbValues) noexcept
Set the minimum / optimum / maximum values for an input shape tensor.
Definition: NvInferRuntime.h:1240
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1304
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:1244
virtual bool registerCreator(IPluginCreator &creator, AsciiChar const *const pluginNamespace) noexcept=0
Register a plugin creator. Returns false if one with same type is already registered.
Definition: NvInferRuntime.h:388
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:545
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:714
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:597
virtual void reportLayerTime(const char *layerName, float ms) noexcept=0
Layer time reporting callback.
virtual ~IProfiler() noexcept
Definition: NvInferRuntime.h:607
Updates weights in an engine.
Definition: NvInferRuntime.h:840
int32_t getMaxThreads() const noexcept
get the maximum number of threads that can be used by the refitter.
Definition: NvInferRuntime.h:1100
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:946
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:934
ILogger * getLogger() const noexcept
get the logger with which the refitter was created
Definition: NvInferRuntime.h:1072
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:869
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:890
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:974
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:917
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:1086
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:907
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:1046
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:1026
apiv::VRefitter * mImpl
Definition: NvInferRuntime.h:1106
virtual ~IRefitter() noexcept=default
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:958
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:993
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1062
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1008
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:659
bool setMaxThreads(int32_t maxThreads) noexcept
Set the maximum number of threads.
Definition: NvInferRuntime.h:809
virtual ~IRuntime() noexcept=default
ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:785
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:722
apiv::VRuntime * mImpl
Definition: NvInferRuntime.h:829
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:691
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:710
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:702
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:736
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:770
ILogger * getLogger() const noexcept
get the logger with which the runtime was created
Definition: NvInferRuntime.h:795
int32_t getMaxThreads() const noexcept
Get the maximum number of threads that can be used by the runtime.
Definition: NvInferRuntime.h:823
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:755
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2705
PluginRegistrar()
Definition: NvInferRuntime.h:2707
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:163
DataType type
The type of the weights.
Definition: NvInferRuntime.h:165
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:167
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:166
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an safe::IRuntime class.
The TensorRT API version 1 namespace.
uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferRuntime.h:1341
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:106
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:229
@ kSUB
Substract the second element from the first.
@ kSUM
Sum of the two operands.
@ kPROD
Product of the two operands.
@ kFLOOR_DIV
Floor division of the first element by the second.
@ kEQUAL
1 if operands are equal, 0 otherwise.
@ kMIN
Minimum of the two operands.
@ kLESS
1 if first operand is less than second operand, 0 otherwise.
@ kMAX
Maximum of the two operands.
@ kCEIL_DIV
Division rounding up.
constexpr int32_t EnumMax< WeightsRole >() noexcept
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:628
char_t AsciiChar
AsciiChar is the type used by TensorRT to represent valid ASCII characters.
Definition: NvInferRuntimeCommon.h:125
@ kV2_DYNAMICEXT
IPluginV2DynamicExt.
constexpr int32_t EnumMax< LayerInformationFormat >() noexcept
Definition: NvInferRuntime.h:2497
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:151
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:639
@ kSCALE
Scale layer.
@ kCONSTANT
Constant layer.
@ kDEFAULT
Similar to ONNX Gather.
constexpr int32_t EnumMax< OptProfileSelector >() noexcept
Number of different values of OptProfileSelector enum.
Definition: NvInferRuntime.h:1132
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:617
@ kSHIFT
shift part of IScaleLayer
@ kANY
Any other weights role.
@ kBIAS
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
@ kKERNEL
kernel for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
constexpr int32_t EnumMax< ProfilingVerbosity >() noexcept
Maximum number of profile verbosity levels in ProfilingVerbosity enum.
Definition: NvInferRuntime.h:1366
ProfilingVerbosity
List of verbosity levels of layer information exposed in NVTX annotations and in IEngineInspector.
Definition: NvInferRuntime.h:1353
@ 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:1322
@ kCUBLAS_LT
cuBLAS LT tactics
@ kCUDNN
cuDNN tactics
@ kCUBLAS
cuBLAS tactics.
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:345
@ kMIN
Minimum of the two elements.
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:221
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1330
LayerInformationFormat
The format in which the IEngineInspector prints the layer information.
Definition: NvInferRuntime.h:2489
@ kJSON
Print layer information in JSON format.
@ kONELINE
Print layer information in one line per layer.
constexpr int32_t EnumMax< DeviceType >() noexcept
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:646
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:243
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:253
@ 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:1120
@ kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
Definition: NvInferRuntime.h:358
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:363
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:366
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:360
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:370
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:136