18#ifndef TRT_PYTHON_IMPL_PLUGIN_H
19#define TRT_PYTHON_IMPL_PLUGIN_H
74 virtual
bool setNbSymExprs(int32_t count) noexcept = 0;
92 return mImpl->getSymExpr(index);
99 return mImpl->setSymExpr(index, symExpr);
105 return mImpl->getNbSymExprs();
112 return mImpl->setNbSymExprs(count);
143 virtual
bool setGridX(
ISymExpr* gridX) noexcept = 0;
146 virtual
bool setGridY(
ISymExpr* gridY) noexcept = 0;
149 virtual
bool setGridZ(
ISymExpr* gridZ) noexcept = 0;
152 virtual
bool setBlockX(
ISymExpr* blockX) noexcept = 0;
155 virtual
bool setBlockY(
ISymExpr* blockY) noexcept = 0;
158 virtual
bool setBlockZ(
ISymExpr* blockZ) noexcept = 0;
161 virtual
bool setSharedMem(
ISymExpr* sharedMem) noexcept = 0;
177 return mImpl->getGridX();
184 return mImpl->setGridX(gridX);
190 return mImpl->getGridY();
197 return mImpl->setGridY(gridY);
203 return mImpl->getGridZ();
210 return mImpl->setGridZ(gridZ);
216 return mImpl->getBlockX();
223 return mImpl->setBlockX(blockX);
229 return mImpl->getBlockY();
236 return mImpl->setBlockY(blockY);
242 return mImpl->getBlockZ();
249 return mImpl->setBlockZ(blockZ);
255 return mImpl->getSharedMem();
262 return mImpl->setSharedMem(sharedMem);
286 virtual
AsciiChar const* getPluginVersion() const noexcept = 0;
288 virtual
AsciiChar const* getPluginNamespace() const noexcept = 0;
311 int32_t
const* inputRanks, int32_t nbInputs)
const noexcept = 0;
326 int32_t nbShapeInputs,
DimsExprs* outputs, int32_t nbOutputs,
IExprBuilder& exprBuilder)
noexcept = 0;
351 int32_t nbOutputs,
PluginTensorDesc* supportedCombinations, int32_t nbFormatCombinations)
noexcept = 0;
362 virtual int32_t getAliasedInput(int32_t outputIndex) noexcept
450 int32_t nbOutputs,
const char** kernelName,
char** compiledKernel, int32_t* compiledKernelSize)
noexcept = 0;
499 void const*
const* inputs,
void*
const* outputs,
Dims const* inputStrides,
Dims const* outputStrides,
500 int32_t nbInputs, int32_t nbOutputs, cudaStream_t stream)
noexcept = 0;
534 virtual
AsciiChar const* getPluginName() const noexcept = 0;
536 virtual
AsciiChar const* getPluginVersion() const noexcept = 0;
538 virtual
AsciiChar const* getPluginNamespace() const noexcept = 0;
Definition: NvInferRuntimeBase.h:224
Analog of class Dims with expressions instead of constants for the dimensions.
Definition: NvInferRuntime.h:361
Object for constructing IDimensionExpr.
Definition: NvInferRuntime.h:296
Allows for kernel launch parameters to be communicated to the TensorRT backend.
Definition: NvInferPythonPlugin.h:172
virtual ~IKernelLaunchParams() noexcept=0
ISymExpr * getBlockZ() noexcept
Get the Z dimension of each thread block.
Definition: NvInferPythonPlugin.h:240
bool setBlockX(ISymExpr *blockX) noexcept
Set the X dimension of each thread block.
Definition: NvInferPythonPlugin.h:221
ISymExpr * getBlockY() noexcept
Get the Y dimension of each thread block.
Definition: NvInferPythonPlugin.h:227
ISymExpr * getGridY() noexcept
Get the Y dimension of the grid.
Definition: NvInferPythonPlugin.h:188
bool setGridY(ISymExpr *gridY) noexcept
Set the Y dimension of the grid.
Definition: NvInferPythonPlugin.h:195
bool setGridZ(ISymExpr *gridZ) noexcept
Set the Z dimension of the grid.
Definition: NvInferPythonPlugin.h:208
bool setBlockZ(ISymExpr *blockZ) noexcept
Set the Z dimension of each thread block.
Definition: NvInferPythonPlugin.h:247
ISymExpr * getBlockX() noexcept
Get the X dimension of each thread block.
Definition: NvInferPythonPlugin.h:214
ISymExpr * getGridX() noexcept
Get the X dimension of the grid.
Definition: NvInferPythonPlugin.h:175
ISymExpr * getSharedMem() noexcept
Get the dynamic shared-memory per thread block in bytes.
Definition: NvInferPythonPlugin.h:253
bool setBlockY(ISymExpr *blockY) noexcept
Set the Y dimension of each thread block.
Definition: NvInferPythonPlugin.h:234
ISymExpr * getGridZ() noexcept
Get the Z dimension of the grid.
Definition: NvInferPythonPlugin.h:201
bool setGridX(ISymExpr *gridX) noexcept
Set the X dimension of the grid.
Definition: NvInferPythonPlugin.h:182
bool setSharedMem(ISymExpr *sharedMem) noexcept
Set the dynamic shared-memory per thread block in bytes.
Definition: NvInferPythonPlugin.h:260
Impl class for IKernelLaunchParams.
Definition: NvInferPythonPlugin.h:140
virtual ISymExpr * getGridX() noexcept=0
Generic interface for a scalar symbolic expression implementable by a Python plugin / TensorRT Python...
Definition: NvInferPythonPlugin.h:57
virtual PluginArgType getType() const noexcept=0
Get the type of the symbolic expression.
virtual void * getExpr() noexcept=0
Underlying symbolic expression.
virtual PluginArgDataType getDataType() const noexcept=0
Get the data type of the symbolic expression.
Allows for a sequence of symbolic expressions to be communicated to the TensorRT backend.
Definition: NvInferPythonPlugin.h:86
virtual ~ISymExprs() noexcept=0
bool setNbSymExprs(int32_t count) noexcept
Set the number of symbolic expressions.
Definition: NvInferPythonPlugin.h:110
bool setSymExpr(int32_t index, ISymExpr *symExpr) noexcept
Set the symbolic expression at the given index.
Definition: NvInferPythonPlugin.h:97
int32_t getNbSymExprs() const noexcept
Get the number of symbolic expressions.
Definition: NvInferPythonPlugin.h:103
ISymExpr * getSymExpr(int32_t index) const noexcept
Get the symbolic expression at the given index.
Definition: NvInferPythonPlugin.h:90
Impl class for ISymExprs.
Definition: NvInferPythonPlugin.h:69
virtual ISymExpr * getSymExpr(int32_t index) const noexcept=0
virtual bool setSymExpr(int32_t index, ISymExpr *symExpr) noexcept=0
virtual int32_t getNbSymExprs() const noexcept=0
Version information associated with a TRT interface.
Definition: NvInferRuntimeBase.h:249
Definition: NvInferPluginBase.h:141
Definition: NvInferPluginBase.h:193
Definition: NvInferPythonPlugin.h:509
virtual IPluginV3 * createPlugin(AsciiChar const *name, AsciiChar const *nspace, PluginFieldCollection const *fc, TensorRTPhase phase, QuickPluginCreationRequest quickPluginCreationRequest) noexcept=0
Return a plugin object. Return nullptr in case of error.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferPythonPlugin.h:511
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...
Definition: NvInferPluginBase.h:206
Definition: NvInferPythonPlugin.h:405
virtual int32_t setTactic(int32_t tactic) noexcept
Set the tactic to be used in the subsequent call to enqueue(). Behaves similar to IPluginV3OneRuntime...
Definition: NvInferPythonPlugin.h:458
virtual int32_t getKernel(PluginTensorDesc const *in, int32_t nbInputs, PluginTensorDesc const *out, int32_t nbOutputs, const char **kernelName, char **compiledKernel, int32_t *compiledKernelSize) noexcept=0
Get the compiled form for the kernel to be used for the specified input and output types/formats and ...
virtual int32_t getLaunchParams(DimsExprs const *inputs, DynamicPluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs, IKernelLaunchParams *launchParams, ISymExprs *extraArgs, IExprBuilder &exprBuilder) noexcept=0
Get the launch parameters for the kernel to be used for the specified input and output types/formats ...
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferPythonPlugin.h:407
Definition: NvInferPythonPlugin.h:292
virtual int32_t getOutputDataTypes(DataType *outputTypes, int32_t nbOutputs, DataType const *inputTypes, int32_t const *inputRanks, int32_t nbInputs) const noexcept=0
Provide the data types of the plugin outputs if the input tensors have the data types provided.
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: NvInferPythonPlugin.h:389
virtual int32_t getValidTactics(int32_t *tactics, int32_t nbTactics) noexcept
Query for any custom tactics that the plugin intends to use specific to the I/O characteristics indic...
Definition: NvInferPythonPlugin.h:373
virtual int32_t getNbSupportedFormatCombinations(DynamicPluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs) noexcept=0
Get number of format combinations supported by the plugin for the I/O characteristics indicated by in...
virtual int32_t getSupportedFormatCombinations(DynamicPluginTensorDesc const *inOut, int32_t nbInputs, int32_t nbOutputs, PluginTensorDesc *supportedCombinations, int32_t nbFormatCombinations) noexcept=0
Write all format combinations supported by the plugin for the I/O characteristics indicated by inOut ...
virtual int32_t getNbTactics() noexcept
Query for number of custom tactics related to the getValidTactics() call.
Definition: NvInferPythonPlugin.h:381
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferPythonPlugin.h:294
virtual int32_t configurePlugin(DynamicPluginTensorDesc const *in, int32_t nbInputs, DynamicPluginTensorDesc const *out, int32_t nbOutputs) noexcept=0
Configure the plugin. Behaves similarly to IPluginV3OneBuild::configurePlugin()
virtual char const * getMetadataString() noexcept
Query for a string representing the configuration of the plugin. May be called anytime after plugin c...
Definition: NvInferPythonPlugin.h:398
virtual int32_t getNbOutputs() const noexcept=0
Get the number of outputs from the plugin.
virtual int32_t getOutputShapes(DimsExprs const *inputs, int32_t nbInputs, DimsExprs const *shapeInputs, int32_t nbShapeInputs, DimsExprs *outputs, int32_t nbOutputs, IExprBuilder &exprBuilder) noexcept=0
Provide expressions for computing dimensions of the output tensors from dimensions of the input tenso...
Definition: NvInferPythonPlugin.h:277
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferPythonPlugin.h:279
virtual AsciiChar const * getPluginName() const noexcept=0
Definition: NvInferPythonPlugin.h:465
virtual int32_t enqueue(PluginTensorDesc const *inputDesc, PluginTensorDesc const *outputDesc, void const *const *inputs, void *const *outputs, Dims const *inputStrides, Dims const *outputStrides, int32_t nbInputs, int32_t nbOutputs, cudaStream_t stream) noexcept=0
Execute the plugin.
virtual int32_t setTactic(int32_t tactic) noexcept
Set the tactic to be used in the subsequent call to enqueue(). Behaves similar to IPluginV3OneRuntime...
Definition: NvInferPythonPlugin.h:478
virtual PluginFieldCollection const * getFieldsToSerialize() noexcept=0
Get the plugin fields which should be serialized.
InterfaceInfo getInterfaceInfo() const noexcept override
Return version information associated with this interface. Applications must not override this method...
Definition: NvInferPythonPlugin.h:467
The TensorRT API version 1 namespace.
Definition: NvInferSafePlugin.h:33
@ kUNKNOWN
Unknown field type.
char_t AsciiChar
Definition: NvInferRuntimeBase.h:116
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:151
PluginArgDataType
Data type of an extra kernel input argument in an AOT Python plugin.
Definition: NvInferPythonPlugin.h:46
@ kINT16
16-bit signed integer
@ kINT8
8-bit signed integer
@ kINT32
32-bit signed integer
PluginArgType
Numeric type of an extra kernel input argument in an AOT Python plugin.
Definition: NvInferPythonPlugin.h:38
QuickPluginCreationRequest
Communicates preference when a quickly deployable plugin is to be added to the network.
Definition: NvInferPythonPlugin.h:125
@ kSTRICT_JIT
JIT plugin must be used. TensorRT should fail if a JIT implementation cannot be found.
@ kSTRICT_AOT
AOT plugin must be used. TensorRT should fail if an AOT implementation cannot be found.
@ kPREFER_JIT
JIT plugin is preferred.
@ kPREFER_AOT
AOT plugin is preferred.
Summarizes tensors that a plugin might see for an input or output.
Definition: NvInferRuntime.h:373
Plugin field collection struct.
Definition: NvInferPluginBase.h:103
Fields that a plugin might see for an input or output.
Definition: NvInferRuntimePlugin.h:73