Allows a serialized functionally safe engine to be deserialized.
More...
#include <NvInferSafeRuntime.h>
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.
◆ 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 |
◆ 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
-
blob | The 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(). |
size | The 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
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ 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
-
recorder | The 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
◆ setGpuAllocator()
virtual void nvinfer1::safe::IRuntime::setGpuAllocator |
( |
IGpuAllocator *const |
allocator | ) |
|
|
pure virtualnoexcept |
Set the GPU allocator.
- Parameters
-
allocator | The 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
The documentation for this class was generated from the following file: