TensorRT  8.0.3
NvInferRuntime.h
Go to the documentation of this file.
1 /*
2  * Copyright 1993-2021 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"
60 #include "NvInferRuntimeCommon.h"
61 
62 namespace nvinfer1
63 {
64 
65 class IExecutionContext;
66 class ICudaEngine;
67 class IPluginFactory;
68 
77 
78 class INoCopy
79 {
80 protected:
81  INoCopy() = default;
82  virtual ~INoCopy() = default;
83  INoCopy(const INoCopy& other) = delete;
84  INoCopy& operator=(const INoCopy& other) = delete;
85  INoCopy(INoCopy&& other) = delete;
86  INoCopy& operator=(INoCopy&& other) = delete;
87 };
88 
103 
104 enum class EngineCapability : int32_t
105 {
110  kSTANDARD = 0,
111  kDEFAULT TRT_DEPRECATED_ENUM = kSTANDARD,
112 
118  kSAFETY = 1,
119  kSAFE_GPU TRT_DEPRECATED_ENUM = kSAFETY,
120 
126  kDLA_STANDALONE = 2,
127  kSAFE_DLA TRT_DEPRECATED_ENUM = kDLA_STANDALONE,
128 };
129 
130 namespace impl
131 {
133 template <>
135 {
136  static constexpr int32_t kVALUE = 3;
137 };
138 } // namespace impl
139 
152 class Weights
153 {
154 public:
156  const void* values;
157  int64_t count;
158 };
159 
170 class IHostMemory : public INoCopy
171 {
172 public:
173  virtual ~IHostMemory() noexcept = default;
174 
176  void* data() const noexcept
177  {
178  return mImpl->data();
179  }
180 
182  std::size_t size() const noexcept
183  {
184  return mImpl->size();
185  }
186 
188  DataType type() const noexcept
189  {
190  return mImpl->type();
191  }
199  TRT_DEPRECATED void destroy() noexcept
200  {
201  delete this;
202  }
203 
204 protected:
205  apiv::VHostMemory* mImpl;
206 };
207 
218 enum class DimensionOperation : int32_t
219 {
220  kSUM = 0,
221  kPROD = 1,
222  kMAX = 2,
223  kMIN = 3,
224  kSUB = 4,
225  kEQUAL = 5,
226  kLESS = 6,
227  kFLOOR_DIV = 7,
228  kCEIL_DIV = 8
229 };
230 
232 template <>
233 constexpr inline int32_t EnumMax<DimensionOperation>() noexcept
234 {
235  return 9;
236 }
237 
242 enum class TensorLocation : int32_t
243 {
244  kDEVICE = 0,
245  kHOST = 1,
246 };
247 
248 namespace impl
249 {
251 template <>
253 {
254  static constexpr int32_t kVALUE = 2;
255 };
256 } // namespace impl
257 
270 class IDimensionExpr : public INoCopy
271 {
272 public:
274  bool isConstant() const noexcept
275  {
276  return mImpl->isConstant();
277  }
278 
281  int32_t getConstantValue() const noexcept
282  {
283  return mImpl->getConstantValue();
284  }
285 
286 protected:
287  apiv::VDimensionExpr* mImpl;
288  virtual ~IDimensionExpr() noexcept = default;
289 };
290 
308 class IExprBuilder : public INoCopy
309 {
310 public:
312  const IDimensionExpr* constant(int32_t value) noexcept
313  {
314  return mImpl->constant(value);
315  }
316 
320  DimensionOperation op, const IDimensionExpr& first, const IDimensionExpr& second) noexcept
321  {
322  return mImpl->operation(op, first, second);
323  }
324 
325 protected:
326  apiv::VExprBuilder* mImpl;
327  virtual ~IExprBuilder() noexcept = default;
328 };
329 
336 {
337 public:
338  int32_t nbDims;
340 };
341 
348 {
351 
354 
357 };
358 
378 {
379 public:
380  IPluginV2DynamicExt* clone() const noexcept override = 0;
381 
406  virtual DimsExprs getOutputDimensions(
407  int32_t outputIndex, const DimsExprs* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept
408  = 0;
409 
413  static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
414 
447  virtual bool supportsFormatCombination(
448  int32_t pos, const PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
449  = 0;
450 
489  virtual void configurePlugin(const DynamicPluginTensorDesc* in, int32_t nbInputs,
490  const DynamicPluginTensorDesc* out, int32_t nbOutputs) noexcept
491  = 0;
492 
502  virtual size_t getWorkspaceSize(const PluginTensorDesc* inputs, int32_t nbInputs, const PluginTensorDesc* outputs,
503  int32_t nbOutputs) const noexcept
504  = 0;
505 
518  virtual int32_t enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc,
519  const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept
520  = 0;
521 
522 protected:
530  int32_t getTensorRTVersion() const noexcept override
531  {
532  return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
533  }
534 
535  virtual ~IPluginV2DynamicExt() noexcept {}
536 
537 private:
538  // Following are obsolete base class methods, and must not be implemented or used.
539 
540  void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
541  bool const*, PluginFormat, int32_t) noexcept override final
542  {
543  }
544 
545  bool supportsFormat(DataType, PluginFormat) const noexcept override final
546  {
547  return false;
548  }
549 
550  Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept override final
551  {
552  return Dims{-1, {}};
553  }
554 
555  bool isOutputBroadcastAcrossBatch(int32_t, bool const*, int32_t) const noexcept override final
556  {
557  return false;
558  }
559 
560  bool canBroadcastInputAcrossBatch(int32_t) const noexcept override final
561  {
562  return true;
563  }
564 
565  size_t getWorkspaceSize(int32_t) const noexcept override final
566  {
567  return 0;
568  }
569 
570  int32_t enqueue(int32_t, const void* const*, void* const*, void*, cudaStream_t) noexcept override final
571  {
572  return 1;
573  }
574 };
575 
587 {
588 public:
595  virtual void reportLayerTime(const char* layerName, float ms) noexcept = 0;
596 
597  virtual ~IProfiler() noexcept {}
598 };
599 
606 enum class WeightsRole : int32_t
607 {
608  kKERNEL = 0,
609  kBIAS = 1,
610  kSHIFT = 2,
611  kSCALE = 3,
612  kCONSTANT = 4,
613  kANY = 5,
614 };
615 
617 template <>
618 constexpr inline int32_t EnumMax<WeightsRole>() noexcept
619 {
620  return 6;
621 }
622 
628 enum class DeviceType : int32_t
629 {
630  kGPU,
631  kDLA,
632 };
633 
635 template <>
636 constexpr inline int32_t EnumMax<DeviceType>() noexcept
637 {
638  return 2;
639 }
640 
648 class IRuntime : public INoCopy
649 {
650 public:
651  virtual ~IRuntime() noexcept = default;
652 
669  const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept
670  {
671  return mImpl->deserializeCudaEngine(blob, size, nullptr);
672  }
673 
681  void setDLACore(int32_t dlaCore) noexcept
682  {
683  mImpl->setDLACore(dlaCore);
684  }
685 
692  int32_t getDLACore() const noexcept
693  {
694  return mImpl->getDLACore();
695  }
696 
700  int32_t getNbDLACores() const noexcept
701  {
702  return mImpl->getNbDLACores();
703  }
704 
712  TRT_DEPRECATED void destroy() noexcept
713  {
714  delete this;
715  }
716 
726  void setGpuAllocator(IGpuAllocator* allocator) noexcept
727  {
728  mImpl->setGpuAllocator(allocator);
729  }
730 
742  //
745  void setErrorRecorder(IErrorRecorder* recorder) noexcept
746  {
747  mImpl->setErrorRecorder(recorder);
748  }
749 
761  {
762  return mImpl->getErrorRecorder();
763  }
764 
773  nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
774  {
775  return mImpl->deserializeCudaEngine(blob, size, nullptr);
776  }
777 
778 protected:
779  apiv::VRuntime* mImpl;
780 };
781 
789 class IRefitter : public INoCopy
790 {
791 public:
792  virtual ~IRefitter() noexcept = default;
793 
804  bool setWeights(const char* layerName, WeightsRole role, Weights weights) noexcept
805  {
806  return mImpl->setWeights(layerName, role, weights);
807  }
808 
819  bool refitCudaEngine() noexcept
820  {
821  return mImpl->refitCudaEngine();
822  }
823 
840  int32_t getMissing(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
841  {
842  return mImpl->getMissing(size, layerNames, roles);
843  }
844 
857  int32_t getAll(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
858  {
859  return mImpl->getAll(size, layerNames, roles);
860  }
861 
867  TRT_DEPRECATED void destroy() noexcept
868  {
869  delete this;
870  }
871 
884  bool setDynamicRange(const char* tensorName, float min, float max) noexcept
885  {
886  return mImpl->setDynamicRange(tensorName, min, max);
887  }
888 
896  float getDynamicRangeMin(const char* tensorName) const noexcept
897  {
898  return mImpl->getDynamicRangeMin(tensorName);
899  }
900 
908  float getDynamicRangeMax(const char* tensorName) const noexcept
909  {
910  return mImpl->getDynamicRangeMax(tensorName);
911  }
912 
924  int32_t getTensorsWithDynamicRange(int32_t size, const char** tensorNames) const noexcept
925  {
926  return mImpl->getTensorsWithDynamicRange(size, tensorNames);
927  }
928 
940  //
943  void setErrorRecorder(IErrorRecorder* recorder) noexcept
944  {
945  mImpl->setErrorRecorder(recorder);
946  }
947 
959  {
960  return mImpl->getErrorRecorder();
961  }
962 
976  bool setNamedWeights(const char* name, Weights weights) noexcept
977  {
978  return mImpl->setNamedWeights(name, weights);
979  }
980 
996  int32_t getMissingWeights(int32_t size, const char** weightsNames) noexcept
997  {
998  return mImpl->getMissingWeights(size, weightsNames);
999  }
1000 
1012  int32_t getAllWeights(int32_t size, const char** weightsNames) noexcept
1013  {
1014  return mImpl->getAllWeights(size, weightsNames);
1015  }
1016 
1017 protected:
1018  apiv::VRefitter* mImpl;
1019 };
1020 
1031 enum class OptProfileSelector : int32_t
1032 {
1033  kMIN = 0,
1034  kOPT = 1,
1035  kMAX = 2
1036 };
1037 
1039 template <>
1040 constexpr inline int32_t EnumMax<OptProfileSelector>() noexcept
1041 {
1042  return 3;
1043 }
1044 
1068 {
1069 public:
1095  bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept
1096  {
1097  return mImpl->setDimensions(inputName, select, dims);
1098  }
1099 
1105  Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept
1106  {
1107  return mImpl->getDimensions(inputName, select);
1108  }
1109 
1149  const char* inputName, OptProfileSelector select, const int32_t* values, int32_t nbValues) noexcept
1150  {
1151  return mImpl->setShapeValues(inputName, select, values, nbValues);
1152  }
1153 
1160  int32_t getNbShapeValues(const char* inputName) const noexcept
1161  {
1162  return mImpl->getNbShapeValues(inputName);
1163  }
1164 
1170  int32_t const* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept
1171  {
1172  return mImpl->getShapeValues(inputName, select);
1173  }
1174 
1188  bool setExtraMemoryTarget(float target) noexcept
1189  {
1190  return mImpl->setExtraMemoryTarget(target);
1191  }
1192 
1196  float getExtraMemoryTarget() const noexcept
1197  {
1198  return mImpl->getExtraMemoryTarget();
1199  }
1200 
1212  bool isValid() const noexcept
1213  {
1214  return mImpl->isValid();
1215  }
1216 
1217 protected:
1219  virtual ~IOptimizationProfile() noexcept = default;
1220 };
1221 
1229 enum class TacticSource : int32_t
1230 {
1232  kCUBLAS = 0,
1233  kCUBLAS_LT = 1,
1234  kCUDNN = 2
1235 };
1236 
1237 template <>
1238 constexpr inline int32_t EnumMax<TacticSource>() noexcept
1239 {
1240  return 3;
1241 }
1242 
1249 using TacticSources = uint32_t;
1250 
1258 class ICudaEngine : public INoCopy
1259 {
1260 public:
1261  virtual ~ICudaEngine() noexcept = default;
1262 
1273  int32_t getNbBindings() const noexcept
1274  {
1275  return mImpl->getNbBindings();
1276  }
1277 
1295  int32_t getBindingIndex(const char* name) const noexcept
1296  {
1297  return mImpl->getBindingIndex(name);
1298  }
1299 
1315  const char* getBindingName(int32_t bindingIndex) const noexcept
1316  {
1317  return mImpl->getBindingName(bindingIndex);
1318  }
1319 
1328  bool bindingIsInput(int32_t bindingIndex) const noexcept
1329  {
1330  return mImpl->bindingIsInput(bindingIndex);
1331  }
1332 
1353  Dims getBindingDimensions(int32_t bindingIndex) const noexcept
1354  {
1355  return mImpl->getBindingDimensions(bindingIndex);
1356  }
1357 
1366  DataType getBindingDataType(int32_t bindingIndex) const noexcept
1367  {
1368  return mImpl->getBindingDataType(bindingIndex);
1369  }
1370 
1378  int32_t getMaxBatchSize() const noexcept
1379  {
1380  return mImpl->getMaxBatchSize();
1381  }
1382 
1392  int32_t getNbLayers() const noexcept
1393  {
1394  return mImpl->getNbLayers();
1395  }
1396 
1406  IHostMemory* serialize() const noexcept
1407  {
1408  return mImpl->serialize();
1409  }
1410 
1423  {
1424  return mImpl->createExecutionContext();
1425  }
1426 
1434  TRT_DEPRECATED void destroy() noexcept
1435  {
1436  delete this;
1437  }
1438 
1449  TensorLocation getLocation(int32_t bindingIndex) const noexcept
1450  {
1451  return mImpl->getLocation(bindingIndex);
1452  }
1453 
1459  {
1460  return mImpl->createExecutionContextWithoutDeviceMemory();
1461  }
1462 
1468  size_t getDeviceMemorySize() const noexcept
1469  {
1470  return mImpl->getDeviceMemorySize();
1471  }
1472 
1478  bool isRefittable() const noexcept
1479  {
1480  return mImpl->isRefittable();
1481  }
1482 
1492  int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
1493  {
1494  return mImpl->getBindingBytesPerComponent(bindingIndex);
1495  }
1496 
1506  int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
1507  {
1508  return mImpl->getBindingComponentsPerElement(bindingIndex);
1509  }
1510 
1516  TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
1517  {
1518  return mImpl->getBindingFormat(bindingIndex);
1519  }
1520 
1535  const char* getBindingFormatDesc(int32_t bindingIndex) const noexcept
1536  {
1537  return mImpl->getBindingFormatDesc(bindingIndex);
1538  }
1539 
1547  int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
1548  {
1549  return mImpl->getBindingVectorizedDim(bindingIndex);
1550  }
1551 
1562  const char* getName() const noexcept
1563  {
1564  return mImpl->getName();
1565  }
1566 
1573  int32_t getNbOptimizationProfiles() const noexcept
1574  {
1575  return mImpl->getNbOptimizationProfiles();
1576  }
1577 
1600  Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept
1601  {
1602  return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1603  }
1604 
1626  const int32_t* getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const
1627  noexcept
1628  {
1629  return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1630  }
1631 
1663  bool isShapeBinding(int32_t bindingIndex) const noexcept
1664  {
1665  return mImpl->isShapeBinding(bindingIndex);
1666  }
1667 
1677  bool isExecutionBinding(int32_t bindingIndex) const noexcept
1678  {
1679  return mImpl->isExecutionBinding(bindingIndex);
1680  }
1681 
1693  {
1694  return mImpl->getEngineCapability();
1695  }
1696 
1707  //
1710  void setErrorRecorder(IErrorRecorder* recorder) noexcept
1711  {
1712  return mImpl->setErrorRecorder(recorder);
1713  }
1714 
1726  {
1727  return mImpl->getErrorRecorder();
1728  }
1729 
1744  bool hasImplicitBatchDimension() const noexcept
1745  {
1746  return mImpl->hasImplicitBatchDimension();
1747  }
1748 
1754  {
1755  return mImpl->getTacticSources();
1756  }
1757 
1758 protected:
1759  apiv::VCudaEngine* mImpl;
1760 };
1761 
1773 {
1774 public:
1775  virtual ~IExecutionContext() noexcept = default;
1776 
1794  bool execute(int32_t batchSize, void* const* bindings) noexcept
1795  {
1796  return mImpl->execute(batchSize, bindings);
1797  }
1798 
1823  bool enqueue(int32_t batchSize, void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1824  {
1825  return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1826  }
1827 
1836  void setDebugSync(bool sync) noexcept
1837  {
1838  mImpl->setDebugSync(sync);
1839  }
1840 
1846  bool getDebugSync() const noexcept
1847  {
1848  return mImpl->getDebugSync();
1849  }
1850 
1856  void setProfiler(IProfiler* profiler) noexcept
1857  {
1858  mImpl->setProfiler(profiler);
1859  }
1860 
1866  IProfiler* getProfiler() const noexcept
1867  {
1868  return mImpl->getProfiler();
1869  }
1870 
1876  const ICudaEngine& getEngine() const noexcept
1877  {
1878  return mImpl->getEngine();
1879  }
1880 
1888  TRT_DEPRECATED void destroy() noexcept
1889  {
1890  delete this;
1891  }
1892 
1900  void setName(const char* name) noexcept
1901  {
1902  mImpl->setName(name);
1903  }
1904 
1910  const char* getName() const noexcept
1911  {
1912  return mImpl->getName();
1913  }
1914 
1926 
1928  void setDeviceMemory(void* memory) noexcept
1929  {
1930  mImpl->setDeviceMemory(memory);
1931  }
1932 
1949  Dims getStrides(int32_t bindingIndex) const noexcept
1950  {
1951  return mImpl->getStrides(bindingIndex);
1952  }
1953 
1954 public:
1991  bool setOptimizationProfile(int32_t profileIndex) noexcept
1992  {
1993  return mImpl->setOptimizationProfile(profileIndex);
1994  }
1995 
2003  int32_t getOptimizationProfile() const noexcept
2004  {
2005  return mImpl->getOptimizationProfile();
2006  }
2007 
2040  bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
2041  {
2042  return mImpl->setBindingDimensions(bindingIndex, dimensions);
2043  }
2044 
2070  Dims getBindingDimensions(int32_t bindingIndex) const noexcept
2071  {
2072  return mImpl->getBindingDimensions(bindingIndex);
2073  }
2074 
2100  bool setInputShapeBinding(int32_t bindingIndex, int32_t const* data) noexcept
2101  {
2102  return mImpl->setInputShapeBinding(bindingIndex, data);
2103  }
2104 
2122  bool getShapeBinding(int32_t bindingIndex, int32_t* data) const noexcept
2123  {
2124  return mImpl->getShapeBinding(bindingIndex, data);
2125  }
2126 
2137  bool allInputDimensionsSpecified() const noexcept
2138  {
2139  return mImpl->allInputDimensionsSpecified();
2140  }
2141 
2151  bool allInputShapesSpecified() const noexcept
2152 
2153  {
2154  return mImpl->allInputShapesSpecified();
2155  }
2156 
2168  //
2171  void setErrorRecorder(IErrorRecorder* recorder) noexcept
2172  {
2173  mImpl->setErrorRecorder(recorder);
2174  }
2175 
2187  {
2188  return mImpl->getErrorRecorder();
2189  }
2190 
2203  bool executeV2(void* const* bindings) noexcept
2204  {
2205  return mImpl->executeV2(bindings);
2206  }
2207 
2231  bool enqueueV2(void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
2232  {
2233  return mImpl->enqueueV2(bindings, stream, inputConsumed);
2234  }
2235 
2279  bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
2280  {
2281  return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2282  }
2283 
2284 protected:
2285  apiv::VExecutionContext* mImpl;
2286 }; // class IExecutionContext
2287 } // namespace nvinfer1
2288 
2293 extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
2294 
2299 extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
2300 
2304 extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry() noexcept;
2305 
2309 extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger() noexcept;
2310 
2311 namespace nvinfer1
2312 {
2313 namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this
2314  // header.
2315 {
2321 inline IRuntime* createInferRuntime(ILogger& logger) noexcept
2322 {
2323  return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2324 }
2325 
2331 inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
2332 {
2333  return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2334 }
2335 
2336 } // namespace
2337 
2349 template <typename T>
2351 {
2352 public:
2353  PluginRegistrar()
2354  {
2355  getPluginRegistry()->registerCreator(instance, "");
2356  }
2357 
2358 private:
2360  T instance{};
2361 };
2362 
2363 } // namespace nvinfer1
2364 
2365 #define REGISTER_TENSORRT_PLUGIN(name) \
2366  static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
2367 #endif // NV_INFER_RUNTIME_H
nvinfer1::IOptimizationProfile::getNbShapeValues
int32_t getNbShapeValues(const char *inputName) const noexcept
Get the number of values for an input shape tensor.
Definition: NvInferRuntime.h:1160
nvinfer1::IExecutionContext::allInputDimensionsSpecified
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2137
cudaEvent_t
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:112
nvinfer1::IDimensionExpr::getConstantValue
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:281
Dims
Structure to define the dimensions of a tensor.
nvinfer1::DynamicPluginTensorDesc
Definition: NvInferRuntime.h:347
nvinfer1::DeviceType::kGPU
GPU Device.
nvinfer1::IRuntime::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:760
nvinfer1::DimensionOperation
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:218
nvinfer1::ElementWiseOperation::kMIN
Minimum of the two elements.
nvinfer1::IExecutionContext::setDeviceMemory
TRT_DEPRECATED void setDeviceMemory(void *memory) noexcept
Set the device memory for use by this execution context.
Definition: NvInferRuntime.h:1928
getLogger
nvinfer1::ILogger * getLogger() noexcept
Return the logger object.
nvinfer1::IExecutionContext::getShapeBinding
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:2122
nvinfer1::IExecutionContext::setName
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:1900
nvinfer1::IPluginV2DynamicExt::getTensorRTVersion
int32_t getTensorRTVersion() const noexcept override
Return the API version with which this plugin was built. The upper byte reserved by TensorRT and is u...
Definition: NvInferRuntime.h:530
nvinfer1::Weights
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:152
nvinfer1::ICudaEngine::getDeviceMemorySize
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1468
nvinfer1::EngineCapability::kSAFETY
nvinfer1::PluginRegistrar
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2350
getPluginRegistry
nvinfer1::IPluginRegistry * getPluginRegistry() noexcept
Return the plugin registry.
nvinfer1::IDimensionExpr::isConstant
bool isConstant() const noexcept
Return true if expression is a build-time constant.
Definition: NvInferRuntime.h:274
nvinfer1::IHostMemory
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:170
nvinfer1::IHostMemory::data
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:176
nvinfer1::IHostMemory::destroy
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:199
nvinfer1::DeviceType
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:628
NvInferImpl.h
nvinfer1::IRefitter::getDynamicRangeMin
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:896
nvinfer1::IExecutionContext::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2186
nvinfer1::IRefitter::getDynamicRangeMax
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:908
nvinfer1::ICudaEngine::serialize
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1406
nvinfer1::impl::EnumMaxImpl
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:141
nvinfer1::EnumMax< WeightsRole >
constexpr int32_t EnumMax< WeightsRole >() noexcept
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:618
nvinfer1::ICudaEngine::getBindingDimensions
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1353
nvinfer1::LayerType::kSCALE
Scale layer.
nvinfer1::IRefitter
Updates weights in an engine.
Definition: NvInferRuntime.h:789
nvinfer1::Dims32
Definition: NvInferRuntimeCommon.h:194
nvinfer1::TacticSource
TacticSource
List of tactic sources for TensorRT.
Definition: NvInferRuntime.h:1229
nvinfer1::IOptimizationProfile::getShapeValues
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:1170
nvinfer1::WeightsRole::kKERNEL
kernel for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
nvinfer1::DeviceType::kDLA
DLA Core.
nvinfer1::SliceMode::kDEFAULT
Fail with error when the coordinates are out of bounds. This is the default.
nvinfer1::EngineCapability::kSTANDARD
nvinfer1::ICudaEngine::getProfileDimensions
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:1600
nvinfer1::ICudaEngine::getLocation
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1449
nvinfer1::PluginVersion::kV2_DYNAMICEXT
IPluginV2DynamicExt.
nvinfer1::ICudaEngine::getProfileShapeValues
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:1626
nvinfer1::ICudaEngine::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1434
nvinfer1::IOptimizationProfile::setDimensions
bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1095
nvinfer1::IRefitter::setDynamicRange
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:884
nvinfer1::TensorFormat
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:225
nvinfer1::IRuntime::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:712
nvinfer1::Weights::count
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:157
nvinfer1::IPluginRegistry
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:1007
nvinfer1::IExecutionContext::enqueueV2
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2231
nvinfer1::ILogger
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1194
nvinfer1::apiv::VCudaEngine
Definition: NvInferImpl.h:246
nvinfer1::DimensionOperation::kCEIL_DIV
Division rounding up.
nvinfer1::ICudaEngine
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1258
nvinfer1::ICudaEngine::getBindingComponentsPerElement
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1506
nvinfer1::IHostMemory::type
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:188
nvinfer1::IRefitter::refitCudaEngine
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:819
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRuntime
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:2321
nvinfer1::IRuntime::deserializeCudaEngine
nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:773
nvinfer1::apiv::VExprBuilder
Definition: NvInferImpl.h:190
nvinfer1::TacticSources
int32_t uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferImpl.h:152
nvinfer1::IOptimizationProfile::isValid
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1212
nvinfer1::IExecutionContext::enqueue
bool enqueue(int32_t batchSize, void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference on a batch.
Definition: NvInferRuntime.h:1823
nvinfer1::TacticSource::kCUBLAS
cuBLAS tactics.
nvinfer1::IExecutionContext::getDebugSync
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1846
nvinfer1::IRefitter::getAll
int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of all weights that could be refit.
Definition: NvInferRuntime.h:857
nvinfer1::IExecutionContext::execute
bool execute(int32_t batchSize, void *const *bindings) noexcept
Synchronously execute inference on a batch.
Definition: NvInferRuntime.h:1794
nvinfer1::IRuntime::deserializeCudaEngine
TRT_DEPRECATED nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size, IPluginFactory *pluginFactory) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:668
nvinfer1::ICudaEngine::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1710
nvinfer1::IHostMemory::size
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:182
nvinfer1::EnumMax< TacticSource >
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1238
nvinfer1::DimsExprs::nbDims
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:338
nvinfer1::ICudaEngine::isExecutionBinding
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:1677
nvinfer1
The TensorRT API version 1 namespace.
nvinfer1::IOptimizationProfile::setShapeValues
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:1148
nvinfer1::EnumMax< DeviceType >
constexpr int32_t EnumMax< DeviceType >() noexcept
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:636
nvinfer1::EnumMax< DimensionOperation >
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:233
nvinfer1::IExecutionContext::executeV2
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2203
nvinfer1::IRefitter::getTensorsWithDynamicRange
int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const noexcept
Get names of all tensors that have refittable dynamic ranges.
Definition: NvInferRuntime.h:924
nvinfer1::IPluginV2DynamicExt
Definition: NvInferRuntime.h:377
nvinfer1::IRuntime::setGpuAllocator
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:726
nvinfer1::IRuntime::getNbDLACores
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:700
nvinfer1::IOptimizationProfile::getExtraMemoryTarget
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1196
nvinfer1::ICudaEngine::getNbOptimizationProfiles
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1573
nvinfer1::TensorLocation::kHOST
Data stored on host.
nvinfer1::EngineCapability::kDLA_STANDALONE
nvinfer1::OptProfileSelector::kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
nvinfer1::IExprBuilder::constant
const IDimensionExpr * constant(int32_t value) noexcept
Return pointer to IDimensionExp for given value.
Definition: NvInferRuntime.h:312
nvinfer1::ICudaEngine::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1725
nvinfer1::ICudaEngine::getBindingDataType
DataType getBindingDataType(int32_t bindingIndex) const noexcept
Determine the required data type for a buffer from its binding index.
Definition: NvInferRuntime.h:1366
nvinfer1::DynamicPluginTensorDesc::max
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:356
nvinfer1::ElementWiseOperation::kEQUAL
Check if two elements are equal.
nvinfer1::IExecutionContext::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2171
nvinfer1::IExecutionContext::setOptimizationProfile
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:1991
nvinfer1::IExecutionContext::setProfiler
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1856
nvinfer1::ICudaEngine::getNbLayers
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1392
nvinfer1::Weights::type
DataType type
The type of the weights.
Definition: NvInferRuntime.h:155
nvinfer1::WeightsRole::kBIAS
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
nvinfer1::ICudaEngine::getBindingBytesPerComponent
int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
Return the number of bytes per component of an element.
Definition: NvInferRuntime.h:1492
nvinfer1::apiv::VRuntime
Definition: NvInferImpl.h:199
nvinfer1::DynamicPluginTensorDesc::min
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:353
nvinfer1::WeightsRole::kANY
Any other weights role.
nvinfer1::ICudaEngine::getBindingIndex
int32_t getBindingIndex(const char *name) const noexcept
Retrieve the binding index for a named tensor.
Definition: NvInferRuntime.h:1295
nvinfer1::ICudaEngine::getNbBindings
int32_t getNbBindings() const noexcept
Get the number of binding indices.
Definition: NvInferRuntime.h:1273
nvinfer1::IRuntime::setDLACore
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:681
nvinfer1::IExecutionContext::getEngine
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:1876
nvinfer1::IRefitter::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:958
nvinfer1::WeightsRole::kSHIFT
shift part of IScaleLayer
nvinfer1::IOptimizationProfile
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1067
nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1458
nvinfer1::ElementWiseOperation::kSUM
Sum of the two elements.
nvinfer1::apiv::VOptimizationProfile
Definition: NvInferImpl.h:231
nvinfer1::DataType
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:155
nvinfer1::ICudaEngine::getTacticSources
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1753
nvinfer1::ICudaEngine::getBindingVectorizedDim
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1547
nvinfer1::DimsExprs
Definition: NvInferRuntime.h:335
nvinfer1::IExecutionContext::setOptimizationProfileAsync
bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
Select an optimization profile for the current context with async semantics.
Definition: NvInferRuntime.h:2279
nvinfer1::ElementWiseOperation::kFLOOR_DIV
Floor division of the first element by the second.
nvinfer1::DynamicPluginTensorDesc::desc
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:350
nvinfer1::apiv::VHostMemory
Definition: NvInferImpl.h:175
nvinfer1::ElementWiseOperation::kSUB
Substract the second element from the first.
nvinfer1::INoCopy
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:78
nvinfer1::TensorLocation::kDEVICE
Data stored on device.
NvInferRuntimeCommon.h
nvinfer1::LayerType::kCONSTANT
Constant layer.
nvinfer1::ICudaEngine::getName
const char * getName() const noexcept
Returns the name of the network associated with the engine.
Definition: NvInferRuntime.h:1562
nvinfer1::ICudaEngine::getBindingFormat
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1516
nvinfer1::IErrorRecorder
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1373
nvinfer1::IExecutionContext::getProfiler
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:1866
nvinfer1::IRefitter::getAllWeights
int32_t getAllWeights(int32_t size, const char **weightsNames) noexcept
Get names of all weights that could be refit.
Definition: NvInferRuntime.h:1012
nvinfer1::OptProfileSelector
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1031
nvinfer1::WeightsRole
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:606
nvinfer1::IPluginRegistry::registerCreator
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.
nvinfer1::ICudaEngine::isShapeBinding
bool isShapeBinding(int32_t bindingIndex) const noexcept
True if tensor is required as input for shape calculations or output from them.
Definition: NvInferRuntime.h:1663
nvinfer1::ICudaEngine::getMaxBatchSize
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1378
nvinfer1::ICudaEngine::getBindingFormatDesc
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1535
nvinfer1::IRuntime::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:745
nvinfer1::IPluginV2Ext
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:608
nvinfer1::IExecutionContext::setInputShapeBinding
bool setInputShapeBinding(int32_t bindingIndex, int32_t const *data) noexcept
Set values of input tensor required by shape calculations.
Definition: NvInferRuntime.h:2100
nvinfer1::Dims32::MAX_DIMS
static constexpr int32_t MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:198
nvinfer1::TacticSource::kCUBLAS_LT
cuBLAS LT tactics
nvinfer1::IDimensionExpr
Definition: NvInferRuntime.h:270
nvinfer1::IExecutionContext::getBindingDimensions
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2070
nvinfer1::ElementWiseOperation::kPROD
Product of the two elements.
nvinfer1::EngineCapability
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:104
nvinfer1::ICudaEngine::hasImplicitBatchDimension
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1744
nvinfer1::IProfiler
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:586
nvinfer1::ElementWiseOperation::kLESS
Check if element in first tensor is less than corresponding element in second tensor.
nvinfer1::ICudaEngine::bindingIsInput
bool bindingIsInput(int32_t bindingIndex) const noexcept
Determine whether a binding is an input binding.
Definition: NvInferRuntime.h:1328
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:109
nvinfer1::IOptimizationProfile::setExtraMemoryTarget
bool setExtraMemoryTarget(float target) noexcept
Set a target for extra GPU memory that may be used by this profile.
Definition: NvInferRuntime.h:1188
nvinfer1::IExecutionContext::allInputShapesSpecified
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2151
nvinfer1::PluginTensorDesc
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:373
nvinfer1::IRefitter::destroy
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:867
nvinfer1::Weights::values
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:156
nvinfer1::apiv::VDimensionExpr
Definition: NvInferImpl.h:183
nvinfer1::PluginFormat
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:350
nvinfer1::IRuntime::getDLACore
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:692
nvinfer1::apiv::VExecutionContext
Definition: NvInferImpl.h:285
nvinfer1::ICudaEngine::getBindingName
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1315
nvinfer1::IRefitter::setNamedWeights
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:976
nvinfer1::IExecutionContext::getName
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:1910
nvinfer1::TacticSource::kCUDNN
cuDNN tactics
nvinfer1::IGpuAllocator
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1103
nvinfer1::IOptimizationProfile::getDimensions
Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
Definition: NvInferRuntime.h:1105
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRefitter
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:2331
nvinfer1::ICudaEngine::isRefittable
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1478
nvinfer1::IRefitter::getMissing
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:840
nvinfer1::IRuntime
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:648
nvinfer1::IExecutionContext::setDebugSync
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1836
nvinfer1::ICudaEngine::getEngineCapability
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1692
nvinfer1::apiv::VRefitter
Definition: NvInferImpl.h:213
nvinfer1::TensorLocation
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:242
nvinfer1::IExecutionContext
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1772
nvinfer1::IRefitter::getMissingWeights
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:996
nvinfer1::IExecutionContext::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:1888
nvinfer1::IExprBuilder::operation
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:319
nvinfer1::IExecutionContext::getStrides
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:1949
TRT_DEPRECATED
#define TRT_DEPRECATED
< Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:76
nvinfer1::IRefitter::setWeights
bool setWeights(const char *layerName, WeightsRole role, Weights weights) noexcept
Specify new weights for a layer of given name. Returns true on success, or false if new weights are r...
Definition: NvInferRuntime.h:804
nvinfer1::IExecutionContext::getOptimizationProfile
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:2003
nvinfer1::IRefitter::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:943
nvinfer1::IExprBuilder
Definition: NvInferRuntime.h:308
nvinfer1::ICudaEngine::createExecutionContext
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1422
nvinfer1::IExecutionContext::setBindingDimensions
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2040

  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