Skip to main content

IEngineInspector

Struct IEngineInspector 

Source
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

Source

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.

Source

pub fn getExecutionContext(self: &IEngineInspector) -> *const IExecutionContext

Get the context currently being inspected.

The pointer to the context currently being inspected.

See [setExecutionContext()]

Source

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.

  • layerIndex the index of the layer. It must lie in range [0, engine.getNbLayers()).

  • format the 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.

See LayerInformationFormat

Source

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.

  • format the 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.

See LayerInformationFormat

Source

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.

  • recorder The error recorder to register with this interface.

See [getErrorRecorder()]

Source

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()]

Trait Implementations§

Source§

impl Drop for IEngineInspector

Source§

fn drop(self: &mut IEngineInspector)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ExternType for IEngineInspector

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, E, n, g, i, n, e, I, n, s, p, e, c, t, o, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for IEngineInspector

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IEngineInspector

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut IEngineInspector)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl SharedPtrTarget for IEngineInspector

Source§

impl UniquePtrTarget for IEngineInspector

Source§

impl WeakPtrTarget for IEngineInspector

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.