NVIDIA NvNeural SDK
2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
|
ClassRegistry is the default implementation for IClassRegistry. More...
#include <ClassRegistry.h>
Public Types | |
using | CreationFunction = IRefObject *(*)() |
Typedef for factory functions that take no arguments and return a new IRefObject. | |
Public Member Functions | |
ClassRegistry () | |
Creates a new ClassRegistry containing statically-registered descriptors and object classes. | |
NeuralResult | createObject (IRefObject **ppOut, const char *pObjectClass) const noexcept final |
Creates the designated object using its manifest-specified class name. More... | |
const ActivationDesc * | exportedActivationByIndex (std::size_t index) const noexcept final |
Returns a registered activation function descriptor for a given index. More... | |
std::size_t | exportedActivationsCount () const noexcept final |
Returns the count of registered activation functions. More... | |
const FusingRule * | exportedFusingRuleByIndex (std::size_t index) const noexcept final |
Returns a registered fusing rule for a given index. More... | |
std::size_t | exportedFusingRulesCount () const noexcept final |
Returns the count of registered fusing rules. More... | |
const LayerDesc * | exportedLayerByIndex (std::size_t index) const noexcept final |
Returns a registered layer descriptor for a given index. More... | |
std::size_t | exportedLayersCount () const noexcept final |
Returns the count of registered layers. More... | |
const PrototypeDesc * | exportedPrototypeByIndex (std::size_t index) const noexcept final |
Returns a registered prototype layer descriptor for a given index. More... | |
PrototypeRuntimeValidatorFunction | exportedPrototypeRuntimeValidatorByIndex (std::size_t index) const noexcept final |
Returns the runtime validator of a registered prototype layer for a given index. More... | |
std::size_t | exportedPrototypesCount () const noexcept final |
Returns the count of registered prototype layers. More... | |
NeuralResult | importPlugin (IPlugin *pPlugin) final |
Imports everything (layer, activation, fusing rules, and prototypes) registered with a single plugin. More... | |
NeuralResult | importPluginLoader (IPluginLoader *pPluginLoader) final |
Imports all plugins loaded by a plugin loader. More... | |
bool | isPrototypeRuntimeCompatible (const char *pPrototypeObjectClass, const INetwork *pNetwork) const final |
Checks if the given prototype object class is compatible with any of the registered prototypes. More... | |
~ClassRegistry () | |
Destroys the ClassRegistry. | |
![]() | |
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... | |
Static Public Member Functions | |
template<typename TObject > | |
static OpaqueClassRegistrationHandle | registerActivation (const ActivationDesc &activationDesc) |
Registers a C++ object and ActivationDesc structure for discovery and creation. More... | |
static OpaqueClassRegistrationHandle | registerActivationDesc (const ActivationDesc *pActivationDesc) |
Registers an ActivationDesc structure for discovery. More... | |
static OpaqueClassRegistrationHandle | registerFusingRule (std::uint32_t syntaxVersion, const char *pFusingRule) |
Register a fusing rule for export. More... | |
template<typename TObject > | |
static OpaqueClassRegistrationHandle | registerLayer (const LayerDesc &layerDesc) |
Registers a C++ object and LayerDesc structure for discovery and creation. More... | |
static OpaqueClassRegistrationHandle | registerLayerDesc (const LayerDesc *pLayerDesc) |
Registers a LayerDesc structure for discovery. More... | |
template<typename TObject > | |
static OpaqueClassRegistrationHandle | registerObjectClass (const char *pObjectClass) |
Registers a C++ object as a factory-creatable object class. More... | |
static OpaqueClassRegistrationHandle | registerObjectClassInternal (const char *pObjectClass, CreationFunction classFactory) |
Registers an object class and associated creation function. More... | |
template<typename TObject > | |
static OpaqueClassRegistrationHandle | registerPrototype (const PrototypeDesc &prototypeDesc, PrototypeRuntimeValidatorFunction runtimeValidator) |
Registers a C++ object as a prototype layer for discovery and creation. More... | |
static OpaqueClassRegistrationHandle | registerPrototypeDesc (const PrototypeDesc *pPrototypeDesc, PrototypeRuntimeValidatorFunction runtimeValidator) |
Registers a PrototypeDesc structure and validator for discovery. More... | |
ClassRegistry is the default implementation for IClassRegistry.
In addition to the operations already described in IClassRegistry, ClassRegistry supports direct integration with ExportPlugin, the standard IPlugin implementation. All statically defined exports (using registerLayer, registerActivation, and so on) are automaticallly hooked up to the type-specific plugin interfaces for discovery by tools and applications.
There are two major caveats to static registration:
|
finalnoexcept |
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. |
|
finalnoexcept |
Returns a registered activation function descriptor for a given index.
index | 0-based index to an activation function |
|
finalnoexcept |
Returns the count of registered activation functions.
|
finalnoexcept |
Returns a registered fusing rule for a given index.
index | 0-based index to a fusing ruler |
|
finalnoexcept |
Returns the count of registered fusing rules.
|
finalnoexcept |
Returns a registered layer descriptor for a given index.
index | 0-based index to a layer |
|
finalnoexcept |
Returns the count of registered layers.
|
finalnoexcept |
Returns a registered prototype layer descriptor for a given index.
index | 0-based index to a prototype layer |
|
finalnoexcept |
Returns the runtime validator of a registered prototype layer for a given index.
index | 0-based index to a prototype layer |
|
finalnoexcept |
Returns the count of registered prototype layers.
|
final |
Imports everything (layer, activation, fusing rules, and prototypes) registered with a single plugin.
pPlugin | A plugin enumerated by a plugin loader |
|
final |
Imports all plugins loaded by a plugin loader.
Equivalent to looping through the IPluginLoader calling importPlugin on each object.
pPluginLoader | IPluginLoader with loaded plugins |
|
final |
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 |
|
inlinestatic |
Registers a C++ object and ActivationDesc structure for discovery and creation.
The object type is registered equivalent to calling registerObjectClass<TObject>(activationDesc.pObjectClass). You do not need to register the object explicitly.
TObject | Object type to register; must have a zero-argument constructor defined |
activationDesc | Activation descriptor to export |
|
static |
Registers an ActivationDesc structure for discovery.
Does not register referenced object classes for creation.
pActivationDesc | Activation descriptor to export |
|
static |
Register a fusing rule for export.
The fusing rule will be considered a "default fusing rule" for purposes of ConverenceNG –enable-default-fusing.
syntaxVersion | Fusing rule syntax version used by pFusingRule |
pFusingRule | Fusing rule definition to export; syntax is version-specific and described in the FusingRule struct |
|
inlinestatic |
Registers a C++ object and LayerDesc structure for discovery and creation.
The object type is registered equivalent to calling registerObjectClass<TObject>(layerDesc.pObjectClass). You do not need to register the object explicitly.
TObject | Object type to register; must have a zero-argument constructor defined |
layerDesc | Layer descriptor to export |
|
static |
Registers a LayerDesc structure for discovery.
Does not register referenced object classes for creation.
pLayerDesc | Layer descriptor to export |
|
inlinestatic |
Registers a C++ object as a factory-creatable object class.
TObject | Object type to register; must have a zero-argument constructor defined |
pObjectClass | Class name to export the object under; should be a string literal |
|
static |
Registers an object class and associated creation function.
Most of the other registration methods call this for you, but this interface is provided to support nonstandard use cases.
pObjectClass | Object class name to export |
classFactory | Creation function to associate with the object class |
|
inlinestatic |
Registers a C++ object as a prototype layer for discovery and creation.
The object type is registered equivalent to calling registerObjectClass<TObject>(prototypeDesc.pObjectClass). You do not need to register the object explicitly.
TObject | Object type to register; must have a zero-argument constructor defined |
prototypeDesc | Prototype descriptor to export |
runtimeValidator | Validation function associated with the descriptor to export |
|
static |
Registers a PrototypeDesc structure and validator for discovery.
Does not register referenced object classes for creation.
pPrototypeDesc | Prototype descriptor to export |
runtimeValidator | Validation function associated with the descriptor to export |