TensorRT  7.0.0.11
NvInferRuntime.h
Go to the documentation of this file.
1 /*
2  * Copyright 1993-2019 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 
76 enum class EngineCapability : int
77 {
78  kDEFAULT = 0,
79  kSAFE_GPU = 1,
80  kSAFE_DLA = 2,
81 };
82 
83 template <>
84 constexpr inline int EnumMax<EngineCapability>()
85 {
86  return 3;
87 }
88 
89 
98 class Weights
99 {
100 public:
102  const void* values;
103  int64_t count;
104 };
105 
117 {
118 public:
119  virtual void* data() const noexcept = 0;
120  virtual std::size_t size() const noexcept = 0;
121  virtual DataType type() const noexcept = 0;
122  virtual void destroy() noexcept = 0;
123 protected:
124  virtual ~IHostMemory() {}
125 };
126 
134 class IPlugin
135 {
136 public:
144  virtual int getNbOutputs() const TRTNOEXCEPT = 0;
145 
155  virtual Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) TRTNOEXCEPT = 0;
156 
173  virtual void configure(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, int maxBatchSize) TRTNOEXCEPT = 0;
174 
180  virtual int initialize() TRTNOEXCEPT = 0;
181 
186  virtual void terminate() TRTNOEXCEPT = 0;
187 
196  virtual size_t getWorkspaceSize(int maxBatchSize) const TRTNOEXCEPT = 0;
197 
209  virtual int enqueue(int batchSize, const void* const* inputs, void** outputs, void* workspace, cudaStream_t stream) TRTNOEXCEPT = 0;
210 
216  virtual size_t getSerializationSize() TRTNOEXCEPT = 0;
217 
225  virtual void serialize(void* buffer) TRTNOEXCEPT = 0;
226 
227  virtual ~IPlugin() {}
228 };
229 
238 class IPluginExt : public IPlugin
239 {
240 public:
246  virtual int getTensorRTVersion() const TRTNOEXCEPT
247  {
248  return NV_TENSORRT_VERSION;
249  }
250 
261  virtual bool supportsFormat(DataType type, PluginFormat format) const TRTNOEXCEPT = 0;
262 
279  virtual void configureWithFormat(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, DataType type, PluginFormat format, int maxBatchSize) TRTNOEXCEPT = 0;
280 
281  virtual ~IPluginExt() {}
282 
283 protected:
287  void configure(const Dims* /*inputDims*/, int /*nbInputs*/, const Dims* /*outputDims*/, int /*nbOutputs*/, int /*maxBatchSize*/) _TENSORRT_FINAL TRTNOEXCEPT {}
288 };
289 
300 enum class DimensionOperation : int
301 {
302  kSUM = 0,
303  kPROD = 1,
304  kMAX = 2,
305  kMIN = 3,
306  kSUB = 4,
307  kEQUAL = 5,
308  kLESS = 6,
309  kFLOOR_DIV = 7,
310  kCEIL_DIV = 8
311 };
312 
313 template <>
314 constexpr inline int EnumMax<DimensionOperation>()
315 {
316  return 9;
317 }
318 
330 {
331 public:
333  virtual bool isConstant() const = 0;
334 
337  virtual int getConstantValue() const = 0;
338 
339 protected:
340  virtual ~IDimensionExpr() {}
341 };
342 
361 {
362 public:
364  virtual const IDimensionExpr* constant(int value) = 0;
365 
368  virtual const IDimensionExpr* operation(DimensionOperation op, const IDimensionExpr& first, const IDimensionExpr& second) = 0;
369 
370 protected:
371  virtual ~IExprBuilder() {}
372 };
373 
380 {
381 public:
382  int nbDims;
384 };
385 
392 {
395 
398 
401 };
402 
423 {
424 public:
425  IPluginV2DynamicExt* clone() const _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
426 
451  virtual DimsExprs getOutputDimensions(int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) = 0;
452 
456  static constexpr int kFORMAT_COMBINATION_LIMIT = 100;
457 
489  virtual bool supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) TRTNOEXCEPT = 0;
490 
504  virtual void configurePlugin(const DynamicPluginTensorDesc* in, int nbInputs, const DynamicPluginTensorDesc* out, int nbOutputs) TRTNOEXCEPT = 0;
505 
515  virtual size_t getWorkspaceSize(const PluginTensorDesc* inputs, int nbInputs, const PluginTensorDesc* outputs, int nbOutputs) const TRTNOEXCEPT = 0;
516 
529  virtual int enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc, const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) TRTNOEXCEPT = 0;
530 
531 protected:
532  int getTensorRTVersion() const _TENSORRT_OVERRIDE TRTNOEXCEPT
533  {
534  return (static_cast<int>(PluginVersion::kV2_DYNAMICEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
535  }
536 
537  virtual ~IPluginV2DynamicExt() {}
538 
539  // Rest of the methods below are obsolete inherited methods, and marked final when using a C++11 compiler.
540  // Derived classes should not override them.
541 
547  TRT_DEPRECATED
548  Dims getOutputDimensions(int /*index*/, const Dims* /*inputs*/, int /*nbInputDims*/) _TENSORRT_FINAL TRTNOEXCEPT
549  {
550  return Dims{-1, {}, {}};
551  }
552 
558  TRT_DEPRECATED
559  bool isOutputBroadcastAcrossBatch(int /*outputIndex*/, const bool* /*inputIsBroadcasted*/, int /*nbInputs*/) const _TENSORRT_FINAL TRTNOEXCEPT
560  {
561  return false;
562  }
563 
569  TRT_DEPRECATED
570  bool canBroadcastInputAcrossBatch(int /*inputIndex*/) const _TENSORRT_FINAL TRTNOEXCEPT
571  {
572  return true;
573  }
574 
583  TRT_DEPRECATED
584  bool supportsFormat(DataType /*type*/, PluginFormat /*format*/) const _TENSORRT_FINAL TRTNOEXCEPT { return false; }
585 
594  TRT_DEPRECATED
595  void configurePlugin(const Dims* /*inputDims*/, int /*nbInputs*/, const Dims* /*outputDims*/,
596  int /*nbOutputs*/, const DataType* /*inputTypes*/, const DataType* /*outputTypes*/,
597  const bool* /*inputIsBroadcast*/, const bool* /*outputIsBroadcast*/, PluginFormat /*floatFormat*/, int /*maxBatchSize*/) _TENSORRT_FINAL TRTNOEXCEPT {}
598 
608  TRT_DEPRECATED
609  size_t getWorkspaceSize(int /*maxBatchSize*/) const _TENSORRT_FINAL TRTNOEXCEPT { return 0; }
610 
618  TRT_DEPRECATED
619  int enqueue(int /*batchSize*/, const void* const* /*inputs*/, void** /*outputs*/, void* /*workspace*/, cudaStream_t /*stream*/) _TENSORRT_FINAL TRTNOEXCEPT
620  {
621  return 1;
622  }
623 };
624 
636 {
637 public:
644  virtual void reportLayerTime(const char* layerName, float ms) TRTNOEXCEPT = 0;
645 
646  virtual ~IProfiler() {}
647 };
648 
655 enum class WeightsRole : int
656 {
657  kKERNEL = 0,
658  kBIAS = 1,
659  kSHIFT = 2,
660  kSCALE = 3,
661  kCONSTANT = 4,
662 };
663 
664 template <>
665 constexpr inline int EnumMax<WeightsRole>()
666 {
667  return 5;
668 }
669 
675 enum class DeviceType : int
676 {
677  kGPU,
678  kDLA,
679 };
680 template <>
681 constexpr inline int EnumMax<DeviceType>()
682 {
683  return 2;
684 }
685 
686 
694 class IRuntime
695 {
696 public:
706  virtual nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size, IPluginFactory* pluginFactory) noexcept = 0;
707 
713  virtual void setDLACore(int dlaCore) noexcept = 0;
714 
719  virtual int getDLACore() const noexcept = 0;
720 
724  virtual int getNbDLACores() const noexcept = 0;
725 
729  virtual void destroy() noexcept = 0;
730 
731 protected:
732  virtual ~IRuntime() {}
733 
734 public:
743  virtual void setGpuAllocator(IGpuAllocator* allocator) noexcept = 0;
744 
754  //
757  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
758 
769  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
770 
779  nvinfer1::ICudaEngine* deserializeCudaEngine(const void* blob, std::size_t size) noexcept
780  {
781  return deserializeCudaEngine(blob, size, nullptr);
782  }
783 };
784 
793 {
794 public:
805  virtual bool setWeights(const char* layerName, WeightsRole role, Weights weights) TRTNOEXCEPT = 0;
806 
812  virtual bool refitCudaEngine() TRTNOEXCEPT = 0;
813 
830  virtual int getMissing(int size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
831 
844  virtual int getAll(int size, const char** layerNames, WeightsRole* roles) TRTNOEXCEPT = 0;
845 
846  virtual void destroy() TRTNOEXCEPT = 0;
847 
848 protected:
849  virtual ~IRefitter() {}
850 
851 public:
864  virtual bool setDynamicRange(const char* tensorName, float min, float max) TRTNOEXCEPT = 0;
865 
873  virtual float getDynamicRangeMin(const char* tensorName) const TRTNOEXCEPT = 0;
874 
882  virtual float getDynamicRangeMax(const char* tensorName) const TRTNOEXCEPT = 0;
883 
895  virtual int getTensorsWithDynamicRange(int size, const char** tensorNames) const TRTNOEXCEPT = 0;
896 
906  //
909  virtual void setErrorRecorder(IErrorRecorder* recorder) TRTNOEXCEPT = 0;
910 
921  virtual IErrorRecorder* getErrorRecorder() const TRTNOEXCEPT = 0;
922 };
923 
931 {
932 public:
947  virtual IPlugin* createPlugin(const char* layerName, const void* serialData, size_t serialLength) TRTNOEXCEPT = 0;
948 
949  virtual ~IPluginFactory() {}
950 };
951 
962 enum class OptProfileSelector : int
963 {
964  kMIN = 0,
965  kOPT = 1,
966  kMAX = 2
967 };
968 
969 template <>
970 constexpr inline int EnumMax<OptProfileSelector>()
971 {
972  return 3;
973 }
974 
998 {
999 public:
1023  virtual bool setDimensions(const char* inputName, OptProfileSelector select, Dims dims) noexcept = 0;
1024 
1030  virtual Dims getDimensions(const char* inputName, OptProfileSelector select) const noexcept = 0;
1031 
1053  virtual bool setShapeValues(
1054  const char* inputName, OptProfileSelector select, const int32_t* values, int nbValues) noexcept = 0;
1055 
1062  virtual int getNbShapeValues(const char* inputName) const noexcept = 0;
1063 
1069  virtual const int32_t* getShapeValues(const char* inputName, OptProfileSelector select) const noexcept = 0;
1070 
1084  virtual bool setExtraMemoryTarget(float target) noexcept = 0;
1085 
1089  virtual float getExtraMemoryTarget() const noexcept = 0;
1090 
1102  virtual bool isValid() const noexcept = 0;
1103 
1104 protected:
1105  ~IOptimizationProfile() noexcept = default;
1106 };
1107 
1116 {
1117 public:
1126  virtual int getNbBindings() const noexcept = 0;
1127 
1141  virtual int getBindingIndex(const char* name) const noexcept = 0;
1142 
1153  virtual const char* getBindingName(int bindingIndex) const noexcept = 0;
1154 
1163  virtual bool bindingIsInput(int bindingIndex) const noexcept = 0;
1164 
1174  virtual Dims getBindingDimensions(int bindingIndex) const noexcept = 0;
1175 
1184  virtual DataType getBindingDataType(int bindingIndex) const noexcept = 0;
1185 
1193  virtual int getMaxBatchSize() const noexcept = 0;
1194 
1203  virtual int getNbLayers() const noexcept = 0;
1204 
1211  TRT_DEPRECATED
1212  virtual std::size_t getWorkspaceSize() const noexcept = 0;
1213 
1223  virtual IHostMemory* serialize() const noexcept = 0;
1224 
1230  virtual IExecutionContext* createExecutionContext() noexcept = 0;
1231 
1235  virtual void destroy() noexcept = 0;
1236 
1247  virtual TensorLocation getLocation(int bindingIndex) const noexcept = 0;
1248 
1249 protected:
1250  virtual ~ICudaEngine() {}
1251 
1252 public:
1259  virtual IExecutionContext* createExecutionContextWithoutDeviceMemory() noexcept = 0;
1260 
1266  virtual size_t getDeviceMemorySize() const noexcept = 0;
1267 
1273  virtual bool isRefittable() const noexcept = 0;
1274 
1284  virtual int getBindingBytesPerComponent(int bindingIndex) const noexcept = 0;
1285 
1295  virtual int getBindingComponentsPerElement(int bindingIndex) const noexcept = 0;
1296 
1302  virtual TensorFormat getBindingFormat(int bindingIndex) const noexcept = 0;
1303 
1318  virtual const char* getBindingFormatDesc(int bindingIndex) const noexcept = 0;
1319 
1327  virtual int getBindingVectorizedDim(int bindingIndex) const noexcept = 0;
1328 
1339  virtual const char* getName() const noexcept = 0;
1340 
1347  virtual int getNbOptimizationProfiles() const noexcept = 0;
1348 
1359  virtual Dims getProfileDimensions(int bindingIndex, int profileIndex, OptProfileSelector select) const noexcept = 0;
1360 
1376  virtual const int32_t* getProfileShapeValues(int profileIndex, int inputIndex, OptProfileSelector select) const
1377  noexcept
1378  = 0;
1379 
1411  virtual bool isShapeBinding(int bindingIndex) const noexcept = 0;
1412 
1422  virtual bool isExecutionBinding(int bindingIndex) const noexcept = 0;
1423 
1433  virtual EngineCapability getEngineCapability() const noexcept = 0;
1434 
1443  //
1446  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1447 
1458  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1459 
1474  virtual bool hasImplicitBatchDimension() const TRTNOEXCEPT = 0;
1475 };
1476 
1488 {
1489 public:
1501  virtual bool execute(int batchSize, void** bindings) noexcept = 0;
1502 
1516  virtual bool enqueue(int batchSize, void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept = 0;
1517 
1525  virtual void setDebugSync(bool sync) noexcept = 0;
1526 
1532  virtual bool getDebugSync() const noexcept = 0;
1533 
1539  virtual void setProfiler(IProfiler*) noexcept = 0;
1540 
1546  virtual IProfiler* getProfiler() const noexcept = 0;
1547 
1553  virtual const ICudaEngine& getEngine() const noexcept = 0;
1554 
1558  virtual void destroy() noexcept = 0;
1559 
1560 protected:
1561  virtual ~IExecutionContext() noexcept {}
1562 
1563 public:
1571  virtual void setName(const char* name) noexcept = 0;
1572 
1578  virtual const char* getName() const noexcept = 0;
1579 
1591  virtual void setDeviceMemory(void* memory) noexcept = 0;
1592 
1601  virtual Dims getStrides(int bindingIndex) const noexcept = 0;
1602 
1603 public:
1629  virtual bool setOptimizationProfile(int profileIndex) noexcept = 0;
1630 
1638  virtual int getOptimizationProfile() const noexcept = 0;
1639 
1658  virtual bool setBindingDimensions(int bindingIndex, Dims dimensions) noexcept = 0;
1659 
1680  virtual Dims getBindingDimensions(int bindingIndex) const noexcept = 0;
1681 
1697  virtual bool setInputShapeBinding(int bindingIndex, const int32_t* data) noexcept = 0;
1698 
1715  virtual bool getShapeBinding(int bindingIndex, int32_t* data) const noexcept = 0;
1716 
1727  virtual bool allInputDimensionsSpecified() const noexcept = 0;
1728 
1738  virtual bool allInputShapesSpecified() const noexcept = 0;
1739 
1749  //
1752  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
1753 
1764  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
1765 
1778  virtual bool executeV2(void** bindings) noexcept = 0;
1779 
1795  virtual bool enqueueV2(void** bindings, cudaStream_t stream, cudaEvent_t* inputConsumed) noexcept = 0;
1796 };
1797 }
1802 extern "C" TENSORRTAPI void* createInferRuntime_INTERNAL(void* logger, int version);
1803 
1808 extern "C" TENSORRTAPI void* createInferRefitter_INTERNAL(void* engine, void* logger, int version);
1809 
1810 namespace nvinfer1
1811 {
1812 namespace // unnamed namespace avoids linkage surprises when linking objects built with different versions of this header.
1813 {
1820 {
1821  return static_cast<IRuntime*>(createInferRuntime_INTERNAL(&logger, NV_TENSORRT_VERSION));
1822 }
1823 
1830 {
1831  return static_cast<IRefitter*>(createInferRefitter_INTERNAL(&engine, &logger, NV_TENSORRT_VERSION));
1832 }
1833 }
1834 }
1835 
1836 #endif // NV_INFER_RUNTIME_H
An engine for executing inference on a built network, with functionally unsafe features.
Definition: NvInferRuntime.h:1115
Substract the second element from the first.
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:162
IRuntime * createInferRuntime(ILogger &logger)
Create an instance of an IRuntime class.
Definition: NvInferRuntime.h:1819
Check if element in first tensor is less than corresponding element in second tensor.
Check if two elements are equal.
PluginTensorDesc desc
Information required to interpret a pointer to tensor data, except that desc.dims has -1 in place of ...
Definition: NvInferRuntime.h:394
Safety restricted capability, TensorRT flow that can only run on GPU devices.
constexpr int EnumMax< WeightsRole >()
Maximum number of elements in WeightsRole enum.
Definition: NvInferRuntime.h:665
OptProfileSelector
When setting or querying optimization profile parameters (such as shape tensor inputs or dynamic dime...
Definition: NvInferRuntime.h:962
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:112
TRT_DEPRECATED bool canBroadcastInputAcrossBatch(int) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:570
const void * values
The weight values, in a contiguous array.
Definition: NvInferRuntime.h:102
void configure(const Dims *, int, const Dims *, int, int) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:287
Definition: NvInferRuntime.h:422
Allows a serialized functionally unsafe engine to be deserialized.
Definition: NvInferRuntime.h:694
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:134
static const int MAX_DIMS
The maximum number of dimensions supported for a tensor.
Definition: NvInferRuntimeCommon.h:209
TRT_DEPRECATED bool isOutputBroadcastAcrossBatch(int, const bool *, int) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:559
bias for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
Fail with error when the coordinates are out of bounds. This is the default.
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:926
shift part of IScaleLayer
DataType type
The type of the weights.
Definition: NvInferRuntime.h:101
The TensorRT API version 1 namespace.
Sum of the two elements.
Plugin factory for deserialization.
Definition: NvInferRuntime.h:930
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:779
This is used to set or get the value that is used in the optimization (kernel selection).
Product of the two elements.
Optimization profile for dynamic input dimensions and shape tensors.
Definition: NvInferRuntime.h:997
TRT_DEPRECATED Dims getOutputDimensions(int, const Dims *, int) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:548
int getTensorRTVersion() const _TENSORRT_OVERRIDE
Return the API version with which this plugin was built.
Definition: NvInferRuntime.h:532
int nbDims
The number of dimensions.
Definition: NvInferRuntime.h:382
constexpr int EnumMax< DimensionOperation >()
Maximum number of elements in DimensionOperation enum.
Definition: NvInferRuntime.h:314
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1142
TRT_DEPRECATED int enqueue(int, 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:619
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:206
constexpr int EnumMax< DeviceType >()
Maximum number of elements in DeviceType enum.
Definition: NvInferRuntime.h:681
Minimum of the two elements.
int64_t count
The number of weights in the array.
Definition: NvInferRuntime.h:103
Definition: NvInferRuntime.h:360
kernel for IConvolutionLayer, IDeconvolutionLayer, or IFullyConnectedLayer
An array of weights used as a layer parameter.
Definition: NvInferRuntime.h:98
IRefitter * createInferRefitter(ICudaEngine &engine, ILogger &logger)
Create an instance of an IRefitter class.
Definition: NvInferRuntime.h:1829
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:236
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:986
constexpr int EnumMax< EngineCapability >()
Maximum number of elements in EngineCapability enum.
Definition: NvInferRuntime.h:84
Plugin class for user-implemented layers.
Definition: NvInferRuntime.h:238
Floor division of the first element by the second.
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:311
EngineCapability
Forward declaration of IPluginFactory for use by other interfaces.
Definition: NvInferRuntime.h:76
Safety restricted capability, TensorRT flow that can only run on DLA devices.
Definition: NvInferRuntime.h:329
Definition: NvInferRuntime.h:391
Class to handle library allocated memory that is accessible to the user.
Definition: NvInferRuntime.h:116
constexpr int EnumMax< OptProfileSelector >()
Number of different values of OptProfileSelector enum.
Definition: NvInferRuntime.h:970
Dims max
Upper bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:400
DimensionOperation
An operation on two IDimensionExpr, which represent integer expressions used in dimension computation...
Definition: NvInferRuntime.h:300
virtual int getTensorRTVersion() const
Return the API version with which this plugin was built.
Definition: NvInferRuntime.h:246
#define _TENSORRT_OVERRIDE
Items that are marked as deprecated will be removed in a future release.
Definition: NvInferRuntimeCommon.h:62
Application-implemented class for controlling allocation on the GPU.
Definition: NvInferRuntimeCommon.h:943
Context for executing inference using an engine, with functionally unsafe features.
Definition: NvInferRuntime.h:1487
Updates weights in an engine.
Definition: NvInferRuntime.h:792
Dims min
Lower bounds on tensor’s dimensions.
Definition: NvInferRuntime.h:397
DeviceType
The device that this layer/network will execute on.
Definition: NvInferRuntime.h:675
TRT_DEPRECATED size_t getWorkspaceSize(int) const _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:609
Definition: NvInferRuntime.h:379
Application-implemented interface for profiling.
Definition: NvInferRuntime.h:635
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:514
WeightsRole
How a layer uses particular Weights.
Definition: NvInferRuntime.h:655
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:584
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:113
TRT_DEPRECATED void configurePlugin(const Dims *, int, const Dims *, int, const DataType *, const DataType *, const bool *, const bool *, PluginFormat, int) _TENSORRT_FINAL
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntime.h:595