NVIDIA NvNeural SDK
2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
|
INetworkRuntime is a subset of the basic network interface that is accessible from layer classes during network evaluation. More...
#include <nvneural/CoreTypes.h>
Public Member Functions | |
virtual NetworkBackendId | defaultBackendId () const noexcept=0 |
Retrieves the default backend ID used by the network. | |
virtual NeuralResult | defaultForwardActivation (ILayer *pLayer) const noexcept=0 |
Perform generic forward activation. More... | |
virtual TensorFormat | defaultTensorFormat () const noexcept=0 |
Retrieves the default tensor format used by the network. | |
virtual const INetworkBackend * | getBackend (NetworkBackendId backendId) 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 INetworkBackend * | getBackend (NetworkBackendId backendId) noexcept=0 |
Retrieves an installed network backend. More... | |
virtual void * | getInternalTensor (const ILayer *pLayer, NetworkBackendId backendId) noexcept=0 |
Retrieves internal tensor data for a layer. More... | |
virtual TensorDimension | getLayerInternalDimensions (const ILayer *pLayer) const noexcept=0 |
Retrieves the internal dimensions of a layer. More... | |
virtual void * | getTensor (const ILayer *pDataLayer, const ILayer *pRequestingLayer, TensorFormat format) noexcept=0 |
Retrieves tensor data from one layer on behalf of another. More... | |
virtual NeuralResult | getWeightsDimensionForLayer (TensorDimension *pDimensionsOut, const ILayer *pLayer, const char *pWeightsName, NetworkBackendId backendId, TensorFormat format) noexcept=0 |
Retrieves the dimensions of specific weights data for a layer. More... | |
virtual const void * | getWeightsForLayer (const ILayer *pLayer, const char *pWeightsName, NetworkBackendId backendId, TensorFormat format) noexcept=0 |
Retrieves specific weights data for a layer. More... | |
virtual NeuralResult | mapLayerAsWeightsData (const ILayer *pDataLayer, const ILayer *pWeightsLayer, const char *pWeightsName) noexcept=0 |
Maps a layer as a source of weights data for another layer. More... | |
virtual const char * | networkName () const noexcept=0 |
Retrieves the name of this network as a UTF-8 string. | |
virtual NeuralResult | reshapeLater (ILayer *pLayer) noexcept=0 |
Queues a layer for later reshape. More... | |
virtual NeuralResult | setAffectedForward (ILayer *pLayer) noexcept=0 |
Marks a layer and its descendants (those layers indirectly depending on it) as "affected.". More... | |
virtual IWeightsLoader * | weightsLoader () const noexcept=0 |
Retrieves the IWeightsLoader implementation for this network. | |
Layer enumeration and retrieval | |
virtual size_t | layerCount () const noexcept=0 |
Gets the current number of layers in the network. | |
virtual ILayer * | getLayerByName (const char *pLayerName) const noexcept=0 |
Retrieves a layer by name. More... | |
virtual NeuralResult | getAllLayers (ILayerList **ppListOut) const noexcept=0 |
Retrieves a list of layers present in the network. More... | |
virtual NeuralResult | getInputLayers (ILayerList **ppListOut) const noexcept=0 |
Retrieves a list of input layers present in the network. More... | |
virtual NeuralResult | getOutputLayers (ILayerList **ppListOut) const noexcept=0 |
Retrieves a list of output layers present in the network. More... | |
virtual NeuralResult | getDependentLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0 |
Retrieves a list of layers indirectly depending on pLayer. More... | |
virtual NeuralResult | getAcceptorLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0 |
Retrieves a list of layers directly depending on pLayer. More... | |
virtual NeuralResult | getInfluenceLayers (ILayerList **ppListOut, const ILayer *pLayer) const noexcept=0 |
Retrieves a list of layers pLayer indirectly depends on. 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 = 0x53191c073f990992ul |
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. | |
INetworkRuntime is a subset of the basic network interface that is accessible from layer classes during network evaluation.
|
pure virtualnoexcept |
Perform generic forward activation.
Layer classes should call this for any activations they do not support with their own pre-fused implementations. Modifies layer tensors directly.
pLayer | Layer to perform activation step for |
|
pure virtualnoexcept |
Retrieves a list of layers directly depending on pLayer.
ppListOut | Receives a reference to a new ILayerList containing layers depending directly on pLayer. Does not contain pLayer. |
pLayer | Layer to query. |
|
pure virtualnoexcept |
Retrieves a list of layers present in the network.
The collection is not sorted.
ppListOut | Receives a reference to a new ILayerList object. Caller must release it. |
|
pure virtualnoexcept |
Retrieves an installed network backend.
backendId | Network backend identifier to retrieve |
|
pure virtualnoexcept |
Retrieves a list of layers indirectly depending on pLayer.
ppListOut | Receives a reference to a new ILayerList containing pLayer and other indirect dependencies. |
pLayer | Layer to query. |
|
pure virtualnoexcept |
Retrieves a list of layers pLayer indirectly depends on.
ppListOut | Receives a reference to a new ILayerList containing layers pLayer relies on, including itself. |
pLayer | Layer to query. |
|
pure virtualnoexcept |
Retrieves a list of input layers present in the network.
Input layers implement the IInputLayer interface.
The collection is not sorted.
ppListOut | Receives a reference to a new ILayerList object. Caller must release it. |
|
pure virtualnoexcept |
Retrieves internal tensor data for a layer.
Returned value is a pointer in the requested backend's address space. For example, this would be a device void* in CUDA.
pLayer | Layer containing the requested data |
backendId | Backend for the destination |
Only INetworkBackend objects will typically need to use this function.
|
pure virtualnoexcept |
Retrieves a layer by name.
pLayerName | Layer name to retrieve |
|
pure virtualnoexcept |
Retrieves the internal dimensions of a layer.
In the general case this method is equivalent to ILayer::internalDimensions but it also handles the case of IBypassLayers, if the layer will be bypassed the internal dimensions returned will be the aliased layer ones.
pLayer | Layer associated with the requested data |
|
pure virtualnoexcept |
Retrieves a list of output layers present in the network.
Output layers are not consumed as inputs by other layers. This is not the same as the "Output" layer type; those layers are trimmed during network construction to reduce memory copies.
ppListOut | Receives a reference to a new ILayerList object. Caller must release it. |
|
pure virtualnoexcept |
Retrieves tensor data from one layer on behalf of another.
Returned value is a pointer in the requesting layer's backend's address space. For example, this would be a device void* in CUDA.
pDataLayer | Layer containing the requested data |
pRequestingLayer | Layer requesting the data |
format | Tensor format to deliver data in |
|
pure virtualnoexcept |
Retrieves the dimensions of specific weights data for a layer.
pDimensionsOut | Output pointer to the requested dimensions |
pLayer | Layer associated with the requested data |
pWeightsName | Name of the weights data |
backendId | Backend ID to query |
format | Tensor format to query |
|
pure virtualnoexcept |
Retrieves specific weights data for a layer.
Returned value is a pointer in the requested backend's address space. For example, this would be a device void* in CUDA.
Returned value is also in the format requested.
pLayer | Layer associated with the requested data |
pWeightsName | Name of the weights data |
backendId | Backend ID to deliver data using |
format | Tensor format to deliver data in |
|
pure virtualnoexcept |
Maps a layer as a source of weights data for another layer.
Calls to getWeightsForLayer from pDataLayer requesting pWeightsName will return the output tensor of pWeightsLayer rather than dispatching to the network's weights loader.
To unmap a layer from this system, pass nullptr as pWeightsLayer.
pDataLayer | Layer that will request weights |
pWeightsLayer | Layer that will provide weights |
pWeightsName | Name to use for the weights data |
|
pure virtualnoexcept |
Queues a layer for later reshape.
The reshape operation will happen prior to the next inference pass.
|
pure virtualnoexcept |
Marks a layer and its descendants (those layers indirectly depending on it) as "affected.".
This is equivalent to calling ILayer::setAffected on everything returned by getDependentLayers. It is provided to layer classes as a convenience function.
pLayer | Layer to mark |