25#ifndef NV_INFER_SAFE_PLUGIN_H
26#define NV_INFER_SAFE_PLUGIN_H
43struct RuntimeErrorInformation;
44struct TensorDescriptor;
231 AsciiChar const*
const pluginVersion,
AsciiChar const*
const pluginNamespace =
"") noexcept = 0;
383 virtual
AsciiChar const* getPluginName() const noexcept = 0;
395 virtual
AsciiChar const* getPluginVersion() const noexcept = 0;
408 virtual
AsciiChar const* getPluginNamespace() const noexcept = 0;
428 static constexpr int32_t kDEFAULT_FORMAT_COMBINATION_LIMIT = 100;
484 virtual int32_t configurePlugin(
503 virtual int32_t getOutputDataTypes(
504 DataType* outputTypes, int32_t nbOutputs,
DataType const* inputTypes, int32_t nbInputs) const noexcept
527 virtual int32_t getOutputShapes(
528 Dims const* inputs, int32_t nbInputs,
Dims* outputs, int32_t nbOutputs) const noexcept = 0;
564 virtual
bool supportsFormatCombination(
565 int32_t pos,
TensorDescriptor const* inOut, int32_t nbInputs, int32_t nbOutputs) noexcept = 0;
572 virtual int32_t getNbOutputs() const noexcept = 0;
654 return kDEFAULT_FORMAT_COMBINATION_LIMIT;
691 Dims const* , int32_t ,
Dims* , int32_t )
const noexcept override
725 virtual int32_t getSymbolicOutputShapes(
nvinfer1::DimsExprs const* inputs, int32_t nbInputs,
726 nvinfer1::DimsExprs* outputs, int32_t nbOutputs,
nvinfer1::IExprBuilder& exprBuilder) const noexcept = 0;
775 virtual int32_t setTactic(int32_t ) noexcept
796 void const*
const* inputs,
void*
const* outputs,
void* workspace, cudaStream_t stream)
noexcept = 0;
894 virtual
AsciiChar const* getPluginName() const noexcept = 0;
904 virtual
AsciiChar const* getPluginVersion() const noexcept = 0;
914 virtual
AsciiChar const* getPluginNamespace() const noexcept = 0;
Definition: NvInferRuntimeBase.h:222
Analog of class Dims with expressions instead of constants for the dimensions.
Definition: NvInferRuntime.h:350
Object for constructing IDimensionExpr.
Definition: NvInferRuntime.h:285
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:247
Definition: NvInferPluginBase.h:141
Definition: NvInferPluginBase.h:193
Definition: NvInferPluginBase.h:206
Interface for plugins used during the TensorRT build phase.
Definition: NvInferSafePlugin.h:422
~IPluginV3OneSafeBuild() noexcept override=default
Destructor for IPluginV3OneSafeBuild.
IPluginV3OneSafeBuild & operator=(IPluginV3OneSafeBuild &&) &=delete
Deleted move assignment operator to maintain non-movability.
virtual int32_t getValidTactics(int32_t *, int32_t) noexcept
Query for any custom tactics that the plugin intends to use.
Definition: NvInferSafePlugin.h:620
IPluginV3OneSafeBuild(IPluginV3OneSafeBuild &&)=delete
Deleted move constructor to maintain non-movability.
virtual int32_t getNbTactics() noexcept
Query for the number of custom tactics the plugin intends to use.
Definition: NvInferSafePlugin.h:628
virtual char const * getTimingCacheID() noexcept
Called to query the suffix to use for the timing cache ID. May be called anytime after plugin creatio...
Definition: NvInferSafePlugin.h:644
virtual int32_t getFormatCombinationLimit() noexcept
Return the maximum number of format combinations that will be timed by TensorRT during the build phas...
Definition: NvInferSafePlugin.h:652
IPluginV3OneSafeBuild & operator=(IPluginV3OneSafeBuild const &) &=default
IPluginV3OneSafeBuild()=default
Default constructor.
IPluginV3OneSafeBuild(IPluginV3OneSafeBuild const &)=default
virtual char const * getMetadataString() noexcept
Query for a string representing the configuration of the plugin. May be called anytime after plugin c...
Definition: NvInferSafePlugin.h:663
InterfaceInfo getInterfaceInfo() const noexcept override
Returns version information associated with this interface.
Definition: NvInferSafePlugin.h:437
This class provides build capability and let output shapes be calculated by symbolic expression to su...
Definition: NvInferSafePlugin.h:680
IPluginV3OneSafeBuildMSS(IPluginV3OneSafeBuildMSS const &)=default
Copy constructor.
~IPluginV3OneSafeBuildMSS() noexcept override=default
Destructor for IPluginV3OneSafeBuildMSS.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferSafePlugin.h:685
IPluginV3OneSafeBuildMSS(IPluginV3OneSafeBuildMSS &&)=delete
Move constructor.
int32_t getOutputShapes(Dims const *, int32_t, Dims *, int32_t) const noexcept override
Provide expressions for computing dimensions of the output tensors from dimensions of the input tenso...
Definition: NvInferSafePlugin.h:690
IPluginV3OneSafeBuildMSS & operator=(IPluginV3OneSafeBuildMSS const &) &=default
Copy assignment operator.
IPluginV3OneSafeBuildMSS & operator=(IPluginV3OneSafeBuildMSS &&) &=delete
Move assignment operator.
Interface specifying the base plugin capability.
Definition: NvInferSafePlugin.h:346
~IPluginV3OneSafeCore() noexcept override=default
Destructor for IPluginV3OneSafeCore.
IPluginV3OneSafeCore(IPluginV3OneSafeCore &&)=default
Move constructor.
IPluginV3OneSafeCore & operator=(IPluginV3OneSafeCore &&) &=default
Move assignment operator.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferSafePlugin.h:353
IPluginV3OneSafeCore & operator=(IPluginV3OneSafeCore const &) &=default
Copy assignment operator.
IPluginV3OneSafeCore(IPluginV3OneSafeCore const &)=default
Copy constructor.
Runtime component of the pluginV3 system.
Definition: NvInferSafePlugin.h:739
~IPluginV3OneSafeRuntime() noexcept override=default
Destructor for IPluginV3OneSafeRuntime.
virtual int32_t enqueue(TensorDescriptor const *inputDesc, TensorDescriptor const *outputDesc, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept=0
Execute the layer.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferSafePlugin.h:746
IPluginV3OneSafeRuntime(IPluginV3OneSafeRuntime &&)=default
Move constructor.
IPluginV3OneSafeRuntime(IPluginV3OneSafeRuntime const &)=default
Copy constructor.
IPluginV3OneSafeRuntime & operator=(IPluginV3OneSafeRuntime &&) &=default
Move assignment operator.
IPluginV3OneSafeRuntime & operator=(IPluginV3OneSafeRuntime const &) &=default
Copy assignment operator.
virtual int32_t initResource(ISafePluginResourceContext const *context) noexcept=0
This function will be called to initialize a plugin object after it is created (before execution phas...
virtual IPluginV3 * clone() noexcept=0
Clone the plugin object. This copies over internal plugin parameters and returns a new plugin object ...
Application-implemented class for controlling memory allocation on the GPU/CPU.
Definition: NvInferSafeMemAllocator.h:86
The main interface to be implemented by all plugin creator classes.
Definition: NvInferSafePlugin.h:847
virtual PluginFieldCollection const * getFieldNames() noexcept=0
Return a list of fields that need to be passed to createPlugin() when creating a plugin for use in th...
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferSafePlugin.h:854
virtual IPluginV3 * createPlugin(AsciiChar const *name, PluginFieldCollection const *fc, TensorRTPhase phase) noexcept=0
Return a plugin object. Return nullptr in case of error.
PluginRegistry interface class that contains all the methods user can use to interface with the regis...
Definition: NvInferSafePlugin.h:152
virtual ErrorCode registerCreator(IPluginCreatorInterface &creator, AsciiChar const *const pluginNamespace, ISafeRecorder &recorder) noexcept=0
Register a plugin creator.
virtual ErrorCode getAllCreators(IPluginCreatorInterface *const *&creators, int32_t &numCreators) const noexcept=0
Return all the registered plugin creators and the number of registered plugin creators.
virtual ErrorCode getCreator(IPluginCreatorInterface *&creator, AsciiChar const *const pluginName, AsciiChar const *const pluginVersion, AsciiChar const *const pluginNamespace="") noexcept=0
Return plugin creator based on plugin name, version, and namespace associated with plugin during netw...
Interface for plugins to access per context resources provided by TensorRT.
Definition: NvInferSafePlugin.h:61
virtual ISafeRecorder * getSafeRecorder() const noexcept=0
Returns the error recorder associated with this resource context.
virtual RuntimeErrorInformation * getRuntimeErrorInformation() const noexcept=0
Returns the RuntimeErrorInformation buffer associated with this resource context.
virtual ISafeMemAllocator * getSafeMemAllocator() const noexcept=0
Returns the GPU memory allocator associated with this resource context.
Interface for extended recorder which allows error, warn, debug, or info messages to be recorded.
Definition: NvInferSafeRecorder.h:82
The TensorRT API version 1 namespace.
Definition: NvInferSafePlugin.h:33
ErrorCode
Error codes that can be returned by TensorRT during execution.
Definition: NvInferRuntimeBase.h:315
TensorRTPhase
Indicates a phase of operation of TensorRT.
Definition: NvInferPluginBase.h:116
DataType
The type of weights and tensors. The datatypes other than kBOOL, kINT32, and kINT64 are "activation d...
Definition: NvInferRuntimeBase.h:149
nvinfer1::AsciiChar AsciiChar
Definition: NvInferForwardDecl.h:37
nvinfer2::safe::ISafePluginRegistry * getSafePluginRegistry(nvinfer2::safe::ISafeRecorder &recorder) noexcept
Get the SafePluginRegistry singleton instance and set the SafeRecorder of the safePluginRegistry.
Definition: NvInferConsistency.h:30
Plugin field collection struct.
Definition: NvInferPluginBase.h:103
A simple record summarizing various properties of a network IO Tensor.
Definition: NvInferSafeRuntime.h:285