NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::DynamicPluginLoader Class Reference

Standard IPluginLoader implementation that uses dynamic linking (dlopen/LoadLibrary) to find NvNeural IPlugin objects. More...

#include <DynamicPluginLoader.h>

Inheritance diagram for nvneural::DynamicPluginLoader:
nvneural::refobj::RefObjectBase< refobj::Implements< IPluginLoader > >

Public Member Functions

void allowIncompatiblePlugins () noexcept
 Override the current compatibility checks to allow the loading of out-of-date plugins. More...
 
IPlugingetPluginByIndex (std::size_t pluginIndex) const noexcept
 Returns a particular IPlugin object by index, or nullptr if the index is out of range. More...
 
NeuralResult getPluginPath (const IPlugin *pPlugin, const char **ppPluginPathOut) const noexcept
 Returns the file path to a particular plugin object. More...
 
NeuralResult loadDirectory (const char *pPathname, std::uint32_t *pNumberLoadedOut) noexcept
 Loads all compatible plugins from the provided directory. More...
 
NeuralResult loadLibrary (const char *pFilename, IPlugin **ppPluginOut) noexcept
 Loads a plugin from a specific shared library file. More...
 
std::size_t pluginCount () const noexcept
 Returns the number of plugins tracked by this object. More...
 
NeuralResult releaseAllPlugins () noexcept
 Releases all plugins tracked by this object. More...
 
NeuralResult releasePlugin (IPlugin *pPlugin) noexcept
 Releases the internal reference to a given plugin object and frees the library. More...
 
- Public Member Functions inherited from nvneural::refobj::RefObjectBase< refobj::Implements< IPluginLoader > >
IRefObject::RefCount addRef () const noexcept
 Increment the object's reference count. More...
 
const void * queryInterface (IRefObject::TypeId interfaceId) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void * queryInterface (IRefObject::TypeId interfaceId) noexcept
 Retrieves a new object interface pointer. More...
 
 RefObjectBase ()
 Default constructor. Logs object creation.
 
IRefObject::RefCount release () const noexcept
 Decrements the object's reference count and destroys the object if the reference count reaches zero. More...
 

Detailed Description

Standard IPluginLoader implementation that uses dynamic linking (dlopen/LoadLibrary) to find NvNeural IPlugin objects.

Member Function Documentation

◆ allowIncompatiblePlugins()

void DynamicPluginLoader::allowIncompatiblePlugins ( )
noexcept

Override the current compatibility checks to allow the loading of out-of-date plugins.

Not recommended for general use.

◆ getPluginByIndex()

IPlugin * DynamicPluginLoader::getPluginByIndex ( std::size_t  pluginIndex) const
noexcept

Returns a particular IPlugin object by index, or nullptr if the index is out of range.

Parameters
pluginIndexPlugin index; must be less than pluginCount

This is a query function and does not increment the reference count of the IPlugin.

◆ getPluginPath()

NeuralResult DynamicPluginLoader::getPluginPath ( const IPlugin pPlugin,
const char **  ppPluginPathOut 
) const
noexcept

Returns the file path to a particular plugin object.

Parameters
pPluginPlugin to query
ppPluginPathOutVariable receiving a pointer to pPlugin's location on disk.

The returned plugin path is valid until the plugin is released or the IPluginLoader destroyed.

◆ loadDirectory()

NeuralResult DynamicPluginLoader::loadDirectory ( const char *  pPathname,
std::uint32_t *  pNumberLoadedOut 
)
noexcept

Loads all compatible plugins from the provided directory.

Parameters
pPathnameDirectory to load
pNumberLoadedOutOptional pointer receiving the number of plugins loaded

◆ loadLibrary()

NeuralResult DynamicPluginLoader::loadLibrary ( const char *  pFilename,
IPlugin **  ppPluginOut 
)
noexcept

Loads a plugin from a specific shared library file.

Parameters
pFilenameLibrary filename to load
ppPluginOutOptional pointer receiving a new reference to the loaded plugin
Note
If ppPluginOut is not null, the resulting reference should be released before calling releasePlugin or destroying the plugin loader.

◆ pluginCount()

std::size_t DynamicPluginLoader::pluginCount ( ) const
noexcept

Returns the number of plugins tracked by this object.

◆ releaseAllPlugins()

NeuralResult DynamicPluginLoader::releaseAllPlugins ( )
noexcept

Releases all plugins tracked by this object.

Equivalent to calling releasePlugin on all return values from getPluginByIndex.

◆ releasePlugin()

NeuralResult DynamicPluginLoader::releasePlugin ( IPlugin pPlugin)
noexcept

Releases the internal reference to a given plugin object and frees the library.

The plugin and objects created by that plugin should not be referenced after this call.


The documentation for this class was generated from the following files: