Single registration point for all plugins in an application. It is used to find plugin implementations during engine deserialization. Internally, the plugin registry is considered to be a singleton so all plugins in an application are part of the same global registry. Note that the plugin registry is only supported for plugins of type IPluginV2 and should also have a corresponding IPluginCreator implementation.
More...
#include <NvInferRuntimeCommon.h>
Single registration point for all plugins in an application. It is used to find plugin implementations during engine deserialization. Internally, the plugin registry is considered to be a singleton so all plugins in an application are part of the same global registry. Note that the plugin registry is only supported for plugins of type IPluginV2 and should also have a corresponding IPluginCreator implementation.
- See also
- IPluginV2 and IPluginCreator
- Warning
- Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
-
In the automotive safety context, be sure to call IPluginRegistry::setErrorRecorder() to register an error recorder with the registry before using other methods in the registry.
◆ PluginLibraryHandle
Pointer for plugin library handle.
◆ ~IPluginRegistry()
| nvinfer1::IPluginRegistry::~IPluginRegistry |
( |
| ) |
|
|
inlineprotectedpure virtualdefaultnoexcept |
◆ acquirePluginResource()
Get a plugin resource.
- Parameters
-
| key | Key for identifying the resource. Cannot be null. |
| resource | A plugin resource object. The object will only need to be valid until this method returns, as only a clone of this object will be registered by TRT. Cannot be null. |
- Returns
- Registered plugin resource object
- Allowed context for the API call
- Thread-safe: Yes; calls to this method will be synchronized by a mutex.
◆ deregisterCreator()
Deregister a previously registered plugin creator.
Since there may be a desire to limit the number of plugins, this function provides a mechanism for removing plugin creators registered in TensorRT. The plugin creator that is specified by creator is removed from TensorRT and no longer tracked.
- Returns
- True if the plugin creator was deregistered, false if it was not found in the registry or otherwise could not be deregistered.
- Allowed context for the API call
◆ deregisterLibrary()
Deregister plugins associated with a library. Any resources acquired when the library was loaded will be released.
- Parameters
-
| handle | the plugin library handle to deregister. |
◆ getAllCreators()
| virtual IPluginCreatorInterface *const * nvinfer1::IPluginRegistry::getAllCreators |
( |
int32_t *const |
numCreators | ) |
const |
|
pure virtualnoexcept |
Return all registered plugin creators. Returns nullptr if none found.
- Warning
- If any plugin creators are registered or deregistered after calling this function, the returned pointer is not guaranteed to be valid thereafter.
- Allowed context for the API call
◆ getAllCreatorsRecursive()
| virtual IPluginCreatorInterface *const * nvinfer1::IPluginRegistry::getAllCreatorsRecursive |
( |
int32_t *const |
numCreators | ) |
|
|
pure virtualnoexcept |
Return all registered plugin creators by searching starting from the current registry and following parent registries recursively as long as isParentSearchEnabled() returns true.
- Parameters
-
| [out] | numCreators | Pointer to an integer where the number of registered plugin creators will be stored. |
- Returns
- A pointer to an array of IPluginCreatorInterface pointers. Returns nullptr if no creators are found.
- Warning
- If any plugin creators are registered or deregistered after calling this function, the returned pointer is not guaranteed to remain valid.
- Allowed context for the API call
◆ getCreator()
Return a registered plugin creator based on plugin name, version, and namespace associated with the plugin during network creation.
- Warning
- The strings pluginName, pluginVersion, and pluginNamespace must be 1024 bytes or less including the NULL terminator and must be NULL terminated.
- Allowed context for the API call
◆ getErrorRecorder()
| virtual IErrorRecorder * nvinfer1::IPluginRegistry::getErrorRecorder |
( |
| ) |
const |
|
pure virtualnoexcept |
Get the ErrorRecorder assigned to this interface.
Retrieves the assigned error recorder object for the given class. A default error recorder does not exist, so a nullptr will be returned if setErrorRecorder has not been called, or an ErrorRecorder has not been inherited.
- Returns
- A pointer to the IErrorRecorder object that has been registered.
- See also
- setErrorRecorder()
- Allowed context for the API call
◆ isParentSearchEnabled()
| virtual bool nvinfer1::IPluginRegistry::isParentSearchEnabled |
( |
| ) |
const |
|
pure virtual |
Return whether the parent registry will be searched if a plugin is not found in this registry default: true.
- Returns
- bool variable indicating whether parent search is enabled.
- See also
- setParentSearchEnabled
◆ loadLibrary()
Load and register a shared library of plugins.
- Parameters
-
| pluginPath | the plugin library path. |
- Returns
- The loaded plugin library handle. The call will fail and return nullptr if any of the plugins are already registered.
◆ registerCreator()
Register a plugin creator. Returns false if a plugin creator with the same type is already registered.
- Warning
- The string pluginNamespace must be 1024 bytes or less including the NULL terminator and must be NULL terminated.
- Allowed context for the API call
- Thread-safe: Yes; calls to this method will be synchronized by a mutex.
◆ releasePluginResource()
| virtual int32_t nvinfer1::IPluginRegistry::releasePluginResource |
( |
AsciiChar const * |
key | ) |
|
|
pure virtualnoexcept |
Decrement reference count for the resource with this key If reference count goes to zero after decrement, release() will be invoked on the resource, the key will be deregistered and the resource object will be deleted.
- Parameters
-
| key | Key that was used to register the resource. Cannot be null. |
- Returns
- 0 for success, else non-zero
- Allowed context for the API call
- Thread-safe: Yes; calls to this method will be synchronized by a mutex.
◆ setErrorRecorder()
| virtual void nvinfer1::IPluginRegistry::setErrorRecorder |
( |
IErrorRecorder *const |
recorder | ) |
|
|
pure virtualnoexcept |
Set the ErrorRecorder for this interface.
Assigns the ErrorRecorder to this interface. The ErrorRecorder will track all errors during execution. This function will call incRefCount of the registered ErrorRecorder at least once. Setting recorder to nullptr unregisters the recorder with the interface, resulting in a call to decRefCount if a recorder has been registered.
- Parameters
-
| recorder | The error recorder to register with this interface. |
- See also
- getErrorRecorder()
- Allowed context for the API call
◆ setParentSearchEnabled()
| virtual void nvinfer1::IPluginRegistry::setParentSearchEnabled |
( |
bool const |
enabled | ) |
|
|
pure virtual |
Set whether the parent registry will be searched if a plugin is not found in this registry.
- Parameters
-
| enabled | The bool variable indicating whether parent search is enabled. |
- See also
- isParentSearchEnabled
The documentation for this class was generated from the following file: