TensorRT  7.2.0.9
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 
582  TRT_DEPRECATED
584  int32_t /*index*/, const Dims* /*inputs*/, int32_t /*nbInputDims*/) _TENSORRT_FINAL TRTNOEXCEPT
585  {
586  return Dims{-1, {}, {}};
587  }
588 
594  TRT_DEPRECATED
595  bool isOutputBroadcastAcrossBatch(int32_t /*outputIndex*/, const bool* /*inputIsBroadcasted*/,
596  int32_t /*nbInputs*/) const _TENSORRT_FINAL TRTNOEXCEPT
597  {
598  return false;
599  }
600 
606  TRT_DEPRECATED
607  bool canBroadcastInputAcrossBatch(int32_t /*inputIndex*/) const _TENSORRT_FINAL TRTNOEXCEPT
608  {
609  return true;
610  }
611 
620  TRT_DEPRECATED
621  bool supportsFormat(DataType /*type*/, PluginFormat /*format*/) const _TENSORRT_FINAL TRTNOEXCEPT { return false; }
622 
632  TRT_DEPRECATED
633  void configurePlugin(const Dims* /*inputDims*/, int32_t /*nbInputs*/, const Dims* /*outputDims*/,
634  int32_t /*nbOutputs*/, const DataType* /*inputTypes*/, const DataType* /*outputTypes*/,
635  const bool* /*inputIsBroadcast*/, const bool* /*outputIsBroadcast*/, PluginFormat /*floatFormat*/,
636  int32_t /*maxBatchSize*/) _TENSORRT_FINAL TRTNOEXCEPT
637  {
638  }
639 
649  TRT_DEPRECATED
650  size_t getWorkspaceSize(int32_t /*maxBatchSize*/) const _TENSORRT_FINAL TRTNOEXCEPT
651  {
652  return 0;
653  }
654 
663  TRT_DEPRECATED
664  int32_t enqueue(int32_t /*batchSize*/, const void* const* /*inputs*/, void** /*outputs*/, void* /*workspace*/,
665  cudaStream_t /*stream*/) _TENSORRT_FINAL TRTNOEXCEPT
666  {
667  return 1;
668  }
669 };
670 
682 {
683 public:
690  virtual void reportLayerTime(const char* layerName, float ms) TRTNOEXCEPT = 0;
691 
692  virtual ~IProfiler() {}
693 };
694 
701 enum class WeightsRole : int32_t
702 {
703  kKERNEL = 0,
704  kBIAS = 1,
705  kSHIFT = 2,
706  kSCALE = 3,
707  kCONSTANT = 4,
708 };
709 
711 template <>
712 constexpr inline int32_t EnumMax<WeightsRole>()
713 {
714  return 5;
715 }
716 
722 enum class DeviceType : int32_t
723 {
724  kGPU,
725  kDLA,
726 };
727 
729 template <>
730 constexpr inline int32_t EnumMax<DeviceType>()
731 {
732  return 2;
733 }
734 
742 class IRuntime
743 {
744 public:
754  virtual nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept = 0;
755 
763  virtual void setDLACore(int32_t dlaCore) noexcept = 0;
764 
771  virtual int32_t getDLACore() const noexcept = 0;
772 
776  virtual int32_t getNbDLACores() const noexcept = 0;
777 
781  virtual void destroy() noexcept = 0;
782 
783 protected:
784  virtual ~IRuntime() {}
785 
786 public:
795  virtual void setGpuAllocator(IGpuAllocator* allocator) noexcept = 0;
796 
806  //
809  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
810 
821  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
822 
831  nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
832  {
833  return deserializeCudaEngine(blob, size, nullptr);
834  }
835 };
836 
845 {
846 public:
857  virtual bool setWeights(const char* layerName, WeightsRole role, Weights weights) TRTNOEXCEPT = 0;
858 
864  virtual bool refitCudaEngine() TRTNOEXCEPT = 0;
865 
882  virtual int32_t getMissing(int32_t size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
883 
896  virtual int32_t getAll(int32_t size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
897 
898  virtual void destroy() TRTNOEXCEPT = 0;
899 
900 protected:
901  virtual ~IRefitter() {}
902 
903 public:
916  virtual bool setDynamicRange(const char* tensorName, float min, float max) TRTNOEXCEPT = 0;
917 
925  virtual float getDynamicRangeMin(const char* tensorName) const TRTNOEXCEPT = 0;
926 
934  virtual float getDynamicRangeMax(const char* tensorName) const TRTNOEXCEPT = 0;
935 
947  virtual int32_t getTensorsWithDynamicRange(int32_t size, const char** tensorNames) const TRTNOEXCEPT = 0;
948 
958  //
961  virtual void setErrorRecorder(IErrorRecorder* recorder) TRTNOEXCEPT = 0;
962 
973  virtual IErrorRecorder* getErrorRecorder() const TRTNOEXCEPT = 0;
974 };
975 
983 {
984 public:
999  virtual IPlugin* createPlugin(const char* layerName, const void* serialData, size_t serialLength) TRTNOEXCEPT = 0;
1000 
1001  virtual ~IPluginFactory() {}
1002 };
1003 
1014 enum class OptProfileSelector : int32_t
1015 {
1016  kMIN = 0,
1017  kOPT = 1,
1018  kMAX = 2
1019 };
1020 
1022 template <>
1023 constexpr inline int32_t EnumMax<OptProfileSelector>()
1024 {
1025  return 3;
1026 }
1027 
1051 {
1052 public:
1078  virtual bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept = 0;
1079 
1085  virtual Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept = 0;
1086 
1110  virtual bool setShapeValues(
1111  const char* inputName, OptProfileSelector select, const int32_t* values, int32_t nbValues) noexcept
1112  = 0;
1113 
1120  virtual int32_t getNbShapeValues(const char* inputName) const noexcept = 0;
1121 
1127  virtual const int32_t* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept = 0;
1128 
1142  virtual bool setExtraMemoryTarget(float target) noexcept = 0;
1143 
1147  virtual float getExtraMemoryTarget() const noexcept = 0;
1148 
1160  virtual bool isValid() const noexcept = 0;
1161 
1162 protected:
1163  ~IOptimizationProfile() noexcept = default;
1164 };
1165 
1174 {
1175 public:
1186  virtual int32_t getNbBindings() const noexcept = 0;
1187 
1205  virtual int32_t getBindingIndex(const char* name) const noexcept = 0;
1206 
1222  virtual const char* getBindingName(int32_t bindingIndex) const noexcept = 0;
1223 
1232  virtual bool bindingIsInput(int32_t bindingIndex) const noexcept = 0;
1233 
1254  virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept = 0;
1255 
1264  virtual DataType getBindingDataType(int32_t bindingIndex) const noexcept = 0;
1265 
1273  virtual int32_t getMaxBatchSize() const noexcept = 0;
1274 
1284  virtual int32_t getNbLayers() const noexcept = 0;
1285 
1292  TRT_DEPRECATED
1293  virtual std::size_t getWorkspaceSize() const noexcept = 0;
1294 
1304  virtual IHostMemory* serialize() const noexcept = 0;
1305 
1316  virtual IExecutionContext* createExecutionContext() noexcept = 0;
1317 
1321  virtual void destroy() noexcept = 0;
1322 
1333  virtual TensorLocation getLocation(int32_t bindingIndex) const noexcept = 0;
1334 
1335 protected:
1336  virtual ~ICudaEngine() {}
1337 
1338 public:
1346 
1352  virtual size_t getDeviceMemorySize() const noexcept = 0;
1353 
1359  virtual bool isRefittable() const noexcept = 0;
1360 
1370  virtual int32_t getBindingBytesPerComponent(int32_t bindingIndex) const noexcept = 0;
1371 
1381  virtual int32_t getBindingComponentsPerElement(int32_t bindingIndex) const noexcept = 0;
1382 
1388  virtual TensorFormat getBindingFormat(int32_t bindingIndex) const noexcept = 0;
1389 
1404  virtual const char* getBindingFormatDesc(int32_t bindingIndex) const noexcept = 0;
1405 
1413  virtual int32_t getBindingVectorizedDim(int32_t bindingIndex) const noexcept = 0;
1414 
1425  virtual const char* getName() const noexcept = 0;
1426 
1433  virtual int32_t getNbOptimizationProfiles() const noexcept = 0;
1434 
1457  virtual Dims getProfileDimensions(int32_t bindingIndex, int32_t profileIndex, OptProfileSelector select) const
1458  noexcept
1459  = 0;
1460 
1482  virtual const int32_t* getProfileShapeValues(
1483  int32_t profileIndex, int32_t inputIndex, OptProfileSelector select) const noexcept
1484  = 0;
1485 
1517  virtual bool isShapeBinding(int32_t bindingIndex) const noexcept = 0;
1518 
1528  virtual bool isExecutionBinding(int32_t bindingIndex) const noexcept = 0;
1529 
1540  virtual EngineCapability getEngineCapability() const noexcept = 0;
1541 
1550  //
1553  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1554 
1565  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1566 
1581  virtual bool hasImplicitBatchDimension() const TRTNOEXCEPT = 0;
1582 };
1583 
1595 {
1596 public:
1608  virtual bool execute(int32_t batchSize, void** bindings) noexcept = 0;
1609 
1624  virtual bool enqueue(int32_t batchSize, void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept
1625  = 0;
1626 
1635  virtual void setDebugSync(bool sync) noexcept = 0;
1636 
1642  virtual bool getDebugSync() const noexcept = 0;
1643 
1649  virtual void setProfiler(IProfiler*) noexcept = 0;
1650 
1656  virtual IProfiler* getProfiler() const noexcept = 0;
1657 
1663  virtual const ICudaEngine& getEngine() const noexcept = 0;
1664 
1668  virtual void destroy() noexcept = 0;
1669 
1670 protected:
1671  virtual ~IExecutionContext() noexcept {}
1672 
1673 public:
1681  virtual void setName(const char* name) noexcept = 0;
1682 
1688  virtual const char* getName() const noexcept = 0;
1689 
1701  virtual void setDeviceMemory(void* memory) noexcept = 0;
1702 
1719  virtual Dims getStrides(int32_t bindingIndex) const noexcept = 0;
1720 
1721 public:
1753  TRT_DEPRECATED
1754  virtual bool setOptimizationProfile(int32_t profileIndex) noexcept = 0;
1755 
1763  virtual int32_t getOptimizationProfile() const noexcept = 0;
1764 
1786  virtual bool setBindingDimensions(int32_t bindingIndex, Dims dimensions) noexcept = 0;
1787 
1813  virtual Dims getBindingDimensions(int32_t bindingIndex) const noexcept = 0;
1814 
1830  virtual bool setInputShapeBinding(int32_t bindingIndex, const int32_t* data) noexcept = 0;
1831 
1849  virtual bool getShapeBinding(int32_t bindingIndex, int32_t* data) const noexcept = 0;
1850 
1861  virtual bool allInputDimensionsSpecified() const noexcept = 0;
1862 
1872  virtual bool allInputShapesSpecified() const noexcept = 0;
1873 
1883  //
1886  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1887 
1898  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1899 
1912  virtual bool executeV2(void** bindings) noexcept = 0;
1913 
1933  virtual bool enqueueV2(void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept = 0;
1934 
1975  virtual bool setOptimizationProfileAsync(int32_t profileIndex, cudaStream_t stream) noexcept = 0;
1976 }; // class IExecutionContext
1977 } // namespace nvinfer1
1978 
1983 extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int32_t version);
1984 
1989 extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int32_t version);
1990 
1991 namespace nvinfer1
1992 {
1993 namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this header.
1994 {
2001 {
2002  return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
2003 }
2004 
2011 {
2012  return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
2013 }
2014 }
2015 }
2016 
2017 #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:2010
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:722
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:844
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:257
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:982
nvinfer1::ILogger
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:1066
nvinfer1::EnumMax< DeviceType >
constexpr int32_t EnumMax< DeviceType >()
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:730
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:607
nvinfer1::ICudaEngine
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1173
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:831
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:633
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:595
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:650
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:621
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:1050
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:1223
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:1014
nvinfer1::WeightsRole
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:701
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:2000
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:579
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:664
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:681
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:365
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:1023
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:583
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:742
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:1005
nvinfer1::IExecutionContext
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1594
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:712