TensorRT  7.0.0.11
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  kBOOL = 4
169 };
170 
171 template <>
172 constexpr inline int EnumMax<DataType>()
173 {
174  return 5;
175 }
176 
181 enum class DimensionType : int
182 {
183  kSPATIAL = 0,
184  kCHANNEL = 1,
185  kINDEX = 2,
186  kSEQUENCE = 3
187 };
188 
189 template <>
190 constexpr inline int EnumMax<DimensionType>()
191 {
192  return 4;
193 }
194 
206 class Dims
207 {
208 public:
209  static const int MAX_DIMS = 8;
210  int nbDims;
211  int d[MAX_DIMS];
212  TRT_DEPRECATED DimensionType type[MAX_DIMS];
213 };
214 
221 typedef uint32_t TensorFormats;
222 
236 enum class TensorFormat : int
237 {
242  kLINEAR = 0,
243  kNCHW TRT_DEPRECATED_ENUM = kLINEAR,
244 
251  kCHW2 = 1,
252  kNC2HW2 TRT_DEPRECATED_ENUM = kCHW2,
253 
260  kHWC8 = 2,
261  kNHWC8 TRT_DEPRECATED_ENUM = kHWC8,
262 
269  kCHW4 = 3,
270 
277  kCHW16 = 4,
278 
285  kCHW32 = 5
286 };
287 
294 
295 template <>
296 constexpr inline int EnumMax<TensorFormat>()
297 {
298  return 6;
299 }
300 
312 {
313  Dims dims;
314  DataType type;
315  TensorFormat format;
316  float scale;
317 };
318 
325 enum class PluginVersion : uint8_t
326 {
327  kV2 = 0,
328  kV2_EXT = 1,
329  kV2_IOEXT = 2,
330  kV2_DYNAMICEXT = 3,
331 };
332 
345 {
346 public:
352  virtual int getTensorRTVersion() const TRTNOEXCEPT
353  {
354  return NV_TENSORRT_VERSION;
355  }
356 
359  // \see IPluginCreator::getPluginName()
361  virtual const char* getPluginType() const TRTNOEXCEPT = 0;
362 
365  // \see IPluginCreator::getPluginVersion()
367  virtual const char* getPluginVersion() const TRTNOEXCEPT = 0;
368 
376  virtual int getNbOutputs() const TRTNOEXCEPT = 0;
377 
387  virtual Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) TRTNOEXCEPT = 0;
388 
403  virtual bool supportsFormat(DataType type, PluginFormat format) const TRTNOEXCEPT = 0;
404 
425  virtual void configureWithFormat(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, DataType type, PluginFormat format, int maxBatchSize) TRTNOEXCEPT = 0;
426 
432  virtual int initialize() TRTNOEXCEPT = 0;
433 
438  virtual void terminate() TRTNOEXCEPT = 0;
439 
448  virtual size_t getWorkspaceSize(int maxBatchSize) const TRTNOEXCEPT = 0;
449 
461  virtual int enqueue(int batchSize, const void* const* inputs, void** outputs, void* workspace, cudaStream_t stream) TRTNOEXCEPT = 0;
462 
468  virtual size_t getSerializationSize() const TRTNOEXCEPT = 0;
469 
477  virtual void serialize(void* buffer) const TRTNOEXCEPT = 0;
478 
482  virtual void destroy() TRTNOEXCEPT = 0;
483 
487  virtual IPluginV2* clone() const TRTNOEXCEPT = 0;
488 
493  virtual void setPluginNamespace(const char* pluginNamespace) TRTNOEXCEPT = 0;
494 
498  virtual const char* getPluginNamespace() const TRTNOEXCEPT = 0;
499 
500 protected:
501  virtual ~IPluginV2() {}
502 };
503 
514 class IPluginV2Ext : public IPluginV2
515 {
516 public:
523  virtual nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputTypes, int nbInputs) const TRTNOEXCEPT = 0;
524 
535  virtual bool isOutputBroadcastAcrossBatch(int outputIndex, const bool* inputIsBroadcasted, int nbInputs) const TRTNOEXCEPT = 0;
536 
550  virtual bool canBroadcastInputAcrossBatch(int inputIndex) const TRTNOEXCEPT = 0;
551 
578 
579  virtual void configurePlugin(const Dims* inputDims, int nbInputs, const Dims* outputDims,
580  int nbOutputs, const DataType* inputTypes, const DataType* outputTypes,
581  const bool* inputIsBroadcast, const bool* outputIsBroadcast, PluginFormat floatFormat, int maxBatchSize) TRTNOEXCEPT = 0;
582 
583  virtual ~IPluginV2Ext() {}
584 
596  virtual void attachToContext(cudnnContext* /*cudnn*/, cublasContext* /*cublas*/, IGpuAllocator* /*allocator*/) TRTNOEXCEPT {}
597 
604  virtual void detachFromContext() TRTNOEXCEPT {}
605 
611  virtual IPluginV2Ext* clone() const _TENSORRT_OVERRIDE TRTNOEXCEPT = 0;
612 
613 protected:
620  int getTensorRTVersion() const _TENSORRT_OVERRIDE TRTNOEXCEPT
621  {
622  return (static_cast<int>(PluginVersion::kV2_EXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
623  }
624 
628  void configureWithFormat(const Dims* /*inputDims*/, int /*nbInputs*/, const Dims* /*outputDims*/,
629  int /*nbOutputs*/, DataType /*type*/, PluginFormat /*format*/, int /*maxBatchSize*/) _TENSORRT_OVERRIDE TRTNOEXCEPT {}
630 };
631 
642 {
643 public:
655  virtual void configurePlugin(const PluginTensorDesc* in, int nbInput, const PluginTensorDesc* out, int nbOutput) TRTNOEXCEPT = 0;
656 
688  virtual bool supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) const TRTNOEXCEPT = 0;
689 
690 protected:
698  TRT_DEPRECATED
700  {
701  return (static_cast<int>(PluginVersion::kV2_IOEXT) << 24 | (NV_TENSORRT_VERSION & 0xFFFFFF));
702  }
703 
708  TRT_DEPRECATED
710  const Dims*, int, const Dims*, int, DataType, PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
711  {
712  }
713 
718  TRT_DEPRECATED
719  void configurePlugin(const Dims*, int, const Dims*, int, const DataType*, const DataType*, const bool*, const bool*,
720  PluginFormat, int) _TENSORRT_OVERRIDE _TENSORRT_FINAL
721  {
722  }
723 
728  TRT_DEPRECATED
730  {
731  return false;
732  }
733 };
734 
739 
740 enum class PluginFieldType : int
741 {
742  kFLOAT16 = 0,
743  kFLOAT32 = 1,
744  kFLOAT64 = 2,
745  kINT8 = 3,
746  kINT16 = 4,
747  kINT32 = 5,
748  kCHAR = 6,
749  kDIMS = 7,
750  kUNKNOWN = 8
751 };
752 
761 {
765  const char* name{nullptr};
769  const void* data{nullptr};
774  PluginFieldType type{PluginFieldType::kUNKNOWN};
778  int32_t length{0};
779 
780  PluginField(const char* name_ = nullptr, const void* data_ = nullptr, const PluginFieldType type_ = PluginFieldType::kUNKNOWN, int32_t length_ = 0)
781  : name(name_)
782  , data(data_)
783  , type(type_)
784  , length(length_)
785  {
786  }
787 };
788 
790 {
791  int nbFields;
793 };
794 
802 
804 {
805 public:
809  virtual int getTensorRTVersion() const TRTNOEXCEPT { return NV_TENSORRT_VERSION; }
810 
814  virtual const char* getPluginName() const TRTNOEXCEPT = 0;
815 
819  virtual const char* getPluginVersion() const TRTNOEXCEPT = 0;
820 
825  virtual const PluginFieldCollection* getFieldNames() TRTNOEXCEPT = 0;
826 
830  virtual IPluginV2* createPlugin(const char* name, const PluginFieldCollection* fc) TRTNOEXCEPT = 0;
831 
835  virtual IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) TRTNOEXCEPT = 0;
836 
843  virtual void setPluginNamespace(const char* pluginNamespace) TRTNOEXCEPT = 0;
844 
848  virtual const char* getPluginNamespace() const TRTNOEXCEPT = 0;
849 
850  virtual ~IPluginCreator() {}
851 };
852 
867 
869 {
870 public:
875  virtual bool registerCreator(IPluginCreator& creator, const char* pluginNamespace) noexcept = 0;
876 
881  virtual IPluginCreator* const* getPluginCreatorList(int* numCreators) const noexcept = 0;
882 
887  virtual IPluginCreator* getPluginCreator(const char* pluginType, const char* pluginVersion, const char* pluginNamespace = "") noexcept = 0;
888 
889 protected:
890  virtual ~IPluginRegistry() noexcept {}
891 
892 public:
902  //
905  virtual void setErrorRecorder(IErrorRecorder* recorder) noexcept = 0;
906 
918  virtual IErrorRecorder* getErrorRecorder() const noexcept = 0;
919 };
920 
921 
926 enum class TensorLocation : int
927 {
928  kDEVICE = 0,
929  kHOST = 1,
930 };
931 
932 template <>
933 constexpr inline int EnumMax<TensorLocation>()
934 {
935  return 2;
936 }
937 
944 {
945 public:
960  virtual void* allocate(uint64_t size, uint64_t alignment, uint32_t flags) TRTNOEXCEPT = 0;
961 
969  virtual void free(void* memory) TRTNOEXCEPT = 0;
970 
975  virtual ~IGpuAllocator() {}
976 };
977 
986 class ILogger
987 {
988 public:
994  enum class Severity : int
995  {
996  kINTERNAL_ERROR = 0,
997  kERROR = 1,
998  kWARNING = 2,
999  kINFO = 3,
1000  kVERBOSE = 4,
1001  };
1002 
1009  virtual void log(Severity severity, const char* msg) TRTNOEXCEPT = 0;
1010 
1011  virtual ~ILogger() {}
1012 };
1013 
1014 template <>
1015 constexpr inline int EnumMax<ILogger::Severity>()
1016 {
1017  return 5;
1018 }
1019 
1025 enum class ErrorCode : int
1026 {
1030  kSUCCESS = 0,
1031 
1035  kUNSPECIFIED_ERROR = 1,
1036 
1040  kINTERNAL_ERROR = 2,
1041 
1046  kINVALID_ARGUMENT = 3,
1047 
1055  kINVALID_CONFIG = 4,
1056 
1062  kFAILED_ALLOCATION = 5,
1063 
1069 
1076  kFAILED_EXECUTION = 7,
1077 
1084  kFAILED_COMPUTATION = 8,
1085 
1098  kINVALID_STATE = 9,
1099 
1110  kUNSUPPORTED_STATE = 10,
1111 
1112 };
1113 
1114 template <>
1115 constexpr inline int EnumMax<ErrorCode>()
1116 {
1117  return 11;
1118 }
1119 
1120 
1143 {
1144 public:
1148  using ErrorDesc = const char*;
1149 
1153  using RefCount = int32_t;
1154 
1155  virtual ~IErrorRecorder() noexcept {};
1156 
1157  // Public API’s used to retrieve information from the error recorder.
1158 
1172  virtual int32_t getNbErrors() const noexcept = 0;
1173 
1186  virtual ErrorCode getErrorCode(int32_t errorIdx) const noexcept = 0;
1187 
1202  virtual ErrorDesc getErrorDesc(int32_t errorIdx) const noexcept = 0;
1203 
1213  virtual bool hasOverflowed() const noexcept = 0;
1214 
1224  virtual void clear() noexcept = 0;
1225 
1226  // API’s used by TensorRT to report Error information to the application.
1227 
1240  virtual bool reportError(ErrorCode val, ErrorDesc desc) noexcept = 0;
1241 
1254  virtual RefCount incRefCount() noexcept = 0;
1255 
1267  virtual RefCount decRefCount() noexcept = 0;
1268 
1269 }; // class IErrorRecorder
1270 
1271 } // namespace nvinfer1
1272 
1277 extern "C" TENSORRTAPI void* createSafeInferRuntime_INTERNAL(void* logger, int version);
1278 
1282 extern "C" TENSORRTAPI nvinfer1::ILogger* getLogger();
1283 
1289 extern "C" TENSORRTAPI int getInferLibVersion();
1290 
1294 extern "C" TENSORRTAPI nvinfer1::IPluginRegistry* getPluginRegistry();
1295 
1296 namespace nvinfer1
1297 {
1298 
1305 template <typename T>
1307 {
1308 public:
1309  PluginRegistrar() { getPluginRegistry()->registerCreator(instance, ""); }
1310 private:
1311  T instance{};
1312 };
1313 
1314 #define REGISTER_TENSORRT_PLUGIN(name) \
1315  static nvinfer1::PluginRegistrar<name> pluginRegistrar##name {}
1316 
1317 } // namespace nvinfer1
1318 
1319 #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:1115
int32_t RefCount
Definition: NvInferRuntimeCommon.h:1153
virtual int getTensorRTVersion() const
Return the API version with which this plugin was built.
Definition: NvInferRuntimeCommon.h:352
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:344
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:719
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:740
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:709
Parametric softplus activation: alpha*log(exp(beta*x)+1)
const PluginField * fields
Pointer to PluginField entries.
Definition: NvInferRuntimeCommon.h:792
nvinfer1::IPluginRegistry * getPluginRegistry()
Return the plugin registry.
Severity
Definition: NvInferRuntimeCommon.h:994
Definition: NvInferRuntimeCommon.h:789
TensorLocation
The location for tensor data storage, device or host.
Definition: NvInferRuntimeCommon.h:926
constexpr int EnumMax< TensorFormat >()
Maximum number of elements in TensorFormat enum.
Definition: NvInferRuntimeCommon.h:296
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:596
Register the plugin creator to the registry The static registry object will be instantiated when the ...
Definition: NvInferRuntimeCommon.h:1306
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:699
The TensorRT API version 1 namespace.
Data stored on device.
Elements correspond to different sequence values.
virtual ~IGpuAllocator()
Definition: NvInferRuntimeCommon.h:975
virtual void detachFromContext()
Detach the plugin object from its execution context.
Definition: NvInferRuntimeCommon.h:604
Single registration point for all plugins in an application. It is used to find plugin implementation...
Definition: NvInferRuntimeCommon.h:868
Plugin creator class for user implemented layers.
Definition: NvInferRuntimeCommon.h:803
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:760
virtual int getTensorRTVersion() const
Return the version of the API the plugin creator was compiled with.
Definition: NvInferRuntimeCommon.h:809
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:933
Data stored on host.
Reference counted application-implemented error reporting interface for TensorRT objects.
Definition: NvInferRuntimeCommon.h:1142
Structure to define the dimensions of a tensor.
Definition: NvInferRuntimeCommon.h:206
const char * ErrorDesc
Definition: NvInferRuntimeCommon.h:1148
constexpr int EnumMax< DimensionType >()
Maximum number of elements in DimensionType enum.
Definition: NvInferRuntimeCommon.h:190
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:620
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:628
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:221
ErrorCode
Error codes that can be returned by TensorRT during execution.
Definition: NvInferRuntimeCommon.h:1025
<– Deprecated, used for backward compatibility
constexpr int EnumMax< DataType >()
Maximum number of elements in DataType enum.
Definition: NvInferRuntimeCommon.h:172
Plugin class for user-implemented layers.
Definition: NvInferRuntimeCommon.h:641
Enable Int8 layer selection, with FP32 fallback with FP16 fallback if kFP16 also specified.
int nbDims
The number of dimensions.
Definition: NvInferRuntimeCommon.h:210
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
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:729
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimeCommon.h:311
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:181
Thresholded ReLU activation: x>alpha ? x : 0.
#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
<– 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:514
Hard sigmoid activation: max(0, min(1, alpha*x+beta))
<– Deprecated, used for backward compatibility
int nbFields
Number of PluginField entries.
Definition: NvInferRuntimeCommon.h:791
struct CUevent_st * cudaEvent_t
Forward declaration of cudaEvent_t.
Definition: NvInferRuntimeCommon.h:113
Softsign activation: x / (1+|x|)