TensorRT 10.7.0
|
Allows a serialized functionally unsafe engine to be deserialized. More...
#include <NvInferRuntime.h>
Public Member Functions | |
virtual | ~IRuntime () noexcept=default |
void | setDLACore (int32_t dlaCore) noexcept |
Sets the DLA core used by the network. Defaults to -1. More... | |
int32_t | getDLACore () const noexcept |
Get the DLA core that the engine executes on. More... | |
int32_t | getNbDLACores () const noexcept |
Returns number of DLA hardware cores accessible or 0 if DLA is unavailable. More... | |
void | setGpuAllocator (IGpuAllocator *allocator) noexcept |
Set the GPU allocator. More... | |
void | setErrorRecorder (IErrorRecorder *recorder) noexcept |
Set the ErrorRecorder for this interface. More... | |
IErrorRecorder * | getErrorRecorder () const noexcept |
get the ErrorRecorder assigned to this interface. More... | |
ICudaEngine * | deserializeCudaEngine (void const *blob, std::size_t size) noexcept |
Deserialize an engine from host memory. More... | |
TRT_DEPRECATED ICudaEngine * | deserializeCudaEngine (IStreamReader &streamReader) |
Deserialize an engine from a stream. More... | |
ICudaEngine * | deserializeCudaEngine (IStreamReaderV2 &streamReader) |
Deserialize an engine from a stream. IStreamReaderV2 is expected to support reading to both host and device pointers. More... | |
ILogger * | getLogger () const noexcept |
get the logger with which the runtime was created More... | |
bool | setMaxThreads (int32_t maxThreads) noexcept |
Set the maximum number of threads. More... | |
int32_t | getMaxThreads () const noexcept |
Get the maximum number of threads that can be used by the runtime. More... | |
void | setTemporaryDirectory (char const *path) noexcept |
Set the directory that will be used by this runtime for temporary files. More... | |
char const * | getTemporaryDirectory () const noexcept |
Get the directory that will be used by this runtime for temporary files. More... | |
void | setTempfileControlFlags (TempfileControlFlags flags) noexcept |
Set the tempfile control flags for this runtime. More... | |
TempfileControlFlags | getTempfileControlFlags () const noexcept |
Get the tempfile control flags for this runtime. More... | |
IPluginRegistry & | getPluginRegistry () noexcept |
Get the local plugin registry that can be used by the runtime. More... | |
IRuntime * | loadRuntime (char const *path) noexcept |
Load IRuntime from the file. More... | |
void | setEngineHostCodeAllowed (bool allowed) noexcept |
Set whether the runtime is allowed to deserialize engines with host executable code. More... | |
bool | getEngineHostCodeAllowed () const noexcept |
Get whether the runtime is allowed to deserialize engines with host executable code. More... | |
Protected Attributes | |
apiv::VRuntime * | mImpl |
Additional Inherited Members | |
Protected Member Functions inherited from nvinfer1::INoCopy | |
INoCopy ()=default | |
virtual | ~INoCopy ()=default |
INoCopy (INoCopy const &other)=delete | |
INoCopy & | operator= (INoCopy const &other)=delete |
INoCopy (INoCopy &&other)=delete | |
INoCopy & | operator= (INoCopy &&other)=delete |
Allows a serialized functionally unsafe engine to be deserialized.
|
virtualdefaultnoexcept |
|
inline |
Deserialize an engine from a stream.
If an error recorder has been set for the runtime, it will also be passed to the engine.
This deserialization path will reduce host memory usage when weight streaming is enabled.
streamReader | a read-only stream from which TensorRT will deserialize a previously serialized engine. |
|
inline |
Deserialize an engine from a stream. IStreamReaderV2 is expected to support reading to both host and device pointers.
If an error recorder has been set for the runtime, it will also be passed to the engine.
This deserialization path will reduce engine load time when applied with GDS (GPU Direct storage), or when weight streaming is enabled.
streamReader | a read-only stream from which TensorRT will deserialize a previously serialized engine. |
stream | The CUDA stream used when performing asynchronous I/O. |
|
inlinenoexcept |
Deserialize an engine from host memory.
If an error recorder has been set for the runtime, it will also be passed to the engine.
blob | The memory that holds the serialized engine. |
size | The size of the memory. |
|
inlinenoexcept |
Get the DLA core that the engine executes on.
|
inlinenoexcept |
Get whether the runtime is allowed to deserialize engines with host executable code.
|
inlinenoexcept |
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.
|
inlinenoexcept |
get the logger with which the runtime was created
|
inlinenoexcept |
Get the maximum number of threads that can be used by the runtime.
Retrieves the maximum number of threads that can be used by the runtime.
|
inlinenoexcept |
Returns number of DLA hardware cores accessible or 0 if DLA is unavailable.
|
inlinenoexcept |
Get the local plugin registry that can be used by the runtime.
|
inlinenoexcept |
Get the tempfile control flags for this runtime.
|
inlinenoexcept |
Get the directory that will be used by this runtime for temporary files.
|
inlinenoexcept |
Load IRuntime from the file.
This method loads a runtime library from a shared library file. The runtime can then be used to execute a plan file built with BuilderFlag::kVERSION_COMPATIBLE and BuilderFlag::kEXCLUDE_LEAN_RUNTIME both set and built with the same version of TensorRT as the loaded runtime library.
path | Path to the runtime lean library. |
|
inlinenoexcept |
Sets the DLA core used by the network. Defaults to -1.
dlaCore | The DLA core to execute the engine on, in the range [0,getNbDlaCores()). |
This function is used to specify which DLA core to use via indexing, if multiple DLA cores are available.
|
inlinenoexcept |
Set whether the runtime is allowed to deserialize engines with host executable code.
allowed | Whether the runtime is allowed to deserialize engines with host executable code. |
The default value is false.
|
inlinenoexcept |
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. |
|
inlinenoexcept |
Set the GPU allocator.
allocator | Set the GPU allocator to be used by the runtime. All GPU memory acquired will use this allocator. If NULL is passed, the default allocator will be used. |
Default: uses cudaMalloc/cudaFree.
If nullptr is passed, the default allocator will be used.
|
inlinenoexcept |
Set the maximum number of threads.
maxThreads | The maximum number of threads that can be used by the runtime. |
The default value is 1 and includes the current thread. A value greater than 1 permits TensorRT to use multi-threaded algorithms. A value less than 1 triggers a kINVALID_ARGUMENT error.
|
inlinenoexcept |
Set the tempfile control flags for this runtime.
flags | The flags to set. |
The default value is all flags set, i.e.
(1U << static_cast<uint32_t>(kALLOW_IN_MEMORY_FILES)) | (1U << static_cast<uint32_t>(kALLOW_TEMPORARY_FILES))
|
inlinenoexcept |
Set the directory that will be used by this runtime for temporary files.
On some platforms the TensorRT runtime may need to create and use temporary files with read/write/execute permissions to implement runtime functionality.
path | Path to the temporary directory for use, or nullptr. |
If path is nullptr, then TensorRT will use platform-specific heuristics to pick a default temporary directory if required:
See the TensorRT Developer Guide for more information.
The default value is nullptr.
|
protected |
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