@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IBuilderConfig extends INoCopy
BuilderFlags
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IBuilderConfig()
Default native constructor.
|
IBuilderConfig(long size)
Native array allocator.
|
IBuilderConfig(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addOptimizationProfile(IOptimizationProfile profile)
\brief Add an optimization profile.
|
boolean |
canRunOnDLA(ILayer layer)
\brief Checks if a layer can run on DLA.
|
void |
clearFlag(int builderFlag) |
void |
clearFlag(nvinfer.BuilderFlag builderFlag)
\brief clear a single build mode flag.
|
void |
clearQuantizationFlag(int flag) |
void |
clearQuantizationFlag(nvinfer.QuantizationFlag flag)
\brief clear a quantization flag.
|
ITimingCache |
createTimingCache(Pointer blob,
long size)
\brief Create timing cache
Create ITimingCache instance from serialized raw data.
|
void |
destroy()
Deprecated.
Deprecated in TensorRT 8.0. Superseded by
delete .
\warning Calling destroy on a managed pointer will result in a double-free error. |
IAlgorithmSelector |
getAlgorithmSelector()
\brief Get Algorithm Selector.
|
int |
getAvgTimingIterations()
\brief Query the number of averaging iterations.
|
int |
getBuilderOptimizationLevel()
\brief Get builder optimization level
|
IOptimizationProfile |
getCalibrationProfile()
\brief Get the current calibration profile.
|
nvinfer.DeviceType |
getDefaultDeviceType()
\brief Get the default DeviceType which was set by setDefaultDeviceType.
|
nvinfer.DeviceType |
getDeviceType(ILayer layer)
\brief Get the device that this layer executes on.
|
int |
getDLACore()
\brief Get the DLA core that the engine executes on.
|
nvinfer.EngineCapability |
getEngineCapability()
\brief Query EngineCapability flow configured for the builder.
|
boolean |
getFlag(int builderFlag) |
boolean |
getFlag(nvinfer.BuilderFlag builderFlag)
\brief Returns true if the build mode flag is set
|
int |
getFlags()
\brief Get the build mode flags for this builder config.
|
nvinfer.HardwareCompatibilityLevel |
getHardwareCompatibilityLevel()
\brief Get the hardware compatibility level.
|
IInt8Calibrator |
getInt8Calibrator()
\brief Get Int8 Calibration interface.
|
int |
getMaxAuxStreams()
\brief Get the maximum number of auxiliary streams that TRT is allowed to use.
|
long |
getMaxWorkspaceSize()
Deprecated.
Deprecated in TensorRT 8.3. Superseded by IBuilderConfig::getMemoryPoolLimit() with
MemoryPoolType::kWORKSPACE.
|
long |
getMemoryPoolLimit(int pool) |
long |
getMemoryPoolLimit(nvinfer.MemoryPoolType pool)
\brief Get the memory size limit of the memory pool.
|
int |
getMinTimingIterations()
Deprecated.
Deprecated in TensorRT 8.4. Superseded by getAvgTimingIterations().
|
int |
getNbOptimizationProfiles()
\brief Get number of optimization profiles.
|
int |
getNbPluginsToSerialize()
\brief Get the number of plugin library paths to be serialized with version-compatible engines.
|
String |
getPluginToSerialize(int index)
\brief Get the plugin library path to be serialized with version-compatible engines.
|
IBuilderConfig |
getPointer(long i) |
boolean |
getPreviewFeature(int feature) |
boolean |
getPreviewFeature(nvinfer.PreviewFeature feature)
\brief Get status of preview feature
|
org.bytedeco.cuda.cudart.CUstream_st |
getProfileStream()
\brief Get the cuda stream that is used to profile this network.
|
nvinfer.ProfilingVerbosity |
getProfilingVerbosity()
\brief Get verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
|
boolean |
getQuantizationFlag(int flag) |
boolean |
getQuantizationFlag(nvinfer.QuantizationFlag flag)
\brief Returns true if the quantization flag is set.
|
int |
getQuantizationFlags()
\brief Get the quantization flags.
|
int |
getTacticSources()
\brief Get tactic sources.
|
ITimingCache |
getTimingCache()
\brief Get the pointer to the timing cache from current IBuilderConfig
|
boolean |
isDeviceTypeSet(ILayer layer)
\brief whether the DeviceType has been explicitly set for this layer
|
IBuilderConfig |
position(long position) |
void |
reset()
\brief Resets the builder configuration to defaults.
|
void |
resetDeviceType(ILayer layer)
\brief reset the DeviceType for this layer
|
void |
setAlgorithmSelector(IAlgorithmSelector selector)
\brief Set Algorithm Selector.
|
void |
setAvgTimingIterations(int avgTiming)
\brief Set the number of averaging iterations used when timing layers.
|
void |
setBuilderOptimizationLevel(int level)
\brief Set builder optimization level
Set the builder optimization level.
|
boolean |
setCalibrationProfile(IOptimizationProfile profile)
\brief Add a calibration profile.
|
void |
setDefaultDeviceType(int deviceType) |
void |
setDefaultDeviceType(nvinfer.DeviceType deviceType)
\brief Sets the default DeviceType to be used by the builder.
|
void |
setDeviceType(ILayer layer,
int deviceType) |
void |
setDeviceType(ILayer layer,
nvinfer.DeviceType deviceType)
\brief Set the device that this layer must execute on.
|
void |
setDLACore(int dlaCore)
\brief Sets the DLA core used by the network.
|
void |
setEngineCapability(int capability) |
void |
setEngineCapability(nvinfer.EngineCapability capability)
\brief Configure the builder to target specified EngineCapability flow.
|
void |
setFlag(int builderFlag) |
void |
setFlag(nvinfer.BuilderFlag builderFlag)
\brief Set a single build mode flag.
|
void |
setFlags(int builderFlags)
\brief Set the build mode flags to turn on builder options for this network.
|
void |
setHardwareCompatibilityLevel(int hardwareCompatibilityLevel) |
void |
setHardwareCompatibilityLevel(nvinfer.HardwareCompatibilityLevel hardwareCompatibilityLevel)
\brief Set the hardware compatibility level.
|
void |
setInt8Calibrator(IInt8Calibrator calibrator)
\brief Set Int8 Calibration interface.
|
void |
setMaxAuxStreams(int nbStreams)
\brief Set the maximum number of auxiliary streams that TRT is allowed to use.
|
void |
setMaxWorkspaceSize(long workspaceSize)
Deprecated.
Deprecated in TensorRT 8.3. Superseded by IBuilderConfig::setMemoryPoolLimit() with
MemoryPoolType::kWORKSPACE.
|
void |
setMemoryPoolLimit(int pool,
long poolSize) |
void |
setMemoryPoolLimit(nvinfer.MemoryPoolType pool,
long poolSize)
\brief Set the memory size for the memory pool.
|
void |
setMinTimingIterations(int minTiming)
Deprecated.
Deprecated in TensorRT 8.4. Superseded by setAvgTimingIterations().
|
void |
setPluginsToSerialize(byte[] paths,
int nbPaths) |
void |
setPluginsToSerialize(ByteBuffer paths,
int nbPaths) |
void |
setPluginsToSerialize(BytePointer paths,
int nbPaths) |
void |
setPluginsToSerialize(PointerPointer paths,
int nbPaths)
\brief Set the plugin libraries to be serialized with version-compatible engines.
|
void |
setPreviewFeature(int feature,
boolean enable) |
void |
setPreviewFeature(nvinfer.PreviewFeature feature,
boolean enable)
\brief Enable or disable a specific preview feature
Allows enabling or disabling experimental features, which are not enabled by default in the
current release.
|
void |
setProfileStream(org.bytedeco.cuda.cudart.CUstream_st stream)
\brief Set the cuda stream that is used to profile this network.
|
void |
setProfilingVerbosity(int verbosity) |
void |
setProfilingVerbosity(nvinfer.ProfilingVerbosity verbosity)
\brief Set verbosity level of layer information exposed in NVTX annotations and IEngineInspector.
|
void |
setQuantizationFlag(int flag) |
void |
setQuantizationFlag(nvinfer.QuantizationFlag flag)
\brief Set a single quantization flag.
|
void |
setQuantizationFlags(int flags)
\brief Set the quantization flags.
|
boolean |
setTacticSources(int tacticSources)
\brief Set tactic sources.
|
boolean |
setTimingCache(ITimingCache cache,
boolean ignoreMismatch)
\brief Attach a timing cache to IBuilderConfig
The timing cache has verification header to make sure the provided cache can be used in current environment.
|
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 IBuilderConfig()
public IBuilderConfig(long size)
Pointer.position(long)
.public IBuilderConfig(Pointer p)
Pointer(Pointer)
.public IBuilderConfig position(long position)
public IBuilderConfig getPointer(long i)
getPointer
in class Pointer
@Deprecated @NoException(value=true) public void setMinTimingIterations(int minTiming)
getMinTimingIterations()
@Deprecated @NoException(value=true) public int getMinTimingIterations()
setMinTimingIterations()
@NoException(value=true) public void setAvgTimingIterations(int avgTiming)
getAvgTimingIterations()
@NoException(value=true) public int getAvgTimingIterations()
setAvgTimingIterations()
@NoException(value=true) public void setEngineCapability(nvinfer.EngineCapability capability)
@NoException(value=true) public void setEngineCapability(@Cast(value="nvinfer1::EngineCapability") int capability)
@NoException(value=true) public nvinfer.EngineCapability getEngineCapability()
setEngineCapability()
@NoException(value=true) public void setInt8Calibrator(IInt8Calibrator calibrator)
@NoException(value=true) public IInt8Calibrator getInt8Calibrator()
@Deprecated @NoException(value=true) public void setMaxWorkspaceSize(@Cast(value="std::size_t") long workspaceSize)
workspaceSize
- The maximum GPU temporary memory which the engine can use at execution time.getMaxWorkspaceSize()
@Cast(value="std::size_t") @Deprecated @NoException(value=true) public long getMaxWorkspaceSize()
setMaxWorkspaceSize()
@NoException(value=true) public void setFlags(@Cast(value="nvinfer1::BuilderFlags") int builderFlags)
builderFlags
- The build option for an engine.
\note This function will override the previous set flags, rather than bitwise ORing the new flag.getFlags()
@Cast(value="nvinfer1::BuilderFlags") @NoException(value=true) public int getFlags()
setFlags()
@NoException(value=true) public void clearFlag(nvinfer.BuilderFlag builderFlag)
setFlags()
@NoException(value=true) public void clearFlag(@Cast(value="nvinfer1::BuilderFlag") int builderFlag)
@NoException(value=true) public void setFlag(nvinfer.BuilderFlag builderFlag)
setFlags()
@NoException(value=true) public void setFlag(@Cast(value="nvinfer1::BuilderFlag") int builderFlag)
@Cast(value="bool") @NoException(value=true) public boolean getFlag(nvinfer.BuilderFlag builderFlag)
getFlags()
@Cast(value="bool") @NoException(value=true) public boolean getFlag(@Cast(value="nvinfer1::BuilderFlag") int builderFlag)
@NoException(value=true) public void setDeviceType(@Const ILayer layer, nvinfer.DeviceType deviceType)
layer
- which layer to execute.deviceType
- that this layer must execute on.
If DeviceType is not set or is reset, TensorRT will use the default DeviceType set in the builder.
\note The device type for a layer must be compatible with the safety flow (if specified).
For example a layer cannot be marked for DLA execution while the builder is configured for kSAFE_GPU.getDeviceType()
@NoException(value=true) public void setDeviceType(@Const ILayer layer, @Cast(value="nvinfer1::DeviceType") int deviceType)
@NoException(value=true) public nvinfer.DeviceType getDeviceType(@Const ILayer layer)
@Cast(value="bool") @NoException(value=true) public boolean isDeviceTypeSet(@Const ILayer layer)
getDeviceType() resetDeviceType()
@NoException(value=true) public void resetDeviceType(@Const ILayer layer)
getDeviceType() isDeviceTypeSet()
@Cast(value="bool") @NoException(value=true) public boolean canRunOnDLA(@Const ILayer layer)
@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 void setDefaultDeviceType(nvinfer.DeviceType deviceType)
getDefaultDeviceType()
@NoException(value=true) public void setDefaultDeviceType(@Cast(value="nvinfer1::DeviceType") int deviceType)
@NoException(value=true) public nvinfer.DeviceType getDefaultDeviceType()
@NoException(value=true) public void reset()
@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 setProfileStream(org.bytedeco.cuda.cudart.CUstream_st stream)
stream
- The cuda stream used for profiling by the builder.getProfileStream()
@NoException(value=true) public org.bytedeco.cuda.cudart.CUstream_st getProfileStream()
setProfileStream()
@NoException(value=true) public int addOptimizationProfile(@Const IOptimizationProfile profile)
profile
- The new optimization profile, which must satisfy profile->isValid() == true@NoException(value=true) public int getNbOptimizationProfiles()
@NoException(value=true) public void setProfilingVerbosity(nvinfer.ProfilingVerbosity verbosity)
ProfilingVerbosity, getProfilingVerbosity(), IEngineInspector
@NoException(value=true) public void setProfilingVerbosity(@Cast(value="nvinfer1::ProfilingVerbosity") int verbosity)
@NoException(value=true) public nvinfer.ProfilingVerbosity getProfilingVerbosity()
ProfilingVerbosity, setProfilingVerbosity(), IEngineInspector
@NoException(value=true) public void setAlgorithmSelector(IAlgorithmSelector selector)
selector
- The algorithm selector to be set in the build config.@NoException(value=true) public IAlgorithmSelector getAlgorithmSelector()
@Cast(value="bool") @NoException(value=true) public boolean setCalibrationProfile(@Const IOptimizationProfile profile)
profile
- The new calibration profile, which must satisfy profile->isValid() == true or be nullptr.
MIN and MAX values will be overwritten by kOPT.@Const @NoException(value=true) public IOptimizationProfile getCalibrationProfile()
@NoException(value=true) public void setQuantizationFlags(@Cast(value="nvinfer1::QuantizationFlags") int flags)
flags
- The quantization flags.
\note This function will override the previous set flags, rather than bitwise ORing the new flag.getQuantizationFlags()
@Cast(value="nvinfer1::QuantizationFlags") @NoException(value=true) public int getQuantizationFlags()
setQuantizationFlag()
@NoException(value=true) public void clearQuantizationFlag(nvinfer.QuantizationFlag flag)
setQuantizationFlags()
@NoException(value=true) public void clearQuantizationFlag(@Cast(value="nvinfer1::QuantizationFlag") int flag)
@NoException(value=true) public void setQuantizationFlag(nvinfer.QuantizationFlag flag)
setQuantizationFlags()
@NoException(value=true) public void setQuantizationFlag(@Cast(value="nvinfer1::QuantizationFlag") int flag)
@Cast(value="bool") @NoException(value=true) public boolean getQuantizationFlag(nvinfer.QuantizationFlag flag)
getQuantizationFlags()
@Cast(value="bool") @NoException(value=true) public boolean getQuantizationFlag(@Cast(value="nvinfer1::QuantizationFlag") int flag)
@Cast(value="bool") @NoException(value=true) public boolean setTacticSources(@Cast(value="nvinfer1::TacticSources") int tacticSources)
getTacticSources
@Cast(value="nvinfer1::TacticSources") @NoException(value=true) public int getTacticSources()
setTacticSources()
@NoException(value=true) public ITimingCache createTimingCache(@Const Pointer blob, @Cast(value="std::size_t") long size)
blob
- A pointer to the raw data that contains serialized timing cachesize
- The size in bytes of the serialized timing cache. Size 0 means create a new cache from scratchsetTimingCache
@Cast(value="bool") @NoException(value=true) public boolean setTimingCache(@Const @ByRef ITimingCache cache, @Cast(value="bool") boolean ignoreMismatch)
cache
- the timing cache to be usedignoreMismatch
- whether or not allow using a cache that contains different CUDA device property@Const @NoException(value=true) public ITimingCache getTimingCache()
@NoException(value=true) public void setMemoryPoolLimit(nvinfer.MemoryPoolType pool, @Cast(value="std::size_t") long poolSize)
pool
- The memory pool to limit the available memory for.poolSize
- The size of the pool in bytes.getMemoryPoolLimit, MemoryPoolType
@NoException(value=true) public void setMemoryPoolLimit(@Cast(value="nvinfer1::MemoryPoolType") int pool, @Cast(value="std::size_t") long poolSize)
@Cast(value="std::size_t") @NoException(value=true) public long getMemoryPoolLimit(nvinfer.MemoryPoolType pool)
pool
- The memory pool to get the limit for.setMemoryPoolLimit
@Cast(value="std::size_t") @NoException(value=true) public long getMemoryPoolLimit(@Cast(value="nvinfer1::MemoryPoolType") int pool)
@NoException(value=true) public void setPreviewFeature(nvinfer.PreviewFeature feature, @Cast(value="bool") boolean enable)
feature
- the feature to enable / disableenable
- true for enable, false for disablePreviewFeature, getPreviewFeature
@NoException(value=true) public void setPreviewFeature(@Cast(value="nvinfer1::PreviewFeature") int feature, @Cast(value="bool") boolean enable)
@Cast(value="bool") @NoException(value=true) public boolean getPreviewFeature(nvinfer.PreviewFeature feature)
feature
- the feature to queryPreviewFeature, setPreviewFeature
@Cast(value="bool") @NoException(value=true) public boolean getPreviewFeature(@Cast(value="nvinfer1::PreviewFeature") int feature)
@NoException(value=true) public void setBuilderOptimizationLevel(int level)
level
- The optimization level to set to. Must be non-negative.getBuilderOptimizationLevel
@NoException(value=true) public int getBuilderOptimizationLevel()
setBuilderOptimizationLevel
@NoException(value=true) public void setHardwareCompatibilityLevel(nvinfer.HardwareCompatibilityLevel hardwareCompatibilityLevel)
hardwareCompatibilityLevel
- The level of hardware
compatibility.@NoException(value=true) public void setHardwareCompatibilityLevel(@Cast(value="nvinfer1::HardwareCompatibilityLevel") int hardwareCompatibilityLevel)
@NoException(value=true) public nvinfer.HardwareCompatibilityLevel getHardwareCompatibilityLevel()
setHardwareCompatiblityLevel()
@NoException(value=true) public void setPluginsToSerialize(@Cast(value="const char*const*") PointerPointer paths, int nbPaths)
paths
- The paths of plugin libraries.nbPaths
- The number of paths.@NoException(value=true) public void setPluginsToSerialize(@Cast(value="const char*const*") @ByPtrPtr BytePointer paths, int nbPaths)
@NoException(value=true) public void setPluginsToSerialize(@Cast(value="const char*const*") @ByPtrPtr ByteBuffer paths, int nbPaths)
@NoException(value=true) public void setPluginsToSerialize(@Cast(value="const char*const*") @ByPtrPtr byte[] paths, int nbPaths)
@NoException(value=true) public String getPluginToSerialize(int index)
index
- Index of the plugin library path in the list. Should be in the range [0,
getNbPluginsToSerialize())
.@NoException(value=true) public int getNbPluginsToSerialize()
@NoException(value=true) public void setMaxAuxStreams(int nbStreams)
nbStreams
- The maximum number of auxiliary streams that TRT is allowed to use.getMaxAuxStreams(), ICudaEngine::getNbAuxStreams(), IExecutionContext::setAuxStreams()
@NoException(value=true) public int getMaxAuxStreams()
setMaxAuxStreams()
Copyright © 2024. All rights reserved.