TensorRT  7.2.1.6
NvInferRuntime.h
Go to the documentation of this file.
1 /*
2  * Copyright 1993-2020 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 "NvInferRuntimeCommon.h"
60 
61 namespace nvinfer1
62 {
63 
64 class IExecutionContext;
65 class ICudaEngine;
66 class IPluginFactory;
67 
82 enum class EngineCapability : int32_t
83 {
84  kDEFAULT = 0,
85  kSAFE_GPU = 1,
86  kSAFE_DLA = 2,
88 };
90 
92 template <>
93 constexpr inline int32_t EnumMax<EngineCapability>()
94 {
95  return 3;
96 }
97 
110 class Weights
111 {
112 public:
114  const void* values;
115  int64_t count;
116 };
117 
129 {
130 public:
131  virtual void* data() const noexcept = 0;
132  virtual std::size_t size() const noexcept = 0;
133  virtual DataType type() const noexcept = 0;
134  virtual void destroy() noexcept = 0;
135 protected:
136  virtual ~IHostMemory() {}
137 };
138 
146 class IPlugin
147 {
148 public:
157  virtual int32_t getNbOutputs() const TRTNOEXCEPT = 0;
158 
169  virtual Dims getOutputDimensions(int32_t index, const Dims* inputs, int32_t nbInputDims) TRTNOEXCEPT = 0;
170 
189  virtual void configure(const Dims* inputDims, int32_t nbInputs, const Dims* outputDims, int32_t nbOutputs,
190  int32_t maxBatchSize) TRTNOEXCEPT = 0;
191 
197  virtual int32_t initialize() TRTNOEXCEPT = 0;
198 
203  virtual void terminate() TRTNOEXCEPT = 0;
204 
213  virtual size_t getWorkspaceSize(int32_t maxBatchSize) const TRTNOEXCEPT = 0;
214 
226  virtual int32_t enqueue(int32_t batchSize, const void* const* inputs, void** outputs, void* workspace,
227  cudaStream_t stream) TRTNOEXCEPT = 0;
228 
234  virtual size_t getSerializationSize() TRTNOEXCEPT = 0;
235 
243  virtual void serialize(void* buffer) TRTNOEXCEPT = 0;
244 
245  virtual ~IPlugin() {}
246 };
247 
256 class IPluginExt : public IPlugin
257 {
258 public:
265  virtual int32_t getTensorRTVersion() const TRTNOEXCEPT
266  {
267  return NV_TENSORRT_VERSION;
268  }
269 
282  virtual bool supportsFormat(DataType type, PluginFormat format) const TRTNOEXCEPT = 0;
283 
303  virtual void configureWithFormat(const Dims* inputDims, int32_t nbInputs, const Dims* outputDims, int32_t nbOutputs,
304  DataType type, PluginFormat format, int32_t maxBatchSize) TRTNOEXCEPT = 0;
305 
306  virtual ~IPluginExt() {}
307 
308 protected:
312  void configure(const Dims* /*inputDims*/, int32_t /*nbInputs*/, const Dims* /*outputDims*/, int32_t /*nbOutputs*/,
313  int32_t /*maxBatchSize*/) _TENSORRT_FINAL TRTNOEXCEPT
314  {
315  }
316 };
317 
328 enum class DimensionOperation : int32_t
329 {
330  kSUM = 0,
331  kPROD = 1,
332  kMAX = 2,
333  kMIN = 3,
334  kSUB = 4,
335  kEQUAL = 5,
336  kLESS = 6,
337  kFLOOR_DIV = 7,
338  kCEIL_DIV = 8
339 };
340 
342 template <>
343 constexpr inline int32_t EnumMax<DimensionOperation>()
344 {
345  return 9;
346 }
347 
359 {
360 public:
362  virtual bool isConstant() const = 0;
363 
366  virtual int32_t getConstantValue() const = 0;
367 
368 protected:
369  virtual ~IDimensionExpr() {}
370 };
371 
390 {
391 public:
393  virtual const IDimensionExpr* constant(int32_t value) = 0;
394 
397  virtual const IDimensionExpr* operation(DimensionOperation op, const IDimensionExpr& first, const IDimensionExpr& second) = 0;
398 
399 protected:
400  virtual ~IExprBuilder() {}
401 };
402 
409 {
410 public:
411  int32_t nbDims;
413 };
414 
421 {
424 
427 
430 };
431 
451 {
452 public:
454 
480  int32_t outputIndex, const DimsExprs* inputs, int32_t nbInputs, IExprBuilder& exprBuilder)
481  = 0;
482 
486  static constexpr int32_t kFORMAT_COMBINATION_LIMIT = 100;
487 
520  virtual bool supportsFormatCombination(
521  int32_t pos, const PluginTensorDesc* inOut, int32_t nbInputs, int32_t nbOutputs) TRTNOEXCEPT = 0;
522 
536  virtual void configurePlugin(const DynamicPluginTensorDesc* in, int32_t nbInputs,
537  const DynamicPluginTensorDesc* out, int32_t nbOutputs) TRTNOEXCEPT = 0;
538 
548  virtual size_t getWorkspaceSize(const PluginTensorDesc* inputs, int32_t nbInputs, const PluginTensorDesc* outputs,
549  int32_t nbOutputs) const TRTNOEXCEPT = 0;
550 
563  virtual int32_t enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc,
564  const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) TRTNOEXCEPT = 0;
565 
566 protected:
568  {
569  return (static_cast<int32_t>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
570  }
571 
572  virtual ~IPluginV2DynamicExt() {}
573 
574  // Rest of the methods below are obsolete inherited methods, and marked final when using a C++11 compiler.
575  // Derived classes should not override them.
576 
584  TRT_DEPRECATED
586  int32_t /*index*/, const Dims* /*inputs*/, int32_t /*nbInputDims*/) _TENSORRT_FINAL TRTNOEXCEPT
587  {
588  return Dims{-1, {}, {}};
589  }
590 
598  TRT_DEPRECATED
599  bool isOutputBroadcastAcrossBatch(int32_t /*outputIndex*/, const bool* /*inputIsBroadcasted*/,
600  int32_t /*nbInputs*/) const _TENSORRT_FINAL TRTNOEXCEPT
601  {
602  return false;
603  }
604 
612  TRT_DEPRECATED
613  bool canBroadcastInputAcrossBatch(int32_t /*inputIndex*/) const _TENSORRT_FINAL TRTNOEXCEPT
614  {
615  return true;
616  }
617 
628  TRT_DEPRECATED
629  bool supportsFormat(DataType /*type*/, PluginFormat /*format*/) const _TENSORRT_FINAL TRTNOEXCEPT
630  {
631  return false;
632  }
633 
645  TRT_DEPRECATED
646  void configurePlugin(const Dims* /*inputDims*/, int32_t /*nbInputs*/, const Dims* /*outputDims*/,
647  int32_t /*nbOutputs*/, const DataType* /*inputTypes*/, const DataType* /*outputTypes*/,
648  const bool* /*inputIsBroadcast*/, const bool* /*outputIsBroadcast*/, PluginFormat /*floatFormat*/,
649  int32_t /*maxBatchSize*/) _TENSORRT_FINAL TRTNOEXCEPT
650  {
651  }
652 
664  TRT_DEPRECATED
665  size_t getWorkspaceSize(int32_t /*maxBatchSize*/) const _TENSORRT_FINAL TRTNOEXCEPT
666  {
667  return 0;
668  }
669 
680  TRT_DEPRECATED
681  int32_t enqueue(int32_t /*batchSize*/, const void* const* /*inputs*/, void** /*outputs*/, void* /*workspace*/,
682  cudaStream_t /*stream*/) _TENSORRT_FINAL TRTNOEXCEPT
683  {
684  return 1;
685  }
686 };
687 
699 {
700 public:
707  virtual void reportLayerTime(const char* layerName, float ms) TRTNOEXCEPT = 0;
708 
709  virtual ~IProfiler() {}
710 };
711 
718 enum class WeightsRole : int32_t
719 {
720  kKERNEL = 0,
721  kBIAS = 1,
722  kSHIFT = 2,
723  kSCALE = 3,
724  kCONSTANT = 4,
725 };
726 
728 template <>
729 constexpr inline int32_t EnumMax<WeightsRole>()
730 {
731  return 5;
732 }
733 
739 enum class DeviceType : int32_t
740 {
741  kGPU,
742  kDLA,
743 };
744 
746 template <>
747 constexpr inline int32_t EnumMax<DeviceType>()
748 {
749  return 2;
750 }
751 
759 class IRuntime
760 {
761 public:
771  virtual nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept = 0;
772 
780  virtual void setDLACore(int32_t dlaCore) noexcept = 0;
781 
788  virtual int32_t getDLACore() const noexcept = 0;
789 
793  virtual int32_t getNbDLACores() const noexcept = 0;
794 
798  virtual void destroy() noexcept = 0;
799 
800 protected:
801  virtual ~IRuntime() {}
802 
803 public:
812  virtual void setGpuAllocator(IGpuAllocator* allocator) noexcept = 0;
813 
823  //
826  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
827 
838  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
839 
848  nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
849  {
850  return deserializeCudaEngine(blob, size, nullptr);
851  }
852 };
853 
862 {
863 public:
874  virtual bool setWeights(const char* layerName, WeightsRole role, Weights weights) TRTNOEXCEPT = 0;
875 
881  virtual bool refitCudaEngine() TRTNOEXCEPT = 0;
882 
899  virtual int32_t getMissing(int32_t size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
900 
913  virtual int32_t getAll(int32_t size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
914 
915  virtual void destroy() TRTNOEXCEPT = 0;
916 
917 protected:
918  virtual ~IRefitter() {}
919 
920 public:
933  virtual bool setDynamicRange(const char* tensorName, float min, float max) TRTNOEXCEPT = 0;
934 
942  virtual float getDynamicRangeMin(const char* tensorName) const TRTNOEXCEPT = 0;
943 
951  virtual float getDynamicRangeMax(const char* tensorName) const TRTNOEXCEPT = 0;
952 
964  virtual int32_t getTensorsWithDynamicRange(int32_t size, const char** tensorNames) const TRTNOEXCEPT = 0;
965 
975  //
978  virtual void setErrorRecorder(IErrorRecorder* recorder) TRTNOEXCEPT = 0;
979 
990  virtual IErrorRecorder* getErrorRecorder() const TRTNOEXCEPT = 0;
991 };
992 
1000 {
1001 public:
1016  virtual IPlugin* createPlugin(const char* layerName, const void* serialData, size_t serialLength) TRTNOEXCEPT = 0;
1017 
1018  virtual ~IPluginFactory() {}
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>()
1041 {
1042  return 3;
1043 }
1044 
1068 {
1069 public:
1095  virtual bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept = 0;
1096 
1102  virtual Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept = 0;
1103 
1127  virtual bool setShapeValues(
1128  const char* inputName, OptProfileSelector select, const int32_t* values, int32_t nbValues) noexcept
1129  = 0;
1130 
1137  virtual int32_t getNbShapeValues(const char* inputName) const noexcept = 0;
1138 
1144  virtual const int32_t* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept = 0;
1145 
1159  virtual bool setExtraMemoryTarget(float target) noexcept = 0;
1160 
1164  virtual float getExtraMemoryTarget() const noexcept = 0;
1165 
1177  virtual bool isValid() const noexcept = 0;
1178 
1179 protected:
1180  ~IOptimizationProfile() noexcept = default;
1181 };
1182 
1191 {
1192 public:
1203  virtual int32_t getNbBindings() const noexcept = 0;
1204 
1222  virtual int32_t getBindingIndex(const char* name) const noexcept = 0;
1223 
1239  virtual const char* getBindingName(int32_t bindingIndex) const noexcept = 0;
1240 
1249  virtual bool bindingIsInput(int32_t bindingIndex) const noexcept = 0;
1250 
1271  virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept = 0;
1272 
1281  virtual DataType getBindingDataType(int32_t bindingIndex) const noexcept = 0;
1282 
1290  virtual int32_t getMaxBatchSize() const noexcept = 0;
1291 
1301  virtual int32_t getNbLayers() const noexcept = 0;
1302 
1314  TRT_DEPRECATED
1315  virtual std::size_t getWorkspaceSize() const noexcept = 0;
1316 
1326  virtual IHostMemory* serialize() const noexcept = 0;
1327 
1338  virtual IExecutionContext* createExecutionContext() noexcept = 0;
1339 
1343  virtual void destroy() noexcept = 0;
1344 
1355  virtual TensorLocation getLocation(int32_t bindingIndex) const noexcept = 0;
1356 
1357 protected:
1358  virtual ~ICudaEngine() {}
1359 
1360 public:
1368 
1374  virtual size_t getDeviceMemorySize() const noexcept = 0;
1375 
1381  virtual bool isRefittable() const noexcept = 0;
1382 
1392  virtual int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept = 0;
1393 
1403  virtual int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept = 0;
1404 
1410  virtual TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept = 0;
1411 
1426  virtual const char* getBindingFormatDesc(int32_t bindingIndex) const noexcept = 0;
1427 
1435  virtual int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept = 0;
1436 
1447  virtual const char* getName() const noexcept = 0;
1448 
1455  virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
1456 
1479  virtual Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const
1480  noexcept
1481  = 0;
1482 
1504  virtual const int32_t* getProfileShapeValues(
1505  int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const noexcept
1506  = 0;
1507 
1539  virtual bool isShapeBinding(int32_t bindingIndex) const noexcept = 0;
1540 
1550  virtual bool isExecutionBinding(int32_t bindingIndex) const noexcept = 0;
1551 
1562  virtual EngineCapability getEngineCapability() const noexcept = 0;
1563 
1572  //
1575  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1576 
1587  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1588 
1603  virtual bool hasImplicitBatchDimension() const TRTNOEXCEPT = 0;
1604 };
1605 
1617 {
1618 public:
1630  virtual bool execute(int32_t batchSize, void** bindings) noexcept = 0;
1631 
1646  virtual bool enqueue(int32_t batchSize, void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1647  = 0;
1648 
1657  virtual void setDebugSync(bool sync) noexcept = 0;
1658 
1664  virtual bool getDebugSync() const noexcept = 0;
1665 
1671  virtual void setProfiler(IProfiler*) noexcept = 0;
1672 
1678  virtual IProfiler* getProfiler() const noexcept = 0;
1679 
1685  virtual const ICudaEngine& getEngine() const noexcept = 0;
1686 
1690  virtual void destroy() noexcept = 0;
1691 
1692 protected:
1693  virtual ~IExecutionContext() noexcept {}
1694 
1695 public:
1703  virtual void setName(const char* name) noexcept = 0;
1704 
1710  virtual const char* getName() const noexcept = 0;
1711 
1723  virtual void setDeviceMemory(void* memory) noexcept = 0;
1724 
1741  virtual Dims getStrides(int32_t bindingIndex) const noexcept = 0;
1742 
1743 public:
1776  TRT_DEPRECATED
1777  virtual bool setOptimizationProfile(int32_t profileIndex) noexcept = 0;
1778 
1786  virtual int32_t getOptimizationProfile() const noexcept = 0;
1787 
1809  virtual bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept = 0;
1810 
1836  virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept = 0;
1837 
1853  virtual bool setInputShapeBinding(int32_t bindingIndex, const int32_t* data) noexcept = 0;
1854 
1872  virtual bool getShapeBinding(int32_t bindingIndex, int32_t* data) const noexcept = 0;
1873 
1884  virtual bool allInputDimensionsSpecified() const noexcept = 0;
1885 
1895  virtual bool allInputShapesSpecified() const noexcept = 0;
1896 
1906  //
1909  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1910 
1921  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1922 
1935  virtual bool executeV2(void** bindings) noexcept = 0;
1936 
1956  virtual bool enqueueV2(void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept = 0;
1957 
1998  virtual bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept = 0;
1999 }; // class IExecutionContext
2000 } // namespace nvinfer1
2001 
2006 extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version);
2007 
2012 extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version);
2013 
2014 namespace nvinfer1
2015 {
2016 namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this header.
2017 {
2024 {
2025  return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2026 }
2027 
2034 {
2035  return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2036 }
2037 }
2038 }
2039 
2040 #endif // NV_INFER_RUNTIME_H
nvinfer1::IPluginFactory::createPlugin
virtual IPlugin * createPlugin(const char *layerName, const void *serialData, size_t serialLength)=0
Create a plugin from serialized data.
nvinfer1::IExecutionContext::getProfiler
virtual IProfiler * getProfiler() const noexcept=0
Get the profiler.
nvinfer1::IRefitter::getDynamicRangeMin
virtual float getDynamicRangeMin(const char *tensorName) const =0
Get minimum of dynamic range.
nvinfer1::IExecutionContext::getDebugSync
virtual bool getDebugSync() const noexcept=0
Get the debug sync flag.
nvinfer1::IProfiler::reportLayerTime
virtual void reportLayerTime(const char *layerName, float ms)=0
Layer time reporting callback.
nvinfer1::IRefitter::getTensorsWithDynamicRange
virtual int32_t getTensorsWithDynamicRange(int32_t size, const char **tensorNames) const =0
Get names of all tensors that have refittable dynamic ranges.
nvinfer1::IExecutionContext::destroy
virtual void destroy() noexcept=0
Destroy this object.
nvinfer1::IExecutionContext::getEngine
virtual const ICudaEngine & getEngine() const noexcept=0
Get the associated engine.
nvinfer1::DynamicPluginTensorDesc
Definition: NvInferRuntime.h:420
nvinfer1::DeviceType::kGPU
GPU Device.
nvinfer1::IRefitter::setWeights
virtual bool setWeights(const char *layerName, WeightsRole role, Weights weights)=0
Specify new weights for a layer of given name. Returns true on success, or false if new weights are r...
nvinfer1::DimensionOperation
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:328
nvinfer1::IPluginExt::configureWithFormat
virtual void configureWithFormat(const Dims *inputDims, int32_t nbInputs, const Dims *outputDims, int32_t nbOutputs, DataType type, PluginFormat format, int32_t maxBatchSize)=0
Configure the layer.
nvinfer1::ElementWiseOperation::kMIN
Minimum of the two elements.
nvinfer1::IHostMemory::destroy
virtual void destroy() noexcept=0
Destroy the allocated memory.
nvinfer1::DimsExprs::d
const IDimensionExpr * d[Dims::MAX_DIMS]
The extent of each dimension.
Definition: NvInferRuntime.h:412
nvinfer1::ICudaEngine::getNbOptimizationProfiles
virtual int32_t getNbOptimizationProfiles() const noexcept=0
Get the number of optimization profiles defined for this engine.
nvinfer1::IExecutionContext::setInputShapeBinding
virtual bool setInputShapeBinding(int32_t bindingIndex, const int32_t *data) noexcept=0
Set values of input tensor required by shape calculations.
nvinfer1::IHostMemory::size
virtual std::size_t size() const noexcept=0
The size in bytes of the data that was allocated.
nvinfer1::Weights
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:110
nvinfer1::IRuntime::setDLACore
virtual void setDLACore(int32_t dlaCore) noexcept=0
Set the DLA core that the deserialized engine must execute on.
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRefitter
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger)
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:2033
nvinfer1::IHostMemory
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:128
nvinfer1::ICudaEngine::getBindingName
virtual const char * getBindingName(int32_t bindingIndex) const noexcept=0
Retrieve the name corresponding to a binding index.
nvinfer1::DeviceType
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:739
nvinfer1::IRefitter::refitCudaEngine
virtual bool refitCudaEngine()=0
Updates associated engine. Return true if successful.
nvinfer1::IPluginV2DynamicExt::kFORMAT_COMBINATION_LIMIT
static constexpr int32_t kFORMAT_COMBINATION_LIMIT
Definition: NvInferRuntime.h:486
nvinfer1::IExecutionContext::getStrides
virtual Dims getStrides(int32_t bindingIndex) const noexcept=0
Return the strides of the buffer for the given binding.
nvinfer1::IHostMemory::type
virtual DataType type() const noexcept=0
The type of the memory that was allocated.
nvinfer1::LayerType::kSCALE
Scale layer.
nvinfer1::IRefitter
Updates weights in an engine.
Definition: NvInferRuntime.h:861
nvinfer1::IPlugin::enqueue
virtual int32_t enqueue(int32_t batchSize, const void *const *inputs, void **outputs, void *workspace, cudaStream_t stream)=0
Execute the layer.
nvinfer1::IExecutionContext::setDeviceMemory
virtual void setDeviceMemory(void *memory) noexcept=0
Set the device memory for use by this execution context.
nvinfer1::ICudaEngine::setErrorRecorder
virtual void setErrorRecorder(IErrorRecorder *recorder) noexcept=0
Set the ErrorRecorder for this interface.
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::IRefitter::getErrorRecorder
virtual IErrorRecorder * getErrorRecorder() const =0
get the ErrorRecorder assigned to this interface.
nvinfer1::PluginVersion::kV2_DYNAMICEXT
IPluginV2IOExt.
nvinfer1::ICudaEngine::getBindingFormatDesc
virtual const char * getBindingFormatDesc(int32_t bindingIndex) const noexcept=0
Return the human readable description of the tensor format.
nvinfer1::IPluginV2DynamicExt::supportsFormatCombination
virtual bool supportsFormatCombination(int32_t pos, const PluginTensorDesc *inOut, int32_t nbInputs, int32_t nbOutputs)=0
Return true if plugin supports the format and datatype for the input/output indexed by pos.
nvinfer1::IRuntime::setErrorRecorder
virtual void setErrorRecorder(IErrorRecorder *recorder) noexcept=0
Set the ErrorRecorder for this interface.
nvinfer1::ICudaEngine::getProfileDimensions
virtual Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const noexcept=0
Get the minimum / optimum / maximum dimensions for a particular binding under an optimization profile...
nvinfer1::IPlugin::serialize
virtual void serialize(void *buffer)=0
Serialize the layer.
nvinfer1::TensorFormat
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:258
nvinfer1::ICudaEngine::hasImplicitBatchDimension
virtual bool hasImplicitBatchDimension() const =0
Query whether the engine was built with an implicit batch dimension.
nvinfer1::Weights::count
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:115
nvinfer1::ICudaEngine::getBindingVectorizedDim
virtual int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept=0
Return the dimension index that the buffer is vectorized.
nvinfer1::Dims
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:227
nvinfer1::IExecutionContext::getErrorRecorder
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
get the ErrorRecorder assigned to this interface.
nvinfer1::IRuntime::destroy
virtual void destroy() noexcept=0
Destroy this object.
nvinfer1::IPluginV2DynamicExt::getWorkspaceSize
virtual size_t getWorkspaceSize(const PluginTensorDesc *inputs, int32_t nbInputs, const PluginTensorDesc *outputs, int32_t nbOutputs) const =0
Find the workspace size required by the layer.
nvinfer1::IPluginFactory
Plugin factory for deserialization.
Definition: NvInferRuntime.h:999
nvinfer1::ILogger
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1078
nvinfer1::EnumMax< DeviceType >
constexpr int32_t EnumMax< DeviceType >()
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:747
nvinfer1::EnumMax< EngineCapability >
constexpr int32_t EnumMax< EngineCapability >()
Maximum number of elements in EngineCapability enum.
Definition: NvInferRuntime.h:93
nvinfer1::IRuntime::setGpuAllocator
virtual void setGpuAllocator(IGpuAllocator *allocator) noexcept=0
Set the GPU allocator.
nvinfer1::DimensionOperation::kCEIL_DIV
Division rounding up.
nvinfer1::IPluginV2DynamicExt::canBroadcastInputAcrossBatch
TRT_DEPRECATED bool canBroadcastInputAcrossBatch(int32_t) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:613
nvinfer1::ICudaEngine
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1190
nvinfer1::IExecutionContext::allInputShapesSpecified
virtual bool allInputShapesSpecified() const noexcept=0
Whether all input shape bindings have been specified.
nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory
virtual IExecutionContext * createExecutionContextWithoutDeviceMemory() noexcept=0
create an execution context without any device memory allocated
nvinfer1::ICudaEngine::destroy
virtual void destroy() noexcept=0
Destroy this object;.
TRTNOEXCEPT
#define TRTNOEXCEPT
Definition: NvInferRuntimeCommon.h:103
nvinfer1::IRuntime::deserializeCudaEngine
nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size) noexcept
Deserialize an engine from a stream when plugin factory is not used.
Definition: NvInferRuntime.h:848
nvinfer1::IOptimizationProfile::getDimensions
virtual Dims getDimensions(const char *inputName, OptProfileSelector select) const noexcept=0
Get the minimum / optimum / maximum dimensions for a dynamic input tensor.
nvinfer1::IExecutionContext::setOptimizationProfile
virtual TRT_DEPRECATED bool setOptimizationProfile(int32_t profileIndex) noexcept=0
Select an optimization profile for the current context.
nvinfer1::IExprBuilder::operation
virtual const IDimensionExpr * operation(DimensionOperation op, const IDimensionExpr &first, const IDimensionExpr &second)=0
nvinfer1::IPlugin::getWorkspaceSize
virtual size_t getWorkspaceSize(int32_t maxBatchSize) const =0
Find the workspace size required by the layer.
nvinfer1::ICudaEngine::getErrorRecorder
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
get the ErrorRecorder assigned to this interface.
nvinfer1::IRefitter::setErrorRecorder
virtual void setErrorRecorder(IErrorRecorder *recorder)=0
Set the ErrorRecorder for this interface.
nvinfer1::IPluginV2DynamicExt::configurePlugin
TRT_DEPRECATED void configurePlugin(const Dims *, int32_t, const Dims *, int32_t, const DataType *, const DataType *, const bool *, const bool *, PluginFormat, int32_t) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:646
nvinfer1::DimsExprs::nbDims
int32_t nbDims
The number of dimensions.
Definition: NvInferRuntime.h:411
nvinfer1::IExecutionContext::setDebugSync
virtual void setDebugSync(bool sync) noexcept=0
Set the debug sync flag.
nvinfer1::IExecutionContext::getName
virtual const char * getName() const noexcept=0
Return the name of the execution context.
nvinfer1
The TensorRT API version 1 namespace.
nvinfer1::IRefitter::getMissing
virtual int32_t getMissing(int32_t size, const char **layerNames, WeightsRole *roles)=0
Get description of missing weights.
nvinfer1::IExecutionContext::getBindingDimensions
virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept=0
Get the dynamic dimensions of a binding.
nvinfer1::IPluginV2DynamicExt
Definition: NvInferRuntime.h:450
nvinfer1::IPlugin::configure
virtual void configure(const Dims *inputDims, int32_t nbInputs, const Dims *outputDims, int32_t nbOutputs, int32_t maxBatchSize)=0
Configure the layer.
nvinfer1::IPluginV2DynamicExt::getTensorRTVersion
int32_t getTensorRTVersion() const _TENSORRT_OVERRIDE
Return the API version with which this plugin was built.
Definition: NvInferRuntime.h:567
nvinfer1::IPluginV2DynamicExt::clone
IPluginV2DynamicExt * clone() const _TENSORRT_OVERRIDE=0
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin...
nvinfer1::OptProfileSelector::kOPT
This is used to set or get the value that is used in the optimization (kernel selection).
nvinfer1::ICudaEngine::getNbLayers
virtual int32_t getNbLayers() const noexcept=0
Get the number of layers in the network.
nvinfer1::IOptimizationProfile::getExtraMemoryTarget
virtual float getExtraMemoryTarget() const noexcept=0
Get the extra memory target that has been defined for this profile.
nvinfer1::IOptimizationProfile::getShapeValues
virtual const int32_t * getShapeValues(const char *inputName, OptProfileSelector select) const noexcept=0
Get the minimum / optimum / maximum values for an input shape tensor.
nvinfer1::DynamicPluginTensorDesc::max
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:429
nvinfer1::IPluginV2DynamicExt::isOutputBroadcastAcrossBatch
TRT_DEPRECATED bool isOutputBroadcastAcrossBatch(int32_t, const bool *, int32_t) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:599
nvinfer1::ElementWiseOperation::kEQUAL
Check if two elements are equal.
nvinfer1::IRefitter::getDynamicRangeMax
virtual float getDynamicRangeMax(const char *tensorName) const =0
Get maximum of dynamic range.
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:115
nvinfer1::IRuntime::getErrorRecorder
virtual IErrorRecorder * getErrorRecorder() const noexcept=0
get the ErrorRecorder assigned to this interface.
nvinfer1::IPluginV2DynamicExt::configurePlugin
virtual void configurePlugin(const DynamicPluginTensorDesc *in, int32_t nbInputs, const DynamicPluginTensorDesc *out, int32_t nbOutputs)=0
Configure the layer.
nvinfer1::IPluginV2DynamicExt::getWorkspaceSize
TRT_DEPRECATED size_t getWorkspaceSize(int32_t) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:665
nvinfer1::ICudaEngine::getBindingFormat
virtual TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept=0
Return the binding format.
nvinfer1::IExecutionContext::executeV2
virtual bool executeV2(void **bindings) noexcept=0
Synchronously execute inference a network.
nvinfer1::IPluginExt::supportsFormat
virtual bool supportsFormat(DataType type, PluginFormat format) const =0
Check format support.
nvinfer1::Weights::type
DataType type
The type of the weights.
Definition: NvInferRuntime.h:113
nvinfer1::WeightsRole::kBIAS
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
nvinfer1::IExecutionContext::execute
virtual bool execute(int32_t batchSize, void **bindings) noexcept=0
Synchronously execute inference on a batch.
_TENSORRT_OVERRIDE
#define _TENSORRT_OVERRIDE
Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:62
cudaEvent_t
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:116
nvinfer1::DynamicPluginTensorDesc::min
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:426
nvinfer1::IPluginExt::configure
void configure(const Dims *, int32_t, const Dims *, int32_t, int32_t) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:312
nvinfer1::ICudaEngine::getBindingDimensions
virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept=0
Get the dimensions of a binding.
nvinfer1::IPluginV2DynamicExt::supportsFormat
TRT_DEPRECATED bool supportsFormat(DataType, PluginFormat) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:629
nvinfer1::ICudaEngine::getLocation
virtual TensorLocation getLocation(int32_t bindingIndex) const noexcept=0
Get location of binding.
nvinfer1::IRuntime::deserializeCudaEngine
virtual nvinfer1::ICudaEngine * deserializeCudaEngine(const void *blob, std::size_t size, IPluginFactory *pluginFactory) noexcept=0
Deserialize an engine from a stream.
nvinfer1::IRuntime::getNbDLACores
virtual int32_t getNbDLACores() const noexcept=0
Returns number of DLA hardware cores accessible.
nvinfer1::WeightsRole::kSHIFT
shift part of IScaleLayer
nvinfer1::IPluginExt
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:256
nvinfer1::ICudaEngine::bindingIsInput
virtual bool bindingIsInput(int32_t bindingIndex) const noexcept=0
Determine whether a binding is an input binding.
nvinfer1::IOptimizationProfile
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:1067
nvinfer1::ElementWiseOperation::kSUM
Sum of the two elements.
nvinfer1::DataType
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:169
nvinfer1::ICudaEngine::getBindingIndex
virtual int32_t getBindingIndex(const char *name) const noexcept=0
Retrieve the binding index for a named tensor.
nvinfer1::IPlugin::initialize
virtual int32_t initialize()=0
Initialize the layer for execution. This is called when the engine is created.
nvinfer1::IOptimizationProfile::isValid
virtual bool isValid() const noexcept=0
Check whether the optimization profile can be passed to an IBuilderConfig object.
nvinfer1::IRefitter::getAll
virtual int32_t getAll(int32_t size, const char **layerNames, WeightsRole *roles)=0
Get description of all weights that could be refit.
nvinfer1::DimsExprs
Definition: NvInferRuntime.h:408
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:423
nvinfer1::Dims::MAX_DIMS
static const int32_t MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:230
nvinfer1::ICudaEngine::getBindingDataType
virtual DataType getBindingDataType(int32_t bindingIndex) const noexcept=0
Determine the required data type for a buffer from its binding index.
nvinfer1::ElementWiseOperation::kSUB
Substract the second element from the first.
NvInferRuntimeCommon.h
nvinfer1::LayerType::kCONSTANT
Constant layer.
nvinfer1::IExecutionContext::allInputDimensionsSpecified
virtual bool allInputDimensionsSpecified() const noexcept=0
Whether all dynamic dimensions of input tensors have been specified.
nvinfer1::IDimensionExpr::isConstant
virtual bool isConstant() const =0
Return true if expression is a build-time constant.
nvinfer1::IErrorRecorder
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1235
nvinfer1::IPlugin::getNbOutputs
virtual int32_t getNbOutputs() const =0
Get the number of outputs from the layer.
nvinfer1::IPluginExt::getTensorRTVersion
virtual int32_t getTensorRTVersion() const
Return the API version with which this plugin was built.
Definition: NvInferRuntime.h:265
nvinfer1::IRefitter::setDynamicRange
virtual bool setDynamicRange(const char *tensorName, float min, float max)=0
nvinfer1::IPluginV2DynamicExt::enqueue
virtual int32_t enqueue(const PluginTensorDesc *inputDesc, const PluginTensorDesc *outputDesc, const void *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream)=0
Execute the layer.
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:718
nvinfer1::IExecutionContext::getShapeBinding
virtual bool getShapeBinding(int32_t bindingIndex, int32_t *data) const noexcept=0
Get values of an input tensor required for shape calculations or an output tensor produced by shape c...
nvinfer1::anonymous_namespace{NvInferRuntime.h}::createInferRuntime
IRuntime * createInferRuntime(ILogger &logger)
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:2023
nvinfer1::ICudaEngine::getMaxBatchSize
virtual int32_t getMaxBatchSize() const noexcept=0
Get the maximum batch size which can be used for inference.
nvinfer1::IPluginV2Ext
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:583
nvinfer1::IPluginV2DynamicExt::enqueue
TRT_DEPRECATED int32_t enqueue(int32_t, const void *const *, void **, void *, cudaStream_t) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:681
nvinfer1::IDimensionExpr
Definition: NvInferRuntime.h:358
nvinfer1::ElementWiseOperation::kPROD
Product of the two elements.
nvinfer1::ICudaEngine::getProfileShapeValues
virtual const int32_t * getProfileShapeValues(int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const noexcept=0
Get minimum / optimum / maximum values for an input shape binding under an optimization profile.
nvinfer1::IExecutionContext::enqueue
virtual bool enqueue(int32_t batchSize, void **bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept=0
Asynchronously execute inference on a batch.
nvinfer1::EngineCapability
EngineCapability
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:82
nvinfer1::IPlugin::terminate
virtual void terminate()=0
Release resources acquired during plugin layer initialization. This is called when the engine is dest...
nvinfer1::EnumMax< DimensionOperation >
constexpr int32_t EnumMax< DimensionOperation >()
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:343
nvinfer1::ICudaEngine::getName
virtual const char * getName() const noexcept=0
Returns the name of the network associated with the engine.
nvinfer1::IExprBuilder::constant
virtual const IDimensionExpr * constant(int32_t value)=0
Return pointer to IDimensionExp for given value.
nvinfer1::IProfiler
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:698
nvinfer1::ElementWiseOperation::kLESS
Check if element in first tensor is less than corresponding element in second tensor.
nvinfer1::IPluginV2DynamicExt::getOutputDimensions
virtual DimsExprs getOutputDimensions(int32_t outputIndex, const DimsExprs *inputs, int32_t nbInputs, IExprBuilder &exprBuilder)=0
Get expressions for computing dimensions of an output tensor from dimensions of the input tensors.
nvinfer1::IRuntime::getDLACore
virtual int32_t getDLACore() const noexcept=0
Get the DLA core that the engine executes on.
nvinfer1::IOptimizationProfile::setExtraMemoryTarget
virtual bool setExtraMemoryTarget(float target) noexcept=0
Set a target for extra GPU memory that may be used by this profile.
nvinfer1::IPlugin::getSerializationSize
virtual size_t getSerializationSize()=0
Find the size of the serialization buffer required.
nvinfer1::PluginTensorDesc
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:369
nvinfer1::Weights::values
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:114
nvinfer1::IExecutionContext::getOptimizationProfile
virtual int32_t getOptimizationProfile() const noexcept=0
Get the index of the currently selected optimization profile.
nvinfer1::IPlugin::getOutputDimensions
virtual Dims getOutputDimensions(int32_t index, const Dims *inputs, int32_t nbInputDims)=0
Get the dimension of an output tensor.
nvinfer1::IOptimizationProfile::getNbShapeValues
virtual int32_t getNbShapeValues(const char *inputName) const noexcept=0
Get the number of values for an input shape tensor.
nvinfer1::EngineCapability::kSAFE_DLA
nvinfer1::IExecutionContext::setBindingDimensions
virtual bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept=0
Set the dynamic dimensions of a binding.
nvinfer1::ICudaEngine::getEngineCapability
virtual EngineCapability getEngineCapability() const noexcept=0
determine that execution capability this engine has.
nvinfer1::IPlugin
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:146
nvinfer1::IOptimizationProfile::setDimensions
virtual bool setDimensions(const char *inputName, OptProfileSelector select, Dims dims) noexcept=0
Set the minimum / optimum / maximum dimensions for a dynamic input tensor.
nvinfer1::IExecutionContext::setName
virtual void setName(const char *name) noexcept=0
Set the name of the execution context.
nvinfer1::IGpuAllocator
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:1035
nvinfer1::IPluginV2DynamicExt::getOutputDimensions
TRT_DEPRECATED Dims getOutputDimensions(int32_t, const Dims *, int32_t) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:585
nvinfer1::ICudaEngine::isExecutionBinding
virtual bool isExecutionBinding(int32_t bindingIndex) const noexcept=0
True if pointer to tensor data is required for execution phase, false if nullptr can be supplied.
nvinfer1::IDimensionExpr::getConstantValue
virtual int32_t getConstantValue() const =0
nvinfer1::IExecutionContext::setOptimizationProfileAsync
virtual bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept=0
Select an optimization profile for the current context with async semantics.
nvinfer1::IExecutionContext::setErrorRecorder
virtual void setErrorRecorder(IErrorRecorder *recorder) noexcept=0
Set the ErrorRecorder for this interface.
nvinfer1::ICudaEngine::getWorkspaceSize
virtual TRT_DEPRECATED std::size_t getWorkspaceSize() const noexcept=0
Get the amount of workspace the engine uses.
nvinfer1::IRuntime
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:759
nvinfer1::ICudaEngine::getBindingBytesPerComponent
virtual int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept=0
Return the number of bytes per component of an element.
nvinfer1::ICudaEngine::getNbBindings
virtual int32_t getNbBindings() const noexcept=0
Get the number of binding indices.
nvinfer1::TensorLocation
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:1017
nvinfer1::IExecutionContext
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1616
nvinfer1::IHostMemory::data
virtual void * data() const noexcept=0
A pointer to the raw data that is owned by the library.
nvinfer1::ICudaEngine::getDeviceMemorySize
virtual size_t getDeviceMemorySize() const noexcept=0
Return the amount of device memory required by an execution context.
nvinfer1::ICudaEngine::createExecutionContext
virtual IExecutionContext * createExecutionContext() noexcept=0
Create an execution context.
nvinfer1::IExecutionContext::enqueueV2
virtual bool enqueueV2(void **bindings, cudaStream_t stream, cudaEvent_t *inputConsumed) noexcept=0
Asynchronously execute inference.
nvinfer1::ICudaEngine::serialize
virtual IHostMemory * serialize() const noexcept=0
Serialize the network to a stream.
nvinfer1::IExecutionContext::setProfiler
virtual void setProfiler(IProfiler *) noexcept=0
Set the profiler.
nvinfer1::IOptimizationProfile::setShapeValues
virtual bool setShapeValues(const char *inputName, OptProfileSelector select, const int32_t *values, int32_t nbValues) noexcept=0
Set the minimum / optimum / maximum values for an input shape tensor.
nvinfer1::IExprBuilder
Definition: NvInferRuntime.h:389
nvinfer1::EngineCapability::kSAFE_GPU
nvinfer1::ICudaEngine::isShapeBinding
virtual bool isShapeBinding(int32_t bindingIndex) const noexcept=0
True if tensor is required as input for shape calculations or output from them.
nvinfer1::ICudaEngine::isRefittable
virtual bool isRefittable() const noexcept=0
Return true if engine can be refit.
nvinfer1::ICudaEngine::getBindingComponentsPerElement
virtual int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept=0
Return the number of components included in one element.
nvinfer1::EnumMax< WeightsRole >
constexpr int32_t EnumMax< WeightsRole >()
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:729