TensorRT  8.0.0
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 enum class EngineCapability : int32_t
104 {
108  kDEFAULT = 0,
109 
114  kSAFE_GPU = 1,
115 
120  kSAFE_DLA = 2,
121 };
122 
123 namespace impl
124 {
126 template <>
128 {
129  static constexpr int32_t kVALUE = 3;
130 };
131 } // namespace impl
132 
145 class Weights
146 {
147 public:
149  const void* values;
150  int64_t count;
151 };
152 
163 class IHostMemory : public INoCopy
164 {
165 public:
166  virtual ~IHostMemory() noexcept = default;
167 
169  void* data() const noexcept
170  {
171  return mImpl->data();
172  }
173 
175  std::size_t size() const noexcept
176  {
177  return mImpl->size();
178  }
179 
181  DataType type() const noexcept
182  {
183  return mImpl->type();
184  }
192  TRT_DEPRECATED void destroy() noexcept
193  {
194  delete this;
195  }
196 
197 protected:
198  apiv::VHostMemory* mImpl;
199 };
200 
211 enum class DimensionOperation : int32_t
212 {
213  kSUM = 0,
214  kPROD = 1,
215  kMAX = 2,
216  kMIN = 3,
217  kSUB = 4,
218  kEQUAL = 5,
219  kLESS = 6,
220  kFLOOR_DIV = 7,
221  kCEIL_DIV = 8
222 };
223 
225 template <>
226 constexpr inline int32_t EnumMax<DimensionOperation>() noexcept
227 {
228  return 9;
229 }
230 
235 enum class TensorLocation : int32_t
236 {
237  kDEVICE = 0,
238  kHOST = 1,
239 };
240 
241 namespace impl
242 {
244 template <>
246 {
247  static constexpr int32_t kVALUE = 2;
248 };
249 } // namespace impl
250 
263 class IDimensionExpr : public INoCopy
264 {
265 public:
267  bool isConstant() const noexcept
268  {
269  return mImpl->isConstant();
270  }
271 
274  int32_t getConstantValue() const noexcept
275  {
276  return mImpl->getConstantValue();
277  }
278 
279 protected:
280  apiv::VDimensionExpr* mImpl;
281  virtual ~IDimensionExpr() noexcept = default;
282 };
283 
301 class IExprBuilder : public INoCopy
302 {
303 public:
305  const IDimensionExpr* constant(int32_t value) noexcept
306  {
307  return mImpl->constant(value);
308  }
309 
313  DimensionOperation op, const IDimensionExpr& first, const IDimensionExpr& second) noexcept
314  {
315  return mImpl->operation(op, first, second);
316  }
317 
318 protected:
319  apiv::VExprBuilder* mImpl;
320  virtual ~IExprBuilder() noexcept = default;
321 };
322 
329 {
330 public:
331  int32_t nbDims;
333 };
334 
341 {
344 
347 
350 };
351 
371 {
372 public:
373  IPluginV2DynamicExt* clone() const noexcept override = 0;
374 
399  virtual DimsExprs getOutputDimensions(
400  int32_t outputIndex, const DimsExprs* inputs, int32_t nbInputs, IExprBuilder& exprBuilder) noexcept
401  = 0;
402 
406  static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
407 
440  virtual bool supportsFormatCombination(
441  int32_t pos, const PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept
442  = 0;
443 
482  virtual void configurePlugin(const DynamicPluginTensorDesc* in, int32_t nbInputs,
483  const DynamicPluginTensorDesc* out, int32_t nbOutputs) noexcept
484  = 0;
485 
495  virtual size_t getWorkspaceSize(const PluginTensorDesc* inputs, int32_t nbInputs, const PluginTensorDesc* outputs,
496  int32_t nbOutputs) const noexcept
497  = 0;
498 
511  virtual int32_t enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc,
512  const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) noexcept
513  = 0;
514 
515 protected:
523  int32_t getTensorRTVersion() const noexcept override
524  {
525  return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
526  }
527 
528  virtual ~IPluginV2DynamicExt() noexcept {}
529 
530 private:
531  // Following are obsolete base class methods, and must not be implemented or used.
532 
533  void configurePlugin(Dims const*, int32_t, Dims const*, int32_t, DataType const*, DataType const*, bool const*,
534  bool const*, PluginFormat, int32_t) noexcept override final
535  {
536  }
537 
538  bool supportsFormat(DataType, PluginFormat) const noexcept override final
539  {
540  return false;
541  }
542 
543  Dims getOutputDimensions(int32_t, Dims const*, int32_t) noexcept override final
544  {
545  return Dims{-1, {}};
546  }
547 
548  bool isOutputBroadcastAcrossBatch(int32_t, bool const*, int32_t) const noexcept override final
549  {
550  return false;
551  }
552 
553  bool canBroadcastInputAcrossBatch(int32_t) const noexcept override final
554  {
555  return true;
556  }
557 
558  size_t getWorkspaceSize(int32_t) const noexcept override final
559  {
560  return 0;
561  }
562 
563  int32_t enqueue(int32_t, const void* const*, void* const*, void*, cudaStream_t) noexcept override final
564  {
565  return 1;
566  }
567 };
568 
580 {
581 public:
588  virtual void reportLayerTime(const char* layerName, float ms) noexcept = 0;
589 
590  virtual ~IProfiler() noexcept {}
591 };
592 
599 enum class WeightsRole : int32_t
600 {
601  kKERNEL = 0,
602  kBIAS = 1,
603  kSHIFT = 2,
604  kSCALE = 3,
605  kCONSTANT = 4,
606  kANY = 5,
607 };
608 
610 template <>
611 constexpr inline int32_t EnumMax<WeightsRole>() noexcept
612 {
613  return 5;
614 }
615 
621 enum class DeviceType : int32_t
622 {
623  kGPU,
624  kDLA,
625 };
626 
628 template <>
629 constexpr inline int32_t EnumMax<DeviceType>() noexcept
630 {
631  return 2;
632 }
633 
641 class IRuntime : public INoCopy
642 {
643 public:
644  virtual ~IRuntime() noexcept = default;
645 
662  const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept
663  {
664  return mImpl->deserializeCudaEngine(blob, size, nullptr);
665  }
666 
674  void setDLACore(int32_t dlaCore) noexcept
675  {
676  mImpl->setDLACore(dlaCore);
677  }
678 
685  int32_t getDLACore() const noexcept
686  {
687  return mImpl->getDLACore();
688  }
689 
693  int32_t getNbDLACores() const noexcept
694  {
695  return mImpl->getNbDLACores();
696  }
697 
705  TRT_DEPRECATED void destroy() noexcept
706  {
707  delete this;
708  }
709 
719  void setGpuAllocator(IGpuAllocator* allocator) noexcept
720  {
721  mImpl->setGpuAllocator(allocator);
722  }
723 
735  //
738  void setErrorRecorder(IErrorRecorder* recorder) noexcept
739  {
740  mImpl->setErrorRecorder(recorder);
741  }
742 
754  {
755  return mImpl->getErrorRecorder();
756  }
757 
766  nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
767  {
768  return mImpl->deserializeCudaEngine(blob, size, nullptr);
769  }
770 
771 protected:
772  apiv::VRuntime* mImpl;
773 };
774 
782 class IRefitter : public INoCopy
783 {
784 public:
785  virtual ~IRefitter() noexcept = default;
786 
797  bool setWeights(const char* layerName, WeightsRole role, Weights weights) noexcept
798  {
799  return mImpl->setWeights(layerName, role, weights);
800  }
801 
807  bool refitCudaEngine() noexcept
808  {
809  return mImpl->refitCudaEngine();
810  }
811 
828  int32_t getMissing(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
829  {
830  return mImpl->getMissing(size, layerNames, roles);
831  }
832 
845  int32_t getAll(int32_t size, const char** layerNames, WeightsRole* roles) noexcept
846  {
847  return mImpl->getAll(size, layerNames, roles);
848  }
849 
855  TRT_DEPRECATED void destroy() noexcept
856  {
857  delete this;
858  }
859 
872  bool setDynamicRange(const char* tensorName, float min, float max) noexcept
873  {
874  return mImpl->setDynamicRange(tensorName, min, max);
875  }
876 
884  float getDynamicRangeMin(const char* tensorName) const noexcept
885  {
886  return mImpl->getDynamicRangeMin(tensorName);
887  }
888 
896  float getDynamicRangeMax(const char* tensorName) const noexcept
897  {
898  return mImpl->getDynamicRangeMax(tensorName);
899  }
900 
912  int32_t getTensorsWithDynamicRange(int32_t size, const char** tensorNames) const noexcept
913  {
914  return mImpl->getTensorsWithDynamicRange(size, tensorNames);
915  }
916 
928  //
931  void setErrorRecorder(IErrorRecorder* recorder) noexcept
932  {
933  mImpl->setErrorRecorder(recorder);
934  }
935 
947  {
948  return mImpl->getErrorRecorder();
949  }
950 
964  bool setNamedWeights(const char* name, Weights weights) noexcept
965  {
966  return mImpl->setNamedWeights(name, weights);
967  }
968 
984  int32_t getMissingWeights(int32_t size, const char** weightsNames) noexcept
985  {
986  return mImpl->getMissingWeights(size, weightsNames);
987  }
988 
1000  int32_t getAllWeights(int32_t size, const char** weightsNames) noexcept
1001  {
1002  return mImpl->getAllWeights(size, weightsNames);
1003  }
1004 
1005 protected:
1006  apiv::VRefitter* mImpl;
1007 };
1008 
1019 enum class OptProfileSelector : int32_t
1020 {
1021  kMIN = 0,
1022  kOPT = 1,
1023  kMAX = 2
1024 };
1025 
1027 template <>
1028 constexpr inline int32_t EnumMax<OptProfileSelector>() noexcept
1029 {
1030  return 3;
1031 }
1032 
1056 {
1057 public:
1083  bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept
1084  {
1085  return mImpl->setDimensions(inputName, select, dims);
1086  }
1087 
1093  Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept
1094  {
1095  return mImpl->getDimensions(inputName, select);
1096  }
1097 
1122  const char* inputName, OptProfileSelector select, const int32_t* values, int32_t nbValues) noexcept
1123  {
1124  return mImpl->setShapeValues(inputName, select, values, nbValues);
1125  }
1126 
1133  int32_t getNbShapeValues(const char* inputName) const noexcept
1134  {
1135  return mImpl->getNbShapeValues(inputName);
1136  }
1137 
1143  int32_t const* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept
1144  {
1145  return mImpl->getShapeValues(inputName, select);
1146  }
1147 
1161  bool setExtraMemoryTarget(float target) noexcept
1162  {
1163  return mImpl->setExtraMemoryTarget(target);
1164  }
1165 
1169  float getExtraMemoryTarget() const noexcept
1170  {
1171  return mImpl->getExtraMemoryTarget();
1172  }
1173 
1185  bool isValid() const noexcept
1186  {
1187  return mImpl->isValid();
1188  }
1189 
1190 protected:
1192  virtual ~IOptimizationProfile() noexcept = default;
1193 };
1194 
1202 enum class TacticSource : int32_t
1203 {
1205  kCUBLAS = 0,
1206  kCUBLAS_LT = 1,
1207  kCUDNN = 2
1208 };
1209 
1210 template <>
1211 constexpr inline int32_t EnumMax<TacticSource>() noexcept
1212 {
1213  return 3;
1214 }
1215 
1222 using TacticSources = uint32_t;
1223 
1231 class ICudaEngine : public INoCopy
1232 {
1233 public:
1234  virtual ~ICudaEngine() noexcept = default;
1235 
1246  int32_t getNbBindings() const noexcept
1247  {
1248  return mImpl->getNbBindings();
1249  }
1250 
1268  int32_t getBindingIndex(const char* name) const noexcept
1269  {
1270  return mImpl->getBindingIndex(name);
1271  }
1272 
1288  const char* getBindingName(int32_t bindingIndex) const noexcept
1289  {
1290  return mImpl->getBindingName(bindingIndex);
1291  }
1292 
1301  bool bindingIsInput(int32_t bindingIndex) const noexcept
1302  {
1303  return mImpl->bindingIsInput(bindingIndex);
1304  }
1305 
1326  Dims getBindingDimensions(int32_t bindingIndex) const noexcept
1327  {
1328  return mImpl->getBindingDimensions(bindingIndex);
1329  }
1330 
1339  DataType getBindingDataType(int32_t bindingIndex) const noexcept
1340  {
1341  return mImpl->getBindingDataType(bindingIndex);
1342  }
1343 
1351  int32_t getMaxBatchSize() const noexcept
1352  {
1353  return mImpl->getMaxBatchSize();
1354  }
1355 
1365  int32_t getNbLayers() const noexcept
1366  {
1367  return mImpl->getNbLayers();
1368  }
1369 
1379  IHostMemory* serialize() const noexcept
1380  {
1381  return mImpl->serialize();
1382  }
1383 
1396  {
1397  return mImpl->createExecutionContext();
1398  }
1399 
1407  TRT_DEPRECATED void destroy() noexcept
1408  {
1409  delete this;
1410  }
1411 
1422  TensorLocation getLocation(int32_t bindingIndex) const noexcept
1423  {
1424  return mImpl->getLocation(bindingIndex);
1425  }
1426 
1432  {
1433  return mImpl->createExecutionContextWithoutDeviceMemory();
1434  }
1435 
1441  size_t getDeviceMemorySize() const noexcept
1442  {
1443  return mImpl->getDeviceMemorySize();
1444  }
1445 
1451  bool isRefittable() const noexcept
1452  {
1453  return mImpl->isRefittable();
1454  }
1455 
1465  int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept
1466  {
1467  return mImpl->getBindingBytesPerComponent(bindingIndex);
1468  }
1469 
1479  int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
1480  {
1481  return mImpl->getBindingComponentsPerElement(bindingIndex);
1482  }
1483 
1489  TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
1490  {
1491  return mImpl->getBindingFormat(bindingIndex);
1492  }
1493 
1508  const char* getBindingFormatDesc(int32_t bindingIndex) const noexcept
1509  {
1510  return mImpl->getBindingFormatDesc(bindingIndex);
1511  }
1512 
1520  int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
1521  {
1522  return mImpl->getBindingVectorizedDim(bindingIndex);
1523  }
1524 
1535  const char* getName() const noexcept
1536  {
1537  return mImpl->getName();
1538  }
1539 
1546  int32_t getNbOptimizationProfiles() const noexcept
1547  {
1548  return mImpl->getNbOptimizationProfiles();
1549  }
1550 
1573  Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept
1574  {
1575  return mImpl->getProfileDimensions(bindingIndex, profileIndex, select);
1576  }
1577 
1599  const int32_t* getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const
1600  noexcept
1601  {
1602  return mImpl->getProfileShapeValues(profileIndex, inputIndex, select);
1603  }
1604 
1636  bool isShapeBinding(int32_t bindingIndex) const noexcept
1637  {
1638  return mImpl->isShapeBinding(bindingIndex);
1639  }
1640 
1650  bool isExecutionBinding(int32_t bindingIndex) const noexcept
1651  {
1652  return mImpl->isExecutionBinding(bindingIndex);
1653  }
1654 
1666  {
1667  return mImpl->getEngineCapability();
1668  }
1669 
1680  //
1683  void setErrorRecorder(IErrorRecorder* recorder) noexcept
1684  {
1685  return mImpl->setErrorRecorder(recorder);
1686  }
1687 
1699  {
1700  return mImpl->getErrorRecorder();
1701  }
1702 
1717  bool hasImplicitBatchDimension() const noexcept
1718  {
1719  return mImpl->hasImplicitBatchDimension();
1720  }
1721 
1727  {
1728  return mImpl->getTacticSources();
1729  }
1730 
1731 protected:
1732  apiv::VCudaEngine* mImpl;
1733 };
1734 
1746 {
1747 public:
1748  virtual ~IExecutionContext() noexcept = default;
1749 
1767  bool execute(int32_t batchSize, void* const* bindings) noexcept
1768  {
1769  return mImpl->execute(batchSize, bindings);
1770  }
1771 
1796  bool enqueue(int32_t batchSize, void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1797  {
1798  return mImpl->enqueue(batchSize, bindings, stream, inputConsumed);
1799  }
1800 
1809  void setDebugSync(bool sync) noexcept
1810  {
1811  mImpl->setDebugSync(sync);
1812  }
1813 
1819  bool getDebugSync() const noexcept
1820  {
1821  return mImpl->getDebugSync();
1822  }
1823 
1829  void setProfiler(IProfiler* profiler) noexcept
1830  {
1831  mImpl->setProfiler(profiler);
1832  }
1833 
1839  IProfiler* getProfiler() const noexcept
1840  {
1841  return mImpl->getProfiler();
1842  }
1843 
1849  const ICudaEngine& getEngine() const noexcept
1850  {
1851  return mImpl->getEngine();
1852  }
1853 
1861  TRT_DEPRECATED void destroy() noexcept
1862  {
1863  delete this;
1864  }
1865 
1873  void setName(const char* name) noexcept
1874  {
1875  mImpl->setName(name);
1876  }
1877 
1883  const char* getName() const noexcept
1884  {
1885  return mImpl->getName();
1886  }
1887 
1899 
1901  void setDeviceMemory(void* memory) noexcept
1902  {
1903  mImpl->setDeviceMemory(memory);
1904  }
1905 
1922  Dims getStrides(int32_t bindingIndex) const noexcept
1923  {
1924  return mImpl->getStrides(bindingIndex);
1925  }
1926 
1927 public:
1964  bool setOptimizationProfile(int32_t profileIndex) noexcept
1965  {
1966  return mImpl->setOptimizationProfile(profileIndex);
1967  }
1968 
1976  int32_t getOptimizationProfile() const noexcept
1977  {
1978  return mImpl->getOptimizationProfile();
1979  }
1980 
2006  bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
2007  {
2008  return mImpl->setBindingDimensions(bindingIndex, dimensions);
2009  }
2010 
2036  Dims getBindingDimensions(int32_t bindingIndex) const noexcept
2037  {
2038  return mImpl->getBindingDimensions(bindingIndex);
2039  }
2040 
2060  bool setInputShapeBinding(int32_t bindingIndex, int32_t const* data) noexcept
2061  {
2062  return mImpl->setInputShapeBinding(bindingIndex, data);
2063  }
2064 
2082  bool getShapeBinding(int32_t bindingIndex, int32_t* data) const noexcept
2083  {
2084  return mImpl->getShapeBinding(bindingIndex, data);
2085  }
2086 
2097  bool allInputDimensionsSpecified() const noexcept
2098  {
2099  return mImpl->allInputDimensionsSpecified();
2100  }
2101 
2111  bool allInputShapesSpecified() const noexcept
2112 
2113  {
2114  return mImpl->allInputShapesSpecified();
2115  }
2116 
2128  //
2131  void setErrorRecorder(IErrorRecorder* recorder) noexcept
2132  {
2133  mImpl->setErrorRecorder(recorder);
2134  }
2135 
2147  {
2148  return mImpl->getErrorRecorder();
2149  }
2150 
2163  bool executeV2(void* const* bindings) noexcept
2164  {
2165  return mImpl->executeV2(bindings);
2166  }
2167 
2191  bool enqueueV2(void* const* bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
2192  {
2193  return mImpl->enqueueV2(bindings, stream, inputConsumed);
2194  }
2195 
2239  bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept
2240  {
2241  return mImpl->setOptimizationProfileAsync(profileIndex, stream);
2242  }
2243 
2244 protected:
2245  apiv::VExecutionContext* mImpl;
2246 }; // class IExecutionContext
2247 } // namespace nvinfer1
2248 
2253 extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version) noexcept;
2254 
2259 extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version) noexcept;
2260 
2264 extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry() noexcept;
2265 
2266 namespace nvinfer1
2267 {
2268 namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this
2269  // header.
2270 {
2276 inline IRuntime* createInferRuntime(ILogger& logger) noexcept
2277 {
2278  return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2279 }
2280 
2286 inline IRefitter* createInferRefitter(ICudaEngine& engine, ILogger& logger) noexcept
2287 {
2288  return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2289 }
2290 
2291 } // namespace
2292 
2304 template <typename T>
2306 {
2307 public:
2308  PluginRegistrar()
2309  {
2310  getPluginRegistry()->registerCreator(instance, "");
2311  }
2312 
2313 private:
2315  T instance{};
2316 };
2317 
2318 } // namespace nvinfer1
2319 
2320 #define REGISTER_TENSORRT_PLUGIN(name) \
2321  static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
2322 #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:1133
nvinfer1::IExecutionContext::allInputDimensionsSpecified
bool allInputDimensionsSpecified() const noexcept
Whether all dynamic dimensions of input tensors have been specified.
Definition: NvInferRuntime.h:2097
nvinfer1::IDimensionExpr::getConstantValue
int32_t getConstantValue() const noexcept
Definition: NvInferRuntime.h:274
Dims
Structure to define the dimensions of a tensor.
nvinfer1::DynamicPluginTensorDesc
Definition: NvInferRuntime.h:340
nvinfer1::DeviceType::kGPU
GPU Device.
nvinfer1::IRuntime::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:753
nvinfer1::DimensionOperation
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:211
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:1901
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:2082
nvinfer1::IExecutionContext::setName
void setName(const char *name) noexcept
Set the name of the execution context.
Definition: NvInferRuntime.h:1873
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:523
nvinfer1::Weights
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:145
nvinfer1::ICudaEngine::getDeviceMemorySize
size_t getDeviceMemorySize() const noexcept
Return the amount of device memory required by an execution context.
Definition: NvInferRuntime.h:1441
nvinfer1::PluginRegistrar
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntime.h:2305
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:267
nvinfer1::IHostMemory
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:163
nvinfer1::IHostMemory::data
void * data() const noexcept
A pointer to the raw data that is owned by the library.
Definition: NvInferRuntime.h:169
nvinfer1::IHostMemory::destroy
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:192
nvinfer1::DeviceType
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:621
NvInferImpl.h
nvinfer1::IRefitter::getDynamicRangeMin
float getDynamicRangeMin(const char *tensorName) const noexcept
Get minimum of dynamic range.
Definition: NvInferRuntime.h:884
nvinfer1::IExecutionContext::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:2146
nvinfer1::IRefitter::getDynamicRangeMax
float getDynamicRangeMax(const char *tensorName) const noexcept
Get maximum of dynamic range.
Definition: NvInferRuntime.h:896
nvinfer1::ICudaEngine::serialize
IHostMemory * serialize() const noexcept
Serialize the network to a stream.
Definition: NvInferRuntime.h:1379
nvinfer1::impl::EnumMaxImpl
Declaration of EnumMaxImpl struct to store maximum number of elements in an enumeration type.
Definition: NvInferRuntimeCommon.h:136
nvinfer1::EnumMax< WeightsRole >
constexpr int32_t EnumMax< WeightsRole >() noexcept
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:611
nvinfer1::ICudaEngine::getBindingDimensions
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dimensions of a binding.
Definition: NvInferRuntime.h:1326
nvinfer1::LayerType::kSCALE
Scale layer.
nvinfer1::IRefitter
Updates weights in an engine.
Definition: NvInferRuntime.h:782
nvinfer1::Dims32
Definition: NvInferRuntimeCommon.h:189
nvinfer1::TacticSource
TacticSource
List of tactic sources for TensorRT.
Definition: NvInferRuntime.h:1202
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:1143
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::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:1573
nvinfer1::ICudaEngine::getLocation
TensorLocation getLocation(int32_t bindingIndex) const noexcept
Get location of binding.
Definition: NvInferRuntime.h:1422
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:1599
nvinfer1::ICudaEngine::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object;.
Definition: NvInferRuntime.h:1407
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:1083
nvinfer1::IRefitter::setDynamicRange
bool setDynamicRange(const char *tensorName, float min, float max) noexcept
Definition: NvInferRuntime.h:872
nvinfer1::TensorFormat
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:220
nvinfer1::IRuntime::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:705
nvinfer1::Weights::count
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:150
nvinfer1::IPluginRegistry
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:997
nvinfer1::IExecutionContext::enqueueV2
bool enqueueV2(void *const *bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept
Asynchronously execute inference.
Definition: NvInferRuntime.h:2191
nvinfer1::ILogger
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1175
nvinfer1::apiv::VCudaEngine
Definition: NvInferImpl.h:252
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:1231
nvinfer1::ICudaEngine::getBindingComponentsPerElement
int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept
Return the number of components included in one element.
Definition: NvInferRuntime.h:1479
nvinfer1::IHostMemory::type
DataType type() const noexcept
The type of the memory that was allocated.
Definition: NvInferRuntime.h:181
nvinfer1::IRefitter::refitCudaEngine
bool refitCudaEngine() noexcept
Updates associated engine. Return true if successful.
Definition: NvInferRuntime.h:807
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRuntime
IRuntime * createInferRuntime(ILogger &logger) noexcept
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:2276
nvinfer1::IRuntime::deserializeCudaEngine
nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream.
Definition: NvInferRuntime.h:766
nvinfer1::apiv::VExprBuilder
Definition: NvInferImpl.h:196
nvinfer1::TacticSources
int32_t uint32_t TacticSources
Represents a collection of one or more TacticSource values combine using bitwise-OR operations.
Definition: NvInferImpl.h:158
nvinfer1::IOptimizationProfile::isValid
bool isValid() const noexcept
Check whether the optimization profile can be passed to an IBuilderConfig object.
Definition: NvInferRuntime.h:1185
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:1796
nvinfer1::TacticSource::kCUBLAS
cuBLAS tactics.
nvinfer1::IExecutionContext::getDebugSync
bool getDebugSync() const noexcept
Get the debug sync flag.
Definition: NvInferRuntime.h:1819
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:845
nvinfer1::IExecutionContext::execute
bool execute(int32_t batchSize, void *const *bindings) noexcept
Synchronously execute inference on a batch.
Definition: NvInferRuntime.h:1767
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:661
nvinfer1::ICudaEngine::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:1683
nvinfer1::IHostMemory::size
std::size_t size() const noexcept
The size in bytes of the data that was allocated.
Definition: NvInferRuntime.h:175
nvinfer1::EnumMax< TacticSource >
constexpr int32_t EnumMax< TacticSource >() noexcept
Maximum number of tactic sources in TacticSource enum.
Definition: NvInferRuntime.h:1211
nvinfer1::DimsExprs::nbDims
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:331
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:1650
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:1121
nvinfer1::EnumMax< DeviceType >
constexpr int32_t EnumMax< DeviceType >() noexcept
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:629
nvinfer1::EnumMax< DimensionOperation >
constexpr int32_t EnumMax< DimensionOperation >() noexcept
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:226
nvinfer1::IExecutionContext::executeV2
bool executeV2(void *const *bindings) noexcept
Synchronously execute inference a network.
Definition: NvInferRuntime.h:2163
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:912
nvinfer1::IPluginV2DynamicExt
Definition: NvInferRuntime.h:370
nvinfer1::IRuntime::setGpuAllocator
void setGpuAllocator(IGpuAllocator *allocator) noexcept
Set the GPU allocator.
Definition: NvInferRuntime.h:719
nvinfer1::IRuntime::getNbDLACores
int32_t getNbDLACores() const noexcept
Returns number of DLA hardware cores accessible.
Definition: NvInferRuntime.h:693
nvinfer1::IOptimizationProfile::getExtraMemoryTarget
float getExtraMemoryTarget() const noexcept
Get the extra memory target that has been defined for this profile.
Definition: NvInferRuntime.h:1169
nvinfer1::ICudaEngine::getNbOptimizationProfiles
int32_t getNbOptimizationProfiles() const noexcept
Get the number of optimization profiles defined for this engine.
Definition: NvInferRuntime.h:1546
nvinfer1::TensorLocation::kHOST
Data stored on host.
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:305
nvinfer1::ICudaEngine::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:1698
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:1339
nvinfer1::DynamicPluginTensorDesc::max
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:349
nvinfer1::ElementWiseOperation::kEQUAL
Check if two elements are equal.
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:107
nvinfer1::IExecutionContext::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:2131
nvinfer1::IExecutionContext::setOptimizationProfile
TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept
Select an optimization profile for the current context.
Definition: NvInferRuntime.h:1964
nvinfer1::IExecutionContext::setProfiler
void setProfiler(IProfiler *profiler) noexcept
Set the profiler.
Definition: NvInferRuntime.h:1829
nvinfer1::ICudaEngine::getNbLayers
int32_t getNbLayers() const noexcept
Get the number of layers in the network.
Definition: NvInferRuntime.h:1365
nvinfer1::Weights::type
DataType type
The type of the weights.
Definition: NvInferRuntime.h:148
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:1465
nvinfer1::apiv::VRuntime
Definition: NvInferImpl.h:205
cudaEvent_t
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:110
nvinfer1::DynamicPluginTensorDesc::min
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:346
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:1268
nvinfer1::ICudaEngine::getNbBindings
int32_t getNbBindings() const noexcept
Get the number of binding indices.
Definition: NvInferRuntime.h:1246
nvinfer1::IRuntime::setDLACore
void setDLACore(int32_t dlaCore) noexcept
Set the DLA core that the deserialized engine must execute on.
Definition: NvInferRuntime.h:674
nvinfer1::IExecutionContext::getEngine
const ICudaEngine & getEngine() const noexcept
Get the associated engine.
Definition: NvInferRuntime.h:1849
nvinfer1::IRefitter::getErrorRecorder
IErrorRecorder * getErrorRecorder() const noexcept
Get the ErrorRecorder assigned to this interface.
Definition: NvInferRuntime.h:946
nvinfer1::WeightsRole::kSHIFT
shift part of IScaleLayer
nvinfer1::IOptimizationProfile
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1055
nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory
IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept
create an execution context without any device memory allocated
Definition: NvInferRuntime.h:1431
nvinfer1::ElementWiseOperation::kSUM
Sum of the two elements.
nvinfer1::apiv::VOptimizationProfile
Definition: NvInferImpl.h:237
nvinfer1::DataType
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:150
nvinfer1::ICudaEngine::getTacticSources
TacticSources getTacticSources() const noexcept
return the tactic sources required by this engine
Definition: NvInferRuntime.h:1726
nvinfer1::ICudaEngine::getBindingVectorizedDim
int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept
Return the dimension index that the buffer is vectorized.
Definition: NvInferRuntime.h:1520
nvinfer1::DimsExprs
Definition: NvInferRuntime.h:328
nvinfer1::IPluginRegistry::registerCreator
virtual bool registerCreator(IPluginCreator &creator, AsciiChar const *pluginNamespace) noexcept=0
Register a plugin creator. Returns false if one with same type is already registered.
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:2239
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:343
nvinfer1::apiv::VHostMemory
Definition: NvInferImpl.h:181
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:1535
nvinfer1::ICudaEngine::getBindingFormat
TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept
Return the binding format.
Definition: NvInferRuntime.h:1489
nvinfer1::IErrorRecorder
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1353
nvinfer1::IExecutionContext::getProfiler
IProfiler * getProfiler() const noexcept
Get the profiler.
Definition: NvInferRuntime.h:1839
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:1000
nvinfer1::OptProfileSelector
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:1019
nvinfer1::WeightsRole
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:599
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:1636
nvinfer1::ICudaEngine::getMaxBatchSize
int32_t getMaxBatchSize() const noexcept
Get the maximum batch size which can be used for inference.
Definition: NvInferRuntime.h:1351
nvinfer1::ICudaEngine::getBindingFormatDesc
const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept
Return the human readable description of the tensor format.
Definition: NvInferRuntime.h:1508
nvinfer1::IRuntime::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:738
nvinfer1::IPluginV2Ext
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:599
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:2060
nvinfer1::Dims32::MAX_DIMS
static constexpr int32_t MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:193
nvinfer1::TacticSource::kCUBLAS_LT
cuBLAS LT tactics
nvinfer1::IDimensionExpr
Definition: NvInferRuntime.h:263
nvinfer1::IExecutionContext::getBindingDimensions
Dims getBindingDimensions(int32_t bindingIndex) const noexcept
Get the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2036
nvinfer1::ElementWiseOperation::kPROD
Product of the two elements.
nvinfer1::EngineCapability
EngineCapability
List of supported engine capability flows.
Definition: NvInferRuntime.h:103
nvinfer1::ICudaEngine::hasImplicitBatchDimension
bool hasImplicitBatchDimension() const noexcept
Query whether the engine was built with an implicit batch dimension.
Definition: NvInferRuntime.h:1717
nvinfer1::IProfiler
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:579
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:1301
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:1161
nvinfer1::IExecutionContext::allInputShapesSpecified
bool allInputShapesSpecified() const noexcept
Whether all input shape bindings have been specified.
Definition: NvInferRuntime.h:2111
nvinfer1::PluginTensorDesc
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:368
nvinfer1::IRefitter::destroy
TRT_DEPRECATED void destroy() noexcept
Definition: NvInferRuntime.h:855
nvinfer1::Weights::values
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:149
nvinfer1::apiv::VDimensionExpr
Definition: NvInferImpl.h:189
nvinfer1::PluginFormat
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimeCommon.h:345
nvinfer1::EngineCapability::kSAFE_DLA
nvinfer1::IRuntime::getDLACore
int32_t getDLACore() const noexcept
Get the DLA core that the engine executes on.
Definition: NvInferRuntime.h:685
nvinfer1::apiv::VExecutionContext
Definition: NvInferImpl.h:291
nvinfer1::ICudaEngine::getBindingName
const char * getBindingName(int32_t bindingIndex) const noexcept
Retrieve the name corresponding to a binding index.
Definition: NvInferRuntime.h:1288
nvinfer1::IRefitter::setNamedWeights
bool setNamedWeights(const char *name, Weights weights) noexcept
Specify new weights of given name.
Definition: NvInferRuntime.h:964
nvinfer1::IExecutionContext::getName
const char * getName() const noexcept
Return the name of the execution context.
Definition: NvInferRuntime.h:1883
nvinfer1::TacticSource::kCUDNN
cuDNN tactics
nvinfer1::IGpuAllocator
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1093
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:1093
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRefitter
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger) noexcept
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:2286
nvinfer1::ICudaEngine::isRefittable
bool isRefittable() const noexcept
Return true if an engine can be refit.
Definition: NvInferRuntime.h:1451
nvinfer1::IRefitter::getMissing
int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles) noexcept
Get description of missing weights.
Definition: NvInferRuntime.h:828
nvinfer1::IRuntime
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:641
nvinfer1::IExecutionContext::setDebugSync
void setDebugSync(bool sync) noexcept
Set the debug sync flag.
Definition: NvInferRuntime.h:1809
nvinfer1::ICudaEngine::getEngineCapability
EngineCapability getEngineCapability() const noexcept
Determine what execution capability this engine has.
Definition: NvInferRuntime.h:1665
nvinfer1::apiv::VRefitter
Definition: NvInferImpl.h:219
nvinfer1::TensorLocation
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntime.h:235
nvinfer1::IExecutionContext
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1745
nvinfer1::IRefitter::getMissingWeights
int32_t getMissingWeights(int32_t size, const char **weightsNames) noexcept
Get names of missing weights.
Definition: NvInferRuntime.h:984
nvinfer1::IExecutionContext::destroy
TRT_DEPRECATED void destroy() noexcept
Destroy this object.
Definition: NvInferRuntime.h:1861
nvinfer1::IExprBuilder::operation
const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second) noexcept
Definition: NvInferRuntime.h:312
nvinfer1::IExecutionContext::getStrides
Dims getStrides(int32_t bindingIndex) const noexcept
Return the strides of the buffer for the given binding.
Definition: NvInferRuntime.h:1922
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:797
nvinfer1::IExecutionContext::getOptimizationProfile
int32_t getOptimizationProfile() const noexcept
Get the index of the currently selected optimization profile.
Definition: NvInferRuntime.h:1976
nvinfer1::IRefitter::setErrorRecorder
void setErrorRecorder(IErrorRecorder *recorder) noexcept
Set the ErrorRecorder for this interface.
Definition: NvInferRuntime.h:931
nvinfer1::IExprBuilder
Definition: NvInferRuntime.h:301
nvinfer1::EngineCapability::kSAFE_GPU
nvinfer1::ICudaEngine::createExecutionContext
IExecutionContext * createExecutionContext() noexcept
Create an execution context.
Definition: NvInferRuntime.h:1395
nvinfer1::IExecutionContext::setBindingDimensions
bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept
Set the dynamic dimensions of a binding.
Definition: NvInferRuntime.h:2006