Skip to main content

IErrorRecorder

Struct IErrorRecorder 

Source
pub struct IErrorRecorder { /* private fields */ }

Implementations§

Source§

impl IErrorRecorder

Source

pub fn getInterfaceInfo<'a>( self: &'a IErrorRecorder, ) -> impl New<Output = InterfaceInfo> + 'a

Return version information associated with this interface. Applications must not override this method.

Source

pub fn getNbErrors(self: &IErrorRecorder) -> i32

Return the number of errors

Determines the number of errors that occurred between the current point in execution and the last time that the clear() was executed. Due to the possibility of asynchronous errors occurring, a TensorRT API can return correct results, but still register errors with the Error Recorder. The value of getNbErrors() must increment by 1 after each reportError() call until clear() is called, or the maximum number of errors that can be stored is exceeded.

Returns the number of errors detected, or 0 if there are no errors. If the upper bound of errors that can be stored is exceeded, the upper bound value must be returned.

For example, if the error recorder can store up to 16 error descriptions but reportError() has been called 20 times, getNbErrors() must return 16.

See [clear()], hasOverflowed()

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn getErrorCode(self: &IErrorRecorder, errorIdx: i32) -> i32

Returns the ErrorCode enumeration.

  • errorIdx A 32-bit integer that indexes into the error array.

The errorIdx specifies what error code from 0 to getNbErrors()-1 that the application wants to analyze and return the error code enum.

Returns the enum corresponding to errorIdx if errorIdx is in range (between 0 and getNbErrors()-1). ErrorCode::kUNSPECIFIED_ERROR must be returned if errorIdx is not in range.

See [getErrorDesc()], ErrorCode

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn getErrorDesc(self: &IErrorRecorder, errorIdx: i32) -> *const c_char

Returns a null-terminated C-style string description of the error.

  • errorIdx A 32-bit integer that indexes into the error array.

For the error specified by the idx value, return the string description of the error. The error string is a null-terminated C-style string. In the safety context there is a constant length requirement to remove any dynamic memory allocations and the error message will be truncated if it exceeds kMAX_DESC_LENGTH bytes. The format of the string is “ - ”.

Returns a string representation of the error along with a description of the error if errorIdx is in range (between 0 and getNbErrors()-1). An empty string will be returned if errorIdx is not in range.

See [getErrorCode()]

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn hasOverflowed(self: &IErrorRecorder) -> bool

Determine if the error stack has overflowed.

In the case when the number of errors is large, this function is used to query if one or more errors have been dropped due to lack of storage capacity. This is especially important in the automotive safety case where the internal error handling mechanisms cannot allocate memory.

true if errors have been dropped due to overflowing the error stack.

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn clear(self: Pin<&mut IErrorRecorder>)

Clear the error stack on the error recorder.

Removes all the tracked errors by the error recorder. The implementation must guarantee that after this function is called, and as long as no error occurs, the next call to getNbErrors will return zero and hasOverflowed will return false.

See [getNbErrors()], hasOverflowed()

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub unsafe fn reportError( self: Pin<&mut IErrorRecorder>, val: i32, desc: *const c_char, ) -> bool

Report an error to the error recorder with the corresponding enum and description.

  • val The error code enum that is being reported.
  • desc The string description of the error, which will be a NULL-terminated string. For safety use cases its length is limited to kMAX_DESC_LENGTH bytes (excluding the NULL terminator) and descriptions that exceed this limit will be silently truncated.

Report an error to the user that has a given value and human readable description. The function returns false if processing can continue, which implies that the reported error is not fatal. This does not guarantee that processing continues, but provides a hint to TensorRT. The desc C-string data is only valid during the call to reportError and may be immediately deallocated by the caller when reportError returns. The implementation must not store the desc pointer in the ErrorRecorder object or otherwise access the data from desc after reportError returns.

True if the error is determined to be fatal and processing of the current function must end.

If the error recorder’s maximum number of storable errors is exceeded, the error description will be silently dropped and the value returned by getNbErrors() will not be incremented. However, the return value will still signal whether the error must be considered fatal.

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn incRefCount(self: Pin<&mut IErrorRecorder>) -> i32

Increments the refcount for the current ErrorRecorder.

Increments the reference count for the object by one and returns the current value. This reference count allows the application to know that an object inside of TensorRT has taken a reference to the ErrorRecorder. TensorRT guarantees that every call to IErrorRecorder::incRefCount() will be paired with a call to IErrorRecorder::decRefCount() when the reference is released. It is undefined behavior to destruct the ErrorRecorder when incRefCount() has been called without a corresponding decRefCount().

The reference counted value after the increment completes.

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.
Source

pub fn decRefCount(self: Pin<&mut IErrorRecorder>) -> i32

Decrements the refcount for the current ErrorRecorder.

Decrements the reference count for the object by one and returns the current value. This reference count allows the application to know that an object inside of TensorRT has taken a reference to the ErrorRecorder. TensorRT guarantees that every call to IErrorRecorder::decRefCount() will be preceded by a call to IErrorRecorder::incRefCount(). It is undefined behavior to destruct the ErrorRecorder when incRefCount() has been called without a corresponding decRefCount().

The reference counted value after the decrement completes.

  • Allowed context for the API call
  • Thread-safe: Yes, this method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

Trait Implementations§

Source§

impl AsRef<IVersionedInterface> for IErrorRecorder

Source§

fn as_ref(self: &IErrorRecorder) -> &IVersionedInterface

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Drop for IErrorRecorder

Source§

fn drop(self: &mut IErrorRecorder)

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 IErrorRecorder

Source§

type Kind = Opaque

Source§

type Id

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

impl MakeCppStorage for IErrorRecorder

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IErrorRecorder

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 IErrorRecorder)

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

impl SharedPtrTarget for IErrorRecorder

Source§

impl UniquePtrTarget for IErrorRecorder

Source§

impl WeakPtrTarget for IErrorRecorder

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.