#include <NvInferRuntime.h>
|
InterfaceInfo | getInterfaceInfo () const noexcept override |
| Return version information associated with this interface. Applications must not override this method. More...
|
|
virtual int32_t | setTactic (int32_t tactic) noexcept |
| Set the tactic to be used in the subsequent call to enqueue(). If no custom tactics were advertised, this will have a value of 0, which is designated as the default tactic. More...
|
|
virtual int32_t | onShapeChange (PluginTensorDesc const *in, int32_t nbInputs, PluginTensorDesc const *out, int32_t nbOutputs) noexcept=0 |
| Called when a plugin is being prepared for execution for specific dimensions. This could happen multiple times in the execution phase, both during creation of an engine by IBuilder and execution of an engine by IExecutionContext. More...
|
|
virtual int32_t | enqueue (PluginTensorDesc const *inputDesc, PluginTensorDesc const *outputDesc, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept=0 |
| Execute the layer. More...
|
|
virtual IPluginV3 * | attachToContext (IPluginResourceContext *context) noexcept=0 |
| Clone the plugin, attach the cloned plugin object to a execution context and grant the cloned plugin access to some context resources. More...
|
|
virtual PluginFieldCollection const * | getFieldsToSerialize () noexcept=0 |
| Get the plugin fields which should be serialized. More...
|
|
virtual APILanguage | getAPILanguage () const noexcept |
| The language used to build the implementation of this Interface. More...
|
|
virtual | ~IVersionedInterface () noexcept=default |
|
◆ attachToContext()
Clone the plugin, attach the cloned plugin object to a execution context and grant the cloned plugin access to some context resources.
This function is called automatically for each plugin when a new execution context is created. The plugin may use resources provided by the IPluginResourceContext until the plugin is deleted by TensorRT.
If the plugin needs per-context resources, it can be allocated here.
- Parameters
-
context | A resource context that exposes methods to get access to execution context specific resources. A different resource context is guaranteed for each different execution context to which the plugin is attached. |
- See also
- IPluginResourceContext
- Note
- This method should clone the entire IPluginV3 object, not just the runtime interface
- Returns
- A clone of the IPluginV3 object whose runtime interface on which this method is invoked, which has attached to the provided resource context.
◆ enqueue()
virtual int32_t nvinfer1::v_1_0::IPluginV3OneRuntime::enqueue |
( |
PluginTensorDesc const * |
inputDesc, |
|
|
PluginTensorDesc const * |
outputDesc, |
|
|
void const *const * |
inputs, |
|
|
void *const * |
outputs, |
|
|
void * |
workspace, |
|
|
cudaStream_t |
stream |
|
) |
| |
|
pure virtualnoexcept |
Execute the layer.
- Parameters
-
inputDesc | how to interpret the memory for the input tensors. |
outputDesc | how to interpret the memory for the output tensors. |
inputs | The memory for the input tensors. |
outputs | The memory for the output tensors. |
workspace | Workspace for execution. |
stream | The stream in which to execute the kernels. |
- Returns
- 0 for success, else non-zero (which will cause engine termination). The returned code will be reported through the error recorder.
◆ getFieldsToSerialize()
Get the plugin fields which should be serialized.
- Note
- The set of plugin fields returned does not necessarily need to match that advertised through getFieldNames() of the corresponding plugin creator.
-
To serialize arbitrary plugin data, use a PluginField of PluginFieldType::kUNKNOWN, with the length of the PluginField set to the correct number of bytes.
◆ getInterfaceInfo()
InterfaceInfo nvinfer1::v_1_0::IPluginV3OneRuntime::getInterfaceInfo |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
◆ onShapeChange()
virtual int32_t nvinfer1::v_1_0::IPluginV3OneRuntime::onShapeChange |
( |
PluginTensorDesc const * |
in, |
|
|
int32_t |
nbInputs, |
|
|
PluginTensorDesc const * |
out, |
|
|
int32_t |
nbOutputs |
|
) |
| |
|
pure virtualnoexcept |
Called when a plugin is being prepared for execution for specific dimensions. This could happen multiple times in the execution phase, both during creation of an engine by IBuilder and execution of an engine by IExecutionContext.
- IBuilder will call this function once per profile, with
in
resolved to the values specified by the kOPT field of the current profile.
- IExecutionContext will call this during the next subsequent instance of enqueueV3() or executeV2() if:
- The optimization profile is changed via setOptimizationProfile() or setOptimizationProfileAsync().
- An input binding is changed via setInputTensorAddress() or setTensorAddress() or setInputShape().
- Warning
- The execution phase is timing critical during IExecutionContext but is not part of the timing loop when called from IBuilder. Performance bottlenecks of onShapeChange() will not show up during engine building but will be visible during execution if any triggering functions are called.
- Parameters
-
in | The input tensors attributes that are used for configuration. |
nbInputs | Number of input tensors. |
out | The output tensors attributes that are used for configuration. |
nbOutputs | Number of output tensors. |
◆ setTactic()
virtual int32_t nvinfer1::v_1_0::IPluginV3OneRuntime::setTactic |
( |
int32_t |
tactic | ) |
|
|
inlinevirtualnoexcept |
Set the tactic to be used in the subsequent call to enqueue(). If no custom tactics were advertised, this will have a value of 0, which is designated as the default tactic.
- Returns
- 0 for success, else non-zero (which will cause engine termination). The returned code will be reported through the error recorder.
The documentation for this class was generated from the following file: