TensorRT 10.0.1
nvinfer1::safe::IRuntime Class Referenceabstract

Allows a serialized functionally safe engine to be deserialized. More...

#include <NvInferSafeRuntime.h>

Public Member Functions

virtual ICudaEnginedeserializeCudaEngine (void const *const blob, std::size_t const size) noexcept=0
 Deserialize an engine from a byte array. More...
 
virtual void setGpuAllocator (IGpuAllocator *const allocator) noexcept=0
 Set the GPU allocator. More...
 
virtual void setErrorRecorder (IErrorRecorder *const recorder) noexcept=0
 Set the ErrorRecorder for this interface. More...
 
virtual IErrorRecordergetErrorRecorder () const noexcept=0
 Get the ErrorRecorder assigned to this interface. More...
 
 IRuntime ()=default
 
virtual ~IRuntime () noexcept=default
 
 IRuntime (IRuntime const &)=delete
 
 IRuntime (IRuntime &&)=delete
 
IRuntimeoperator= (IRuntime const &) &=delete
 
IRuntimeoperator= (IRuntime &&) &=delete
 

Detailed Description

Allows a serialized functionally safe engine to be deserialized.

Warning
In the safety runtime the application is required to set the error reporter for correct error handling.
See also
setErrorRecorder()
Warning
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Constructor & Destructor Documentation

◆ IRuntime() [1/3]

nvinfer1::safe::IRuntime::IRuntime ( )
default

◆ ~IRuntime()

virtual nvinfer1::safe::IRuntime::~IRuntime ( )
virtualdefaultnoexcept

◆ IRuntime() [2/3]

nvinfer1::safe::IRuntime::IRuntime ( IRuntime const &  )
delete

◆ IRuntime() [3/3]

nvinfer1::safe::IRuntime::IRuntime ( IRuntime &&  )
delete

Member Function Documentation

◆ deserializeCudaEngine()

virtual ICudaEngine * nvinfer1::safe::IRuntime::deserializeCudaEngine ( void const *const  blob,
std::size_t const  size 
)
pure virtualnoexcept

Deserialize an engine from a byte array.

If the serialized engine requires plugins the plugin creator must be registered by calling IPluginRegistry::registerCreator() before calling deserializeCudaEngine().

Parameters
blobThe memory that holds the serialized engine. The content must be a copy of the result of calling IHostMemory::data() on a serialized plan that was created via calling IBuilder::buildSerializedNetwork() on a network within the supported safety scope. Additionally, it must have been validated via IConsistencyChecker::validate().
sizeThe size of the memory in bytes. This must be the result of calling IHostMemory::size() on the same IHostMemory object that is associated with the blob parameter.
Returns
The engine, or nullptr if it could not be deserialized.
See also
IPluginRegistry::registerCreator()


Usage considerations

  • Allowed context for the API call
    • Thread-safe: Yes, if called from different instances of safe::IRuntime. Calling deserializeCudaEngine of the same safety runtime from multiple threads is not guaranteed to be thread safe.

◆ getErrorRecorder()

virtual IErrorRecorder * nvinfer1::safe::IRuntime::getErrorRecorder ( ) const
pure virtualnoexcept

Get the ErrorRecorder assigned to this interface.

Retrieves the assigned error recorder object for the given class. A default error recorder does not exist, so a nullptr will be returned if setErrorRecorder has not been called or a previously assigned error recorder has been deregistered.

Returns
A pointer to the IErrorRecorder object that has been registered, or nullptr if no error recorder is set.
See also
setErrorRecorder()


Usage considerations

  • Allowed context for the API call
    • Thread-safe: Yes

◆ operator=() [1/2]

IRuntime & nvinfer1::safe::IRuntime::operator= ( IRuntime &&  ) &
delete

◆ operator=() [2/2]

IRuntime & nvinfer1::safe::IRuntime::operator= ( IRuntime const &  ) &
delete

◆ setErrorRecorder()

virtual void nvinfer1::safe::IRuntime::setErrorRecorder ( IErrorRecorder *const  recorder)
pure virtualnoexcept

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. If the recorder is set to nullptr, an error code of ErrorCode::kINVALID_ARGUMENT will be emitted if the recorder has already been registered, or ILogger::Severity::kERROR will be logged if the recorder has not yet been registered.

Parameters
recorderThe error recorder to register with this interface, or nullptr to deregister the current error recorder.
See also
getErrorRecorder()


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

◆ setGpuAllocator()

virtual void nvinfer1::safe::IRuntime::setGpuAllocator ( IGpuAllocator *const  allocator)
pure virtualnoexcept

Set the GPU allocator.

Parameters
allocatorThe GPU allocator to be used by the runtime. All GPU memory acquired will use this allocator. If nullptr is passed, the default allocator will be used, which calls cudaMalloc and cudaFree.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No

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