@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IRuntime extends INoCopy
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IRuntime()
Default native constructor.
|
IRuntime(long size)
Native array allocator.
|
IRuntime(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
ICudaEngine |
deserializeCudaEngine(Pointer blob,
long size)
\brief Deserialize an engine from a stream.
|
ICudaEngine |
deserializeCudaEngine(Pointer blob,
long size,
IPluginFactory pluginFactory)
Deprecated.
Deprecated in TensorRT 8.0.
\warning IPluginFactory is no longer supported, therefore pluginFactory must be a nullptr.
|
void |
destroy()
Deprecated.
Deprecated in TRT 8.0. Superseded by
delete .
\warning Calling destroy on a managed pointer will result in a double-free error. |
int |
getDLACore()
\brief Get the DLA core that the engine executes on.
|
boolean |
getEngineHostCodeAllowed()
\brief Get whether the runtime is allowed to deserialize engines with host executable code.
|
IErrorRecorder |
getErrorRecorder()
\brief get the ErrorRecorder assigned to this interface.
|
ILogger |
getLogger()
\brief get the logger with which the runtime was created
|
int |
getMaxThreads()
\brief Get the maximum number of threads that can be used by the runtime.
|
int |
getNbDLACores()
\brief Returns number of DLA hardware cores accessible or 0 if DLA is unavailable.
|
IPluginRegistry |
getPluginRegistry()
\brief Get the local plugin registry that can be used by the runtime.
|
IRuntime |
getPointer(long i) |
int |
getTempfileControlFlags()
\brief Get the tempfile control flags for this runtime.
|
String |
getTemporaryDirectory()
\brief Get the directory that will be used by this runtime for temporary files.
|
IRuntime |
loadRuntime(BytePointer path) |
IRuntime |
loadRuntime(String path)
\brief Load IRuntime from the file.
|
IRuntime |
position(long position) |
void |
setDLACore(int dlaCore)
\brief Sets the DLA core used by the network.
|
void |
setEngineHostCodeAllowed(boolean allowed)
\brief Set whether the runtime is allowed to deserialize engines with host executable code.
|
void |
setErrorRecorder(IErrorRecorder recorder) |
void |
setGpuAllocator(IGpuAllocator allocator)
\brief Set the GPU allocator.
|
boolean |
setMaxThreads(int maxThreads)
\brief Set the maximum number of threads.
|
void |
setTempfileControlFlags(int flags)
\brief Set the tempfile control flags for this runtime.
|
void |
setTemporaryDirectory(BytePointer path) |
void |
setTemporaryDirectory(String path)
\brief Set the directory that will be used by this runtime for temporary files.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public IRuntime()
public IRuntime(long size)
Pointer.position(long)
.public IRuntime(Pointer p)
Pointer(Pointer)
.public IRuntime getPointer(long i)
getPointer
in class Pointer
@Deprecated @NoException(value=true) public ICudaEngine deserializeCudaEngine(@Const Pointer blob, @Cast(value="std::size_t") long size, IPluginFactory pluginFactory)
blob
- The memory that holds the serialized engine.size
- The size of the memory in bytes.pluginFactory
- The plugin factory, if any plugins are used by the network, otherwise nullptr.@NoException(value=true) public void setDLACore(int dlaCore)
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.
\warning if getNbDLACores() returns 0, then this function does nothing.getDLACore()
@NoException(value=true) public int getDLACore()
@NoException(value=true) public int getNbDLACores()
@Deprecated @NoException(value=true) public void destroy()
delete
.
\warning Calling destroy on a managed pointer will result in a double-free error.@NoException(value=true) public void setGpuAllocator(IGpuAllocator 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.@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
/**
@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()
@NoException(value=true) public ICudaEngine deserializeCudaEngine(@Const Pointer blob, @Cast(value="std::size_t") long size)
blob
- The memory that holds the serialized engine.size
- The size of the memory.@NoException(value=true) public ILogger getLogger()
@Cast(value="bool") @NoException(value=true) public boolean setMaxThreads(int maxThreads)
maxThreads
- The maximum number of threads that can be used by the runtime.@NoException(value=true) public int getMaxThreads()
setMaxThreads()
@NoException(value=true) public void setTemporaryDirectory(String path)
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:
- On UNIX/Linux platforms, TensorRT will first try the TMPDIR environment variable, then fall back to /tmp
- On Windows, TensorRT will try the TEMP environment variable.
See the TensorRT Developer Guide for more information.
The default value is nullptr.
\warning If path is not nullptr, it must be a non-empty string representing a relative
or absolute path in the format expected by the host operating system.
\warning The string path must be null-terminated, and be at most 4096 bytes including the
terminator. Note that the operating system may have stricter path length requirements.
\warning The process using TensorRT must have rwx permissions for the temporary directory,
and the directory shall be configured to disallow other users from modifying created files
(e.g. on Linux, if the directory is shared with other users, the sticky bit must be set).getTemporaryDirectory()
@NoException(value=true) public void setTemporaryDirectory(@Cast(value="const char*") BytePointer path)
@NoException(value=true) public String getTemporaryDirectory()
setTemporaryDirectory()
@NoException(value=true) public void setTempfileControlFlags(@Cast(value="nvinfer1::TempfileControlFlags") int flags)
flags
- The flags to set.
The default value is all flags set, i.e.
(1U << static_castTempfileControlFlag, TempfileControlFlags, getTempfileControlFlags()
@Cast(value="nvinfer1::TempfileControlFlags") @NoException(value=true) public int getTempfileControlFlags()
TempfileControlFlag, TempfileControlFlags, setTempfileControlFlags()
@ByRef @NoException(value=true) public IPluginRegistry getPluginRegistry()
@NoException(value=true) public IRuntime loadRuntime(String path)
path
- Path to the runtime lean library.@NoException(value=true) public IRuntime loadRuntime(@Cast(value="const char*") BytePointer path)
@NoException(value=true) public void setEngineHostCodeAllowed(@Cast(value="bool") boolean allowed)
allowed
- Whether the runtime is allowed to deserialize engines with host executable code.
The default value is false.@Cast(value="bool") @NoException(value=true) public boolean getEngineHostCodeAllowed()
Copyright © 2024. All rights reserved.