pub struct IEngineInspector { /* private fields */ }Expand description
IEngineInspector
An engine inspector which prints out the layer information of an engine or an execution context.
The amount of printed information depends on the profiling verbosity setting of the builder config when the engine is built:
- ProfilingVerbosity::kLAYER_NAMES_ONLY: only layer names will be printed.
- ProfilingVerbosity::kNONE: no layer information will be printed.
- ProfilingVerbosity::kDETAILED: layer names and layer parameters will be printed.
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
See ProfilingVerbosity, IEngineInspector
Implementations§
Source§impl IEngineInspector
impl IEngineInspector
Sourcepub unsafe fn setExecutionContext(
self: Pin<&mut IEngineInspector>,
context: *const IExecutionContext,
) -> bool
pub unsafe fn setExecutionContext( self: Pin<&mut IEngineInspector>, context: *const IExecutionContext, ) -> bool
Set an execution context as the inspection source.
Setting the execution context and specifying all the input shapes allows the inspector to calculate concrete dimensions for any dynamic shapes and display their format information. Otherwise, values dependent on input shapes will be displayed as -1 and format information will not be shown.
Passing nullptr will remove any association with an execution context.
Whether the action succeeds.
Sourcepub fn getExecutionContext(self: &IEngineInspector) -> *const IExecutionContext
pub fn getExecutionContext(self: &IEngineInspector) -> *const IExecutionContext
Get the context currently being inspected.
The pointer to the context currently being inspected.
See [setExecutionContext()]
Sourcepub fn getLayerInformation(
self: &IEngineInspector,
layerIndex: i32,
format: LayerInformationFormat,
) -> *const c_char
pub fn getLayerInformation( self: &IEngineInspector, layerIndex: i32, format: LayerInformationFormat, ) -> *const c_char
Get a string describing the information about a specific layer in the current engine or the execution context.
-
layerIndexthe index of the layer. It must lie in range [0, engine.getNbLayers()). -
formatthe format the layer information should be printed in.
A null-terminated C-style string describing the information about a specific layer in the current engine or the execution context.
The content of the returned string may change when another execution context has been set, or when another getLayerInformation() or getEngineInformation() has been called.
In a multi-threaded environment, this function must be protected from other threads changing the inspection source. If the inspection source changes, the data that is being pointed to can change. Copy the string to another buffer before releasing the lock in order to guarantee consistency.
Sourcepub fn getEngineInformation(
self: &IEngineInspector,
format: LayerInformationFormat,
) -> *const c_char
pub fn getEngineInformation( self: &IEngineInspector, format: LayerInformationFormat, ) -> *const c_char
Get a string describing the information about all the layers in the current engine or the execution context.
formatthe format the layer information should be printed in.
A null-terminated C-style string describing the information about all the layers in the current engine or the execution context.
The content of the returned string may change when another execution context has been set, or when another getLayerInformation() or getEngineInformation() has been called.
In a multi-threaded environment, this function must be protected from other threads changing the inspection source. If the inspection source changes, the data that is being pointed to can change. Copy the string to another buffer before releasing the lock in order to guarantee consistency.
Sourcepub unsafe fn setErrorRecorder(
self: Pin<&mut IEngineInspector>,
recorder: *mut IErrorRecorder,
)
pub unsafe fn setErrorRecorder( self: Pin<&mut IEngineInspector>, recorder: *mut IErrorRecorder, )
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.
If an error recorder is not set, messages will be sent to the global log stream.
recorderThe error recorder to register with this interface.
See [getErrorRecorder()]
Sourcepub fn getErrorRecorder(self: &IEngineInspector) -> *mut IErrorRecorder
pub fn getErrorRecorder(self: &IEngineInspector) -> *mut IErrorRecorder
Get the ErrorRecorder assigned to this interface.
Retrieves the assigned error recorder object for the given class. A nullptr will be returned if an error handler has not been set.
A pointer to the IErrorRecorder object that has been registered.
See [setErrorRecorder()]