18#ifndef NV_INFER_RUNTIME_PLUGIN_H 
   19#define NV_INFER_RUNTIME_PLUGIN_H 
   21#define NV_INFER_INTERNAL_INCLUDE 1 
   23#undef NV_INFER_INTERNAL_INCLUDE 
   59static constexpr int32_t kPLUGIN_VERSION_PYTHON_BIT = 0x40;
 
  186    virtual 
AsciiChar const* getPluginVersion() const noexcept = 0;
 
  201    virtual int32_t getNbOutputs() const noexcept = 0;
 
  226    virtual 
Dims getOutputDimensions(int32_t index, 
Dims const* inputs, int32_t nbInputDims) noexcept = 0;
 
  285    virtual 
void configureWithFormat(
Dims const* inputDims, int32_t nbInputs, 
Dims const* outputDims, int32_t nbOutputs,
 
  300    virtual int32_t initialize() noexcept = 0;
 
  315    virtual 
void terminate() noexcept = 0;
 
  334    virtual 
size_t getWorkspaceSize(int32_t maxBatchSize) const noexcept = 0;
 
  357    virtual int32_t enqueue(int32_t batchSize, 
void const* const* inputs, 
void* const* outputs, 
void* workspace,
 
  358        cudaStream_t stream) noexcept
 
  371    virtual 
size_t getSerializationSize() const noexcept = 0;
 
  386    virtual 
void serialize(
void* buffer) const noexcept = 0;
 
  396    virtual 
void destroy() noexcept = 0;
 
  431    virtual 
void setPluginNamespace(
AsciiChar const* pluginNamespace) noexcept = 0;
 
  444    virtual 
AsciiChar const* getPluginNamespace() const noexcept = 0;
 
  524        int32_t outputIndex, 
bool const* inputIsBroadcasted, int32_t nbInputs) 
const noexcept 
  592        DataType const* inputTypes, 
DataType const* outputTypes, 
bool const* inputIsBroadcast,
 
  593        bool const* outputIsBroadcast, 
PluginFormat floatFormat, int32_t maxBatchSize) 
noexcept 
  692    int32_t getTensorRTVersion() const noexcept
 override 
  784        int32_t pos, 
PluginTensorDesc const* inOut, int32_t nbInputs, int32_t nbOutputs) 
const noexcept 
  868    virtual 
AsciiChar const* getPluginVersion() const noexcept = 0;
 
  912    virtual 
IPluginV2* deserializePlugin(
AsciiChar const* name, 
void const* serialData, 
size_t serialLength) noexcept
 
  929    virtual 
void setPluginNamespace(
AsciiChar const* pluginNamespace) noexcept = 0;
 
  943    virtual 
AsciiChar const* getPluginNamespace() const noexcept = 0;
 
#define NV_TENSORRT_VERSION
Definition: NvInferRuntimeBase.h:101
 
#define TRT_DEPRECATED
Definition: NvInferRuntimeBase.h:42
 
#define TRT_DEPRECATED_ENUM
Definition: NvInferRuntimeBase.h:43
 
Application-implemented class for controlling allocation on the GPU.
 
Definition: NvInferRuntimeBase.h:218
 
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:474
 
virtual TRT_DEPRECATED bool canBroadcastInputAcrossBatch(int32_t inputIndex) const noexcept=0
Return true if the plugin can use an input tensor that is broadcast across batch without replication.
 
~IPluginV2Ext() override=default
 
void configureWithFormat(Dims const *, int32_t, Dims const *, int32_t, DataType, PluginFormat, int32_t) noexcept override
Derived classes must not implement this. In a C++11 API it would be override final.
Definition: NvInferRuntimePlugin.h:704
 
IPluginV2Ext * clone() const noexcept override=0
Clone the plugin object. This copies over internal plugin parameters as well and returns a new plugin...
 
virtual void configurePlugin(Dims const *inputDims, int32_t nbInputs, Dims const *outputDims, int32_t nbOutputs, DataType const *inputTypes, DataType const *outputTypes, bool const *inputIsBroadcast, bool const *outputIsBroadcast, PluginFormat floatFormat, int32_t maxBatchSize) noexcept=0
Configure the layer with input and output data types.
 
virtual void detachFromContext() noexcept
Detach the plugin object from its execution context.
Definition: NvInferRuntimePlugin.h:651
 
virtual TRT_DEPRECATED bool isOutputBroadcastAcrossBatch(int32_t outputIndex, bool const *inputIsBroadcasted, int32_t nbInputs) const noexcept=0
Return true if the output tensor is broadcast across a batch.
 
virtual void attachToContext(cudnnContext *, cublasContext *, IGpuAllocator *) noexcept
Attach the plugin object to an execution context and grant the plugin the access to some context reso...
Definition: NvInferRuntimePlugin.h:633
 
virtual nvinfer1::DataType getOutputDataType(int32_t index, nvinfer1::DataType const *inputTypes, int32_t nbInputs) const noexcept=0
Return the DataType of the plugin output at the requested index.
 
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:139
 
virtual AsciiChar const * getPluginType() const noexcept=0
Return the plugin type. Should match the plugin name returned by the corresponding plugin creator.
 
virtual int32_t getTensorRTVersion() const noexcept
Return the API version with which this plugin was built.
Definition: NvInferRuntimePlugin.h:153
 
Plugin class for user-implemented layers.
Definition: NvInferRuntimePlugin.h:723
 
int32_t getTensorRTVersion() const noexcept override
Return the API version with which this plugin was built. The upper byte is reserved by TensorRT and i...
Definition: NvInferRuntimePlugin.h:811
 
virtual void configurePlugin(PluginTensorDesc const *in, int32_t nbInput, PluginTensorDesc const *out, int32_t nbOutput) noexcept=0
Configure the layer.
 
virtual bool supportsFormatCombination(int32_t pos, PluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs) const noexcept=0
Return true if plugin supports the format and datatype for the input/output indexed by pos.
 
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:243
 
Definition: NvInferRuntime.h:1656
 
Definition: NvInferRuntimePlugin.h:840
 
virtual AsciiChar const * getPluginName() const noexcept=0
Return the plugin name.
 
Definition: NvInferPluginBase.h:193
 
The TensorRT API version 1 namespace.
 
PluginCreatorVersion
Enum to identify version of the plugin creator.
Definition: NvInferRuntimePlugin.h:117
 
@ kV1_PYTHON
IPluginCreator-based Python plugin creators.
 
v_1_0::IPluginCreator IPluginCreator
Definition: NvInferRuntimePlugin.h:976
 
v_1_0::IGpuAllocator IGpuAllocator
Definition: NvInferRuntime.h:1855
 
char_t AsciiChar
Definition: NvInferRuntimeBase.h:115
 
@ kV2_DYNAMICEXT
IPluginV2DynamicExt.
 
@ kV2_IOEXT
IPluginV2IOExt.
 
@ kV2_DYNAMICEXT_PYTHON
IPluginV2DynamicExt-based Python plugins.
 
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:145
 
TensorFormat PluginFormat
PluginFormat is reserved for backward compatibility.
Definition: NvInferRuntimePlugin.h:54
 
TensorFormat
Format of the input/output tensors.
Definition: NvInferRuntime.h:1430
 
Definition of plugin versions.
 
Plugin field collection struct.
Definition: NvInferPluginBase.h:103
 
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimePlugin.h:73
 
DataType type
Definition: NvInferRuntimePlugin.h:77
 
Dims dims
Dimensions.
Definition: NvInferRuntimePlugin.h:75
 
TensorFormat format
Tensor format.
Definition: NvInferRuntimePlugin.h:79
 
float scale
Scale for INT8 data type.
Definition: NvInferRuntimePlugin.h:81