TensorRT 11.2.1
nvinfer2::safe::ISafeRecorder Class Reference

Interface for extended recorder which allows error, warn, debug, or info messages to be recorded. More...

#include <NvInferSafeRecorder.h>

Inheritance diagram for nvinfer2::safe::ISafeRecorder:
nvinfer1::v_1_0::IErrorRecorder nvinfer1::IVersionedInterface

Public Member Functions

 ISafeRecorder (Severity severity_=Severity::kERROR, int32_t id_=-1)
 Constructor for ISafeRecorder. More...
 
 ISafeRecorder (ISafeRecorder const &)=delete
 Deleted copy constructor to maintain non-copyability. More...
 
 ISafeRecorder (ISafeRecorder &&)=delete
 Deleted move constructor to maintain non-movability. More...
 
ISafeRecorderoperator= (ISafeRecorder const &) &=delete
 Deleted copy assignment operator to maintain non-copyability. More...
 
ISafeRecorderoperator= (ISafeRecorder &&) &=delete
 Deleted move assignment operator to maintain non-movability. More...
 
 ~ISafeRecorder () noexcept override=default
 Destructor for ISafeRecorder. More...
 
virtual void setSeverity (Severity severity_) noexcept
 Sets the severity level for the recorder. More...
 
virtual Severity getSeverity () const noexcept
 Get the current severity level of the recorder. More...
 
virtual int32_t getId () const noexcept
 Gets the identifier of the recorder. More...
 
virtual bool reportWarn (ErrorDesc) noexcept
 Reports a warning message. More...
 
virtual bool reportDebug (ErrorDesc) noexcept
 Reports a debug message. More...
 
virtual bool reportInfo (ErrorDesc) noexcept
 Reports an informational message. More...
 
virtual bool reportVerbose (ErrorDesc) noexcept
 Reports a verbose informational message. More...
 
- Public Member Functions inherited from nvinfer1::v_1_0::IErrorRecorder
InterfaceInfo getInterfaceInfo () const noexcept override
 Return version information associated with this interface. Applications must not override this method. More...
 
 IErrorRecorder ()=default
 
 ~IErrorRecorder () noexcept override=default
 
virtual int32_t getNbErrors () const noexcept=0
 Return the number of errors. More...
 
virtual ErrorCode getErrorCode (int32_t errorIdx) const noexcept=0
 Returns the ErrorCode enumeration. More...
 
virtual ErrorDesc getErrorDesc (int32_t errorIdx) const noexcept=0
 Returns a null-terminated C-style string description of the error. More...
 
virtual bool hasOverflowed () const noexcept=0
 Determine if the error stack has overflowed. More...
 
virtual void clear () noexcept=0
 Clear the error stack on the error recorder. More...
 
virtual bool reportError (ErrorCode val, ErrorDesc desc) noexcept=0
 Report an error to the error recorder with the corresponding enum and description. More...
 
virtual RefCount incRefCount () noexcept=0
 Increments the refcount for the current ErrorRecorder. More...
 
virtual RefCount decRefCount () noexcept=0
 Decrements the refcount for the current ErrorRecorder. More...
 
- Public Member Functions inherited from nvinfer1::IVersionedInterface
virtual APILanguage getAPILanguage () const noexcept
 The language used to build the implementation of this Interface. More...
 
virtual ~IVersionedInterface () noexcept=default
 

Static Public Attributes

static constexpr size_t kMAX_SAFE_DESC_LENGTH {4095U}
 The length limit for an error description in bytes, excluding the '\0' string terminator. More...
 
- Static Public Attributes inherited from nvinfer1::v_1_0::IErrorRecorder
static constexpr size_t kMAX_DESC_LENGTH {127U}
 The length limit for an error description in bytes, excluding the '\0' string terminator. Only applicable to safe runtime. General error recorder implementation can use any size appropriate for the use case. More...
 

Protected Attributes

Severity mSeverity
 Severity level of the recorder; messages above this level are filtered. More...
 
int32_t const mId
 Identifier of the recorder instance; used to distinguish recorders in multi-threaded use. More...
 

Additional Inherited Members

- Public Types inherited from nvinfer1::v_1_0::IErrorRecorder
using ErrorDesc = char const *
 A typedef of a C-style string for reporting error descriptions. More...
 
using RefCount = int32_t
 A typedef of a 32-bit integer for reference counting. More...
 
- Protected Member Functions inherited from nvinfer1::IVersionedInterface
 IVersionedInterface ()=default
 
 IVersionedInterface (IVersionedInterface const &)=default
 
 IVersionedInterface (IVersionedInterface &&)=default
 
IVersionedInterfaceoperator= (IVersionedInterface const &) &=default
 
IVersionedInterfaceoperator= (IVersionedInterface &&) &=default
 

Detailed Description

Interface for extended recorder which allows error, warn, debug, or info messages to be recorded.

Inherits from IErrorRecorder and extends functionality to include various levels of message severity.

Note
Any user implementation of this interface must ensure that error messages are always reported and not suppressed due to lower reporting severity.

Constructor & Destructor Documentation

◆ ISafeRecorder() [1/3]

nvinfer2::safe::ISafeRecorder::ISafeRecorder ( Severity  severity_ = Severity::kERROR,
int32_t  id_ = -1 
)
inline

Constructor for ISafeRecorder.

Precondition
INIT API
Parameters
[in]severity_Initial severity level for recording messages. Only messages with severity less than or equal to this level will be reported.
[in]id_Optional identifier for the recorder instance; used to identify messages issued by different recorders in multiple threads.
Postcondition
Object is constructed with the given severity and id; ready to receive messages.

◆ ISafeRecorder() [2/3]

nvinfer2::safe::ISafeRecorder::ISafeRecorder ( ISafeRecorder const &  )
delete

Deleted copy constructor to maintain non-copyability.

Precondition
none
Postcondition
none

◆ ISafeRecorder() [3/3]

nvinfer2::safe::ISafeRecorder::ISafeRecorder ( ISafeRecorder &&  )
delete

Deleted move constructor to maintain non-movability.

Precondition
none
Postcondition
none

◆ ~ISafeRecorder()

nvinfer2::safe::ISafeRecorder::~ISafeRecorder ( )
overridedefaultnoexcept

Destructor for ISafeRecorder.

Precondition
none
Postcondition
Object is destroyed and resources released.

Member Function Documentation

◆ getId()

virtual int32_t nvinfer2::safe::ISafeRecorder::getId ( ) const
inlinevirtualnoexcept

Gets the identifier of the recorder.

Precondition
RUNTIME API
Postcondition
none
Returns
The identifier of the recorder.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ getSeverity()

virtual Severity nvinfer2::safe::ISafeRecorder::getSeverity ( ) const
inlinevirtualnoexcept

Get the current severity level of the recorder.

Precondition
RUNTIME API
Postcondition
none
Returns
The severity level of the recorder.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ operator=() [1/2]

ISafeRecorder & nvinfer2::safe::ISafeRecorder::operator= ( ISafeRecorder &&  ) &
delete

Deleted move assignment operator to maintain non-movability.

Precondition
none
Postcondition
none

◆ operator=() [2/2]

ISafeRecorder & nvinfer2::safe::ISafeRecorder::operator= ( ISafeRecorder const &  ) &
delete

Deleted copy assignment operator to maintain non-copyability.

Precondition
none
Postcondition
none

◆ reportDebug()

virtual bool nvinfer2::safe::ISafeRecorder::reportDebug ( ErrorDesc  )
inlinevirtualnoexcept

Reports a debug message.

Parameters
[in]descDescription of the debug information.
Precondition
RUNTIME API
Postcondition
If true, message was recorded; if false, recording failed or was suppressed.
Returns
True if the message was reported successfully, false otherwise.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ reportInfo()

virtual bool nvinfer2::safe::ISafeRecorder::reportInfo ( ErrorDesc  )
inlinevirtualnoexcept

Reports an informational message.

Parameters
[in]descDescription of the information.
Precondition
RUNTIME API
Postcondition
If true, message was recorded; if false, recording failed or was suppressed.
Returns
True if the message was reported successfully, false otherwise.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ reportVerbose()

virtual bool nvinfer2::safe::ISafeRecorder::reportVerbose ( ErrorDesc  )
inlinevirtualnoexcept

Reports a verbose informational message.

Parameters
[in]descDescription of the information.
Precondition
RUNTIME API
Postcondition
If true, message was recorded; if false, recording failed or was suppressed.
Returns
True if the message was reported successfully, false otherwise.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ reportWarn()

virtual bool nvinfer2::safe::ISafeRecorder::reportWarn ( ErrorDesc  )
inlinevirtualnoexcept

Reports a warning message.

Parameters
[in]descDescription of the warning.
Precondition
RUNTIME API
Postcondition
If true, message was recorded; if false, recording failed or was suppressed.
Returns
True if the message was reported successfully, false otherwise.
Remarks
This method is required to be thread-safe and may be called from multiple threads when multiple execution contexts are used during runtime.

◆ setSeverity()

virtual void nvinfer2::safe::ISafeRecorder::setSeverity ( Severity  severity_)
inlinevirtualnoexcept

Sets the severity level for the recorder.

Parameters
[in]severity_New severity level for recording messages.
Precondition
RUNTIME API
Postcondition
Recorder severity is set to severity_; subsequent messages filtered by this level.
Remarks
Not thread-safe

Member Data Documentation

◆ kMAX_SAFE_DESC_LENGTH

constexpr size_t nvinfer2::safe::ISafeRecorder::kMAX_SAFE_DESC_LENGTH {4095U}
staticconstexpr

The length limit for an error description in bytes, excluding the '\0' string terminator.

Note
Only applicable to messages issued by the TensorRT safe runtime. User recorder implementation can use any size appropriate for the use case.

◆ mId

int32_t const nvinfer2::safe::ISafeRecorder::mId
protected

Identifier of the recorder instance; used to distinguish recorders in multi-threaded use.

◆ mSeverity

Severity nvinfer2::safe::ISafeRecorder::mSeverity
protected

Severity level of the recorder; messages above this level are filtered.


The documentation for this class was generated from the following file:

  Copyright © 2024 NVIDIA Corporation
  Privacy Policy | Manage My Privacy | Do Not Sell or Share My Data | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact