NVIDIA NvNeural SDK
2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
|
Common class registry for instantiating objects and collecting plugin-provided descriptors. More...
#include <nvneural/CoreTypes.h>
Public Member Functions | |
virtual NeuralResult | createObject (IRefObject **ppOut, const char *pObjectClass) const noexcept=0 |
Creates the designated object using its manifest-specified class name. More... | |
virtual const ActivationDesc * | exportedActivationByIndex (std::size_t index) const noexcept=0 |
Returns a registered activation function descriptor for a given index. More... | |
virtual std::size_t | exportedActivationsCount () const noexcept=0 |
Returns the count of registered activation functions. | |
virtual const FusingRule * | exportedFusingRuleByIndex (std::size_t index) const noexcept=0 |
Returns a registered fusing rule for a given index. More... | |
virtual std::size_t | exportedFusingRulesCount () const noexcept=0 |
Returns the count of registered fusing rules. | |
virtual const LayerDesc * | exportedLayerByIndex (std::size_t index) const noexcept=0 |
Returns a registered layer descriptor for a given index. More... | |
virtual std::size_t | exportedLayersCount () const noexcept=0 |
Returns the count of registered layers. | |
virtual const PrototypeDesc * | exportedPrototypeByIndex (std::size_t index) const noexcept=0 |
Returns a registered prototype layer descriptor for a given index. More... | |
virtual PrototypeRuntimeValidatorFunction | exportedPrototypeRuntimeValidatorByIndex (std::size_t index) const noexcept=0 |
Returns the runtime validator of a registered prototype layer for a given index. More... | |
virtual std::size_t | exportedPrototypesCount () const noexcept=0 |
Returns the count of registered prototype layers. | |
virtual NeuralResult | importPlugin (IPlugin *pPlugin)=0 |
Imports everything (layer, activation, fusing rules, and prototypes) registered with a single plugin. More... | |
virtual NeuralResult | importPluginLoader (IPluginLoader *pPluginLoader)=0 |
Imports all plugins loaded by a plugin loader. More... | |
virtual bool | isPrototypeRuntimeCompatible (const char *pPrototypeObjectClass, const INetwork *pNetwork) const =0 |
Checks if the given prototype object class is compatible with any of the registered prototypes. More... | |
![]() | |
virtual RefCount | addRef () const noexcept=0 |
Increments the object's reference count. More... | |
virtual const void * | queryInterface (TypeId interface) const noexcept=0 |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
virtual void * | queryInterface (TypeId interface) noexcept=0 |
Retrieves a new object interface pointer. More... | |
virtual RefCount | release () const noexcept=0 |
Decrements the object's reference count and destroy the object if the reference count reaches zero. More... | |
Static Public Attributes | |
static const IRefObject::TypeId | typeID = 0x261ae312ee3c4979ul |
Interface TypeId for InterfaceOf purposes. | |
![]() | |
static const TypeId | typeID = 0x14ecc3f9de638e1dul |
Interface TypeId for InterfaceOf purposes. | |
Additional Inherited Members | |
![]() | |
using | RefCount = std::uint32_t |
Typedef used to track the number of active references to an object. | |
using | TypeId = std::uint64_t |
Every interface must define a unique TypeId. This should be randomized. | |
![]() | |
virtual | ~IRefObject ()=default |
A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr. | |
Common class registry for instantiating objects and collecting plugin-provided descriptors.
As a host application, create a ClassRegistry and import your plugin loader into it. Network builders and similar classes will then be aware of all layers/activations/etc that were loaded by your plugins, and can create the described objects using createObject.
As a layer author, you should register the layer (or activation) for export by calling static methods on your class registry object. Pointers inside LayerDesc and similar objects need to remain valid for the lifetime of the plugin object–do not use temporaries here.
|
pure virtualnoexcept |
Creates the designated object using its manifest-specified class name.
ppOut | Receives a pointer to a newly created object, or nullptr if the name is unknown or creation fails. |
pObjectClass | Object class name. |
|
pure virtualnoexcept |
Returns a registered activation function descriptor for a given index.
index | 0-based index to an activation function |
|
pure virtualnoexcept |
Returns a registered fusing rule for a given index.
index | 0-based index to a fusing ruler |
|
pure virtualnoexcept |
Returns a registered layer descriptor for a given index.
index | 0-based index to a layer |
|
pure virtualnoexcept |
Returns a registered prototype layer descriptor for a given index.
index | 0-based index to a prototype layer |
|
pure virtualnoexcept |
Returns the runtime validator of a registered prototype layer for a given index.
index | 0-based index to a prototype layer |
|
pure virtual |
Imports everything (layer, activation, fusing rules, and prototypes) registered with a single plugin.
pPlugin | A plugin enumerated by a plugin loader |
|
pure virtual |
Imports all plugins loaded by a plugin loader.
Equivalent to looping through the IPluginLoader calling importPlugin on each object.
pPluginLoader | IPluginLoader with loaded plugins |
|
pure virtual |
Checks if the given prototype object class is compatible with any of the registered prototypes.
pPrototypeObjectClass | A string specifying the prototype object class to be checked |
pNetwork | Network pointer needed for a prototype's runtime validator |