TensorRT  6.0.1.10
NvInferRuntimeCommon.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_COMMON_H
51 #define NV_INFER_RUNTIME_COMMON_H
52 
53 #include <cstddef>
54 #include <cstdint>
55 #include "NvInferVersion.h"
56 
57 #if __cplusplus > 201103L
58 #define _TENSORRT_FINAL final
59 #define _TENSORRT_OVERRIDE override
60 #else
61 #define _TENSORRT_FINAL
62 #define _TENSORRT_OVERRIDE
63 #endif
64 
66 #if __cplusplus >= 201402L
67 #define TRT_DEPRECATED [[deprecated]]
68 #if __GNUC__ < 6
69 #define TRT_DEPRECATED_ENUM
70 #else
71 #define TRT_DEPRECATED_ENUM TRT_DEPRECATED
72 #endif
73 #ifdef _MSC_VER
74 #define TRT_DEPRECATED_API __declspec(dllexport)
75 #else
76 #define TRT_DEPRECATED_API [[deprecated]] __attribute__((visibility("default")))
77 #endif
78 #else
79 #ifdef _MSC_VER
80 #define TRT_DEPRECATED
81 #define TRT_DEPRECATED_ENUM
82 #define TRT_DEPRECATED_API __declspec(dllexport)
83 #else
84 #define TRT_DEPRECATED __attribute__((deprecated))
85 #define TRT_DEPRECATED_ENUM
86 #define TRT_DEPRECATED_API __attribute__((deprecated, visibility("default")))
87 #endif
88 #endif
89 
91 #ifdef TENSORRT_BUILD_LIB
92 #ifdef _MSC_VER
93 #define TENSORRTAPI __declspec(dllexport)
94 #else
95 #define TENSORRTAPI __attribute__((visibility("default")))
96 #endif
97 #else
98 #define TENSORRTAPI
99 #endif
100 #define TRTNOEXCEPT
101 
107 // forward declare some CUDA types to avoid an include dependency
108 
109 struct cublasContext;
110 struct cudnnContext;
111 
112 typedef struct CUstream_st* cudaStream_t;
113 typedef struct CUevent_st* cudaEvent_t;
114 
115 static const int NV_TENSORRT_VERSION = (NV_TENSORRT_MAJOR * 1000) + (NV_TENSORRT_MINOR * 100) + NV_TENSORRT_PATCH; // major, minor, patch
116 
122 namespace nvinfer1
123 {
124 
125 class IErrorRecorder;
126 class IGpuAllocator;
127 
133 enum class ActivationType : int
134 {
135  kRELU = 0,
136  kSIGMOID = 1,
137  kTANH = 2,
138  kLEAKY_RELU = 3,
139  kELU = 4,
140  kSELU = 5,
141  kSOFTSIGN = 6,
142  kSOFTPLUS = 7,
143  kCLIP = 8,
144  kHARD_SIGMOID = 9,
145  kSCALED_TANH = 10,
146  kTHRESHOLDED_RELU = 11
147 };
148 
149 template <typename T>
150 constexpr inline int EnumMax();
151 
152 template <>
153 constexpr inline int EnumMax<ActivationType>()
154 {
155  return 12;
156 }
157 
162 enum class DataType : int
163 {
164  kFLOAT = 0,
165  kHALF = 1,
166  kINT8 = 2,
167  kINT32 = 3
168 };
169 
170 template <>
171 constexpr inline int EnumMax<DataType>()
172 {
173  return 4;
174 }
175 
180 enum class DimensionType : int
181 {
182  kSPATIAL = 0,
183  kCHANNEL = 1,
184  kINDEX = 2,
185  kSEQUENCE = 3
186 };
187 
188 template <>
189 constexpr inline int EnumMax<DimensionType>()
190 {
191  return 4;
192 }
193 
205 class Dims
206 {
207 public:
208  static const int MAX_DIMS = 8;
209  int nbDims;
210  int d[MAX_DIMS];
211  TRT_DEPRECATED DimensionType type[MAX_DIMS];
212 };
213 
220 typedef uint32_t TensorFormats;
221 
235 enum class TensorFormat : int
236 {
241  kLINEAR = 0,
242  kNCHW TRT_DEPRECATED_ENUM = kLINEAR,
243 
250  kCHW2 = 1,
251  kNC2HW2 TRT_DEPRECATED_ENUM = kCHW2,
252 
259  kHWC8 = 2,
260  kNHWC8 TRT_DEPRECATED_ENUM = kHWC8,
261 
268  kCHW4 = 3,
269 
276  kCHW16 = 4,
277 
284  kCHW32 = 5
285 };
286 
293 
294 template <>
295 constexpr inline int EnumMax<TensorFormat>()
296 {
297  return 6;
298 }
299 
311 {
312  Dims dims;
313  DataType type;
314  TensorFormat format;
315  float scale;
316 };
317 
324 enum class PluginVersion : uint8_t
325 {
326  kV2 = 0,
327  kV2_EXT = 1,
328  kV2_IOEXT = 2,
329  kV2_DYNAMICEXT = 3,
330 };
331 
344 {
345 public:
351  virtual int getTensorRTVersion() const TRTNOEXCEPT
352  {
353  return NV_TENSORRT_VERSION;
354  }
355 
358  // \see IPluginCreator::getPluginName()
360  virtual const char* getPluginType() const TRTNOEXCEPT = 0;
361 
364  // \see IPluginCreator::getPluginVersion()
366  virtual const char* getPluginVersion() const TRTNOEXCEPT = 0;
367 
375  virtual int getNbOutputs() const TRTNOEXCEPT = 0;
376 
386  virtual Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) TRTNOEXCEPT = 0;
387 
402  virtual bool supportsFormat(DataType type, PluginFormat format) const TRTNOEXCEPT = 0;
403 
424  virtual void configureWithFormat(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, DataType type, PluginFormat format, int maxBatchSize) TRTNOEXCEPT = 0;
425 
431  virtual int initialize() TRTNOEXCEPT = 0;
432 
437  virtual void terminate() TRTNOEXCEPT = 0;
438 
447  virtual size_t getWorkspaceSize(int maxBatchSize) const TRTNOEXCEPT = 0;
448 
460  virtual int enqueue(int batchSize, const void* const* inputs, void** outputs, void* workspace, cudaStream_t stream) TRTNOEXCEPT = 0;
461 
467  virtual size_t getSerializationSize() const TRTNOEXCEPT = 0;
468 
476  virtual void serialize(void* buffer) const TRTNOEXCEPT = 0;
477 
481  virtual void destroy() TRTNOEXCEPT = 0;
482 
486  virtual IPluginV2* clone() const TRTNOEXCEPT = 0;
487 
492  virtual void setPluginNamespace(const char* pluginNamespace) TRTNOEXCEPT = 0;
493 
497  virtual const char* getPluginNamespace() const TRTNOEXCEPT = 0;
498 
499 protected:
500  virtual ~IPluginV2() {}
501 };
502 
513 class IPluginV2Ext : public IPluginV2
514 {
515 public:
522  virtual nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputTypes, int nbInputs) const TRTNOEXCEPT = 0;
523 
534  virtual bool isOutputBroadcastAcrossBatch(int outputIndex, const bool* inputIsBroadcasted, int nbInputs) const TRTNOEXCEPT = 0;
535 
549  virtual bool canBroadcastInputAcrossBatch(int inputIndex) const TRTNOEXCEPT = 0;
550 
577 
578  virtual void configurePlugin(const Dims* inputDims, int nbInputs, const Dims* outputDims,
579  int nbOutputs, const DataType* inputTypes, const DataType* outputTypes,
580  const bool* inputIsBroadcast, const bool* outputIsBroadcast, PluginFormat floatFormat, int maxBatchSize) TRTNOEXCEPT = 0;
581 
582  virtual ~IPluginV2Ext() {}
583 
595  virtual void attachToContext(cudnnContext* /*cudnn*/, cublasContext* /*cublas*/, IGpuAllocator* /*allocator*/) TRTNOEXCEPT {}
596 
603  virtual void detachFromContext() TRTNOEXCEPT {}
604 
610  virtual IPluginV2Ext* clone() const _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
611 
612 protected:
619  int getTensorRTVersion() const _TENSORRT_OVERRIDE TRTNOEXCEPT
620  {
621  return (static_cast<int>(PluginVersion::kV2_EXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
622  }
623 
627  void configureWithFormat(const Dims* /*inputDims*/, int /*nbInputs*/, const Dims* /*outputDims*/,
628  int /*nbOutputs*/, DataType /*type*/, PluginFormat /*format*/, int /*maxBatchSize*/) _TENSORRT_OVERRIDE TRTNOEXCEPT {}
629 };
630 
641 {
642 public:
654  virtual void configurePlugin(const PluginTensorDesc* in, int nbInput, const PluginTensorDesc* out, int nbOutput) TRTNOEXCEPT = 0;
655 
687  virtual bool supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) const TRTNOEXCEPT = 0;
688 
689 protected:
697  TRT_DEPRECATED
699  {
700  return (static_cast<int>(PluginVersion::kV2_IOEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
701  }
702 
707  TRT_DEPRECATED
709  const Dims*, int, const Dims*, int, DataType, PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
710  {
711  }
712 
717  TRT_DEPRECATED
718  void configurePlugin(const Dims*, int, const Dims*, int, const DataType*, const DataType*, const bool*, const bool*,
719  PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
720  {
721  }
722 
727  TRT_DEPRECATED
729  {
730  return false;
731  }
732 };
733 
738 
739 enum class PluginFieldType : int
740 {
741  kFLOAT16 = 0,
742  kFLOAT32 = 1,
743  kFLOAT64 = 2,
744  kINT8 = 3,
745  kINT16 = 4,
746  kINT32 = 5,
747  kCHAR = 6,
748  kDIMS = 7,
749  kUNKNOWN = 8
750 };
751 
760 {
764  const char* name{nullptr};
768  const void* data{nullptr};
773  PluginFieldType type{PluginFieldType::kUNKNOWN};
777  int32_t length{0};
778 
779  PluginField(const char* name_ = nullptr, const void* data_ = nullptr, const PluginFieldType type_ = PluginFieldType::kUNKNOWN, int32_t length_ = 0)
780  : name(name_)
781  , data(data_)
782  , type(type_)
783  , length(length_)
784  {
785  }
786 };
787 
789 {
790  int nbFields;
792 };
793 
801 
803 {
804 public:
808  virtual int getTensorRTVersion() const TRTNOEXCEPT { return NV_TENSORRT_VERSION; }
809 
813  virtual const char* getPluginName() const TRTNOEXCEPT = 0;
814 
818  virtual const char* getPluginVersion() const TRTNOEXCEPT = 0;
819 
824  virtual const PluginFieldCollection* getFieldNames() TRTNOEXCEPT = 0;
825 
829  virtual IPluginV2* createPlugin(const char* name, const PluginFieldCollection* fc) TRTNOEXCEPT = 0;
830 
834  virtual IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) TRTNOEXCEPT = 0;
835 
842  virtual void setPluginNamespace(const char* pluginNamespace) TRTNOEXCEPT = 0;
843 
847  virtual const char* getPluginNamespace() const TRTNOEXCEPT = 0;
848 
849  virtual ~IPluginCreator() {}
850 };
851 
866 
868 {
869 public:
874  virtual bool registerCreator(IPluginCreator& creator, const char* pluginNamespace) noexcept = 0;
875 
880  virtual IPluginCreator* const* getPluginCreatorList(int* numCreators) const noexcept = 0;
881 
886  virtual IPluginCreator* getPluginCreator(const char* pluginType, const char* pluginVersion, const char* pluginNamespace = "") noexcept = 0;
887 
888 protected:
889  virtual ~IPluginRegistry() noexcept {}
890 
891 public:
901  //
904  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
905 
917  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
918 };
919 
920 
925 enum class TensorLocation : int
926 {
927  kDEVICE = 0,
928  kHOST = 1,
929 };
930 
931 template <>
932 constexpr inline int EnumMax<TensorLocation>()
933 {
934  return 2;
935 }
936 
943 {
944 public:
959  virtual void* allocate(uint64_t size, uint64_t alignment, uint32_t flags) TRTNOEXCEPT = 0;
960 
968  virtual void free(void* memory) TRTNOEXCEPT = 0;
969 
974  virtual ~IGpuAllocator() {}
975 };
976 
985 class ILogger
986 {
987 public:
993  enum class Severity : int
994  {
995  kINTERNAL_ERROR = 0,
996  kERROR = 1,
997  kWARNING = 2,
998  kINFO = 3,
999  kVERBOSE = 4,
1000  };
1001 
1008  virtual void log(Severity severity, const char* msg) TRTNOEXCEPT = 0;
1009 
1010  virtual ~ILogger() {}
1011 };
1012 
1013 template <>
1014 constexpr inline int EnumMax<ILogger::Severity>()
1015 {
1016  return 5;
1017 }
1018 
1024 enum class ErrorCode : int
1025 {
1029  kSUCCESS = 0,
1030 
1034  kUNSPECIFIED_ERROR = 1,
1035 
1039  kINTERNAL_ERROR = 2,
1040 
1045  kINVALID_ARGUMENT = 3,
1046 
1054  kINVALID_CONFIG = 4,
1055 
1061  kFAILED_ALLOCATION = 5,
1062 
1068 
1075  kFAILED_EXECUTION = 7,
1076 
1083  kFAILED_COMPUTATION = 8,
1084 
1097  kINVALID_STATE = 9,
1098 
1109  kUNSUPPORTED_STATE = 10,
1110 
1111 };
1112 
1113 template <>
1114 constexpr inline int EnumMax<ErrorCode>()
1115 {
1116  return 11;
1117 }
1118 
1119 
1142 {
1143 public:
1147  using ErrorDesc = const char*;
1148 
1152  using RefCount = int32_t;
1153 
1154  virtual ~IErrorRecorder() noexcept {};
1155 
1156  // Public API’s used to retrieve information from the error recorder.
1157 
1171  virtual int32_t getNbErrors() const noexcept = 0;
1172 
1185  virtual ErrorCode getErrorCode(int32_t errorIdx) const noexcept = 0;
1186 
1201  virtual ErrorDesc getErrorDesc(int32_t errorIdx) const noexcept = 0;
1202 
1212  virtual bool hasOverflowed() const noexcept = 0;
1213 
1223  virtual void clear() noexcept = 0;
1224 
1225  // API’s used by TensorRT to report Error information to the application.
1226 
1239  virtual bool reportError(ErrorCode val, ErrorDesc desc) noexcept = 0;
1240 
1253  virtual RefCount incRefCount() noexcept = 0;
1254 
1266  virtual RefCount decRefCount() noexcept = 0;
1267 
1268 }; // class IErrorRecorder
1269 
1270 } // namespace nvinfer1
1271 
1272 extern "C" TENSORRTAPI void* createSafeInferRuntime_INTERNAL(void* logger, int version);
1273 
1277 extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger();
1278 
1284 extern "C" TENSORRTAPI int getInferLibVersion();
1285 
1289 extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry();
1290 
1291 namespace nvinfer1
1292 {
1293 
1300 template <typename T>
1302 {
1303 public:
1304  PluginRegistrar() { getPluginRegistry()->registerCreator(instance, ""); }
1305 private:
1306  T instance{};
1307 };
1308 
1309 #define REGISTER_TENSORRT_PLUGIN(name) \
1310  static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
1311 
1312 } // namespace nvinfer1
1313 
1314 #endif // NV_INFER_RUNTIME_COMMON_H
Perform the normal matrix multiplication in the first recurrent layer.
DataType
The type of weights and tensors.
Definition: NvInferRuntimeCommon.h:162
constexpr int EnumMax< ErrorCode >()
Maximum number of elements in ErrorCode enum.
Definition: NvInferRuntimeCommon.h:1114
int32_t RefCount
Definition: NvInferRuntimeCommon.h:1152
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:343
TRT_DEPRECATED void configurePlugin(const Dims *, int, const Dims *, int, const DataType *, const DataType *, const bool *, const bool *, PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
Deprecated interface inheriting from base class. Derived classes should not implement this...
Definition: NvInferRuntimeCommon.h:718
Single gate RNN w/ TANH activation function.
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: NvInferRuntimeCommon.h:112
PluginFieldType
Definition: NvInferRuntimeCommon.h:739
TRT_DEPRECATED void configureWithFormat(const Dims *, int, const Dims *, int, DataType, PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
Deprecated interface inheriting from base class. Derived classes should not implement this...
Definition: NvInferRuntimeCommon.h:708
Parametric softplus activation: alpha*log(exp(beta*x)+1)
const PluginField * fields
Pointer to PluginField entries.
Definition: NvInferRuntimeCommon.h:791
nvinfer1::IPluginRegistry * getPluginRegistry()
Return the plugin registry.
Severity
Definition: NvInferRuntimeCommon.h:993
Definition: NvInferRuntimeCommon.h:788
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:925
void * createSafeInferRuntime_INTERNAL(void *logger, int version)
Internal C entry point for creating safe::IRuntime.
constexpr int EnumMax< TensorFormat >()
Maximum number of elements in TensorFormat enum.
Definition: NvInferRuntimeCommon.h:295
virtual void attachToContext(cudnnContext *, cublasContext *, IGpuAllocator *)
Attach the plugin object to an execution context and grant the plugin the access to some context reso...
Definition: NvInferRuntimeCommon.h:595
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntimeCommon.h:1301
Scaled tanh activation: alpha*tanh(beta*x)
Per-channel coefficients.
Elements correspond to different spatial data.
Clip activation: max(alpha, min(beta, x))
TRT_DEPRECATED int getTensorRTVersion() const _TENSORRT_OVERRIDE
Return the API version with which this plugin was built. The upper byte is reserved by TensorRT and i...
Definition: NvInferRuntimeCommon.h:698
The TensorRT API version 1 namespace.
Data stored on device.
Elements correspond to different sequence values.
virtual ~IGpuAllocator()
Definition: NvInferRuntimeCommon.h:974
virtual void detachFromContext()
Detach the plugin object from its execution context.
Definition: NvInferRuntimeCommon.h:603
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:867
Plugin creator class for user implemented layers.
Definition: NvInferRuntimeCommon.h:802
Elu activation: x>=0 ? x : alpha * (exp(x) - 1).
Structure containing plugin attribute field names and associated data This information can be parsed ...
Definition: NvInferRuntimeCommon.h:759
nvinfer1::Dims field type.
ActivationType
Forward declare IGpuAllocator for use in other interfaces.
Definition: NvInferRuntimeCommon.h:133
int getInferLibVersion()
Return the library version number.
constexpr int EnumMax< TensorLocation >()
Maximum number of elements in TensorLocation enum.
Definition: NvInferRuntimeCommon.h:932
Data stored on host.
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1141
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:205
const char * ErrorDesc
Definition: NvInferRuntimeCommon.h:1147
constexpr int EnumMax< DimensionType >()
Maximum number of elements in DimensionType enum.
Definition: NvInferRuntimeCommon.h:189
int getTensorRTVersion() const _TENSORRT_OVERRIDE
Return the API version with which this plugin was built. The upper byte reserved by TensorRT and is u...
Definition: NvInferRuntimeCommon.h:619
void configureWithFormat(const Dims *, int, const Dims *, int, DataType, PluginFormat, int) _TENSORRT_OVERRIDE
Derived classes should not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntimeCommon.h:627
Single gate RNN w/ ReLU activation function.
uint32_t TensorFormats
It is capable of representing one or more TensorFormat by binary OR operations, e.g., 1U << TensorFormats::kCHW4 | 1U << TensorFormats::kCHW32.
Definition: NvInferRuntimeCommon.h:220
ErrorCode
Error codes that can be returned by TensorRT during execution.
Definition: NvInferRuntimeCommon.h:1024
<– Deprecated, used for backward compatibility
constexpr int EnumMax< DataType >()
Maximum number of elements in DataType enum.
Definition: NvInferRuntimeCommon.h:171
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:640
Enable Int8 layer selection.
int nbDims
The number of dimensions.
Definition: NvInferRuntimeCommon.h:209
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntimeCommon.h:235
Application-implemented logging interface for the builder, engine and runtime.
Definition: NvInferRuntimeCommon.h:985
TRT_DEPRECATED bool supportsFormat(DataType, PluginFormat) const _TENSORRT_OVERRIDE _TENSORRT_FINAL
Deprecated interface inheriting from base class. Derived classes should not implement this...
Definition: NvInferRuntimeCommon.h:728
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:310
virtual bool registerCreator(IPluginCreator &creator, const char *pluginNamespace) noexcept=0
Register a plugin creator. Returns false if one with same type is already registered.
Selu activation: x>0 ? beta * x : beta * (alpha*exp(x) - alpha)
constexpr int EnumMax()
Maximum number of elements in an enumeration type.
DimensionType
The type of data encoded across this dimension.
Definition: NvInferRuntimeCommon.h:180
Thresholded ReLU activation: x>alpha ? x : 0.
virtual int getTensorRTVersion() const
Return the version of the API the plugin creator was compiled with.
Definition: NvInferRuntimeCommon.h:808
#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:942
<– Deprecated, used for backward compatibility
nvinfer1::ILogger * getLogger()
Return the logger object.
Definition of plugin versions.
Elements correspond to different batch index.
LeakyRelu activation: x>=0 ? x : alpha * x.
constexpr int EnumMax< ActivationType >()
Maximum number of elements in ActivationType enum.
Definition: NvInferRuntimeCommon.h:153
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:513
Hard sigmoid activation: max(0, min(1, alpha*x+beta))
<– Deprecated, used for backward compatibility
int nbFields
Number of PluginField entries.
Definition: NvInferRuntimeCommon.h:790
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:113
Softsign activation: x / (1+|x|)
virtual int getTensorRTVersion() const
Return the API version with which this plugin was built.
Definition: NvInferRuntimeCommon.h:351