@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IBuilder extends INoCopy
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter| Constructor and Description |
|---|
IBuilder(Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ICudaEngine |
buildEngineWithConfig(INetworkDefinition network,
IBuilderConfig config)
\brief Builds a network for the given INetworkDefinition and IBuilderConfig.
|
IHostMemory |
buildSerializedNetwork(INetworkDefinition network,
IBuilderConfig config)
\brief Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
|
IHostMemory |
buildSerializedNetwork(INetworkDefinition network,
IBuilderConfig config,
IHostMemory kernelText)
\brief Extended form of buildSerializedNetwork that optionally permits getting the kernelText.
|
boolean |
buildSerializedNetworkToStream(INetworkDefinition network,
IBuilderConfig config,
IStreamWriter writer)
\brief Builds and serializes a network into stream for the given INetworkDefinition and IBuilderConfig.
|
IBuilderConfig |
createBuilderConfig()
\brief Create a builder configuration object.
|
INetworkDefinition |
createNetworkV2(int flags)
\brief Create a network definition object
Creates a network definition object with immutable properties specified using the flags parameter.
|
IOptimizationProfile |
createOptimizationProfile()
\brief Create a new optimization profile.
|
IErrorRecorder |
getErrorRecorder()
\brief get the ErrorRecorder assigned to this interface.
|
ILogger |
getLogger()
\brief get the logger with which the builder was created
|
int |
getMaxDLABatchSize()
\brief Get the maximum batch size DLA can support.
|
int |
getMaxThreads()
\brief get the maximum number of threads that can be used by the builder.
|
int |
getNbDLACores()
\brief Return the number of DLA engines available to this builder.
|
IPluginRegistry |
getPluginRegistry()
\brief get the local plugin registry that can be used by the builder.
|
boolean |
isNetworkSupported(INetworkDefinition network,
IBuilderConfig config)
\brief Checks that a network is within the scope of the IBuilderConfig settings.
|
void |
reset()
\brief Resets the builder state to default values.
|
void |
setErrorRecorder(IErrorRecorder recorder)
\brief Set the ErrorRecorder for this interface
Assigns the ErrorRecorder to this interface.
|
void |
setGpuAllocator(IGpuAllocator allocator)
\brief Set the GPU allocator.
|
boolean |
setMaxThreads(int maxThreads)
\brief Set the maximum number of threads.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, trimMemory, withDeallocator, zeropublic IBuilder(Pointer p)
Pointer(Pointer).@NoException(value=true) public int getMaxDLABatchSize()
@NoException(value=true) public int getNbDLACores()
@NoException(value=true) public void setGpuAllocator(IGpuAllocator allocator)
allocator - Set the GPU allocator to be used by the builder. All GPU memory acquired will use this
allocator. If NULL is passed, the default allocator will be used.
Default: allocateAsync uses cudaMallocAsync if cudaDevAttrMemoryPoolsSupported returns true, otherwise falls
back to cudaMalloc. allocate always uses cudaMalloc.
\note This allocator will be passed to any engines created via the builder; thus the lifetime of the allocator
must span the lifetime of those engines as
well as that of the builder. If nullptr is passed, the default allocator will be used.@NoException(value=true) public IBuilderConfig createBuilderConfig()
IBuilderConfig@NoException(value=true) public INetworkDefinition createNetworkV2(@Cast(value="nvinfer1::NetworkDefinitionCreationFlags") int flags)
flags - Bitset of NetworkDefinitionCreationFlags specifying network properties combined with bitwise OR,
e.g., 1U << NetworkDefinitionCreationFlag::kPREFER_JIT_PYTHON_PLUGINS.INetworkDefinition, NetworkDefinitionCreationFlags@NoException(value=true) public IOptimizationProfile createOptimizationProfile()
IOptimizationProfile@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
recorder - The error recorder to register with this interface.getErrorRecorder()@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()@NoException(value=true) public void reset()
@NoException(value=true) public IHostMemory buildSerializedNetwork(@ByRef INetworkDefinition network, @ByRef IBuilderConfig config)
network - Network definition.config - Builder configuration.INetworkDefinition, IBuilderConfig, IHostMemory@Cast(value="bool") @NoException(value=true) public boolean buildSerializedNetworkToStream(@ByRef INetworkDefinition network, @ByRef IBuilderConfig config, @ByRef IStreamWriter writer)
network - Network definition.config - Builder configuration.writer - Output writer stream.INetworkDefinition, IBuilderConfig, IStreamWriter@NoException(value=true) public IHostMemory buildSerializedNetwork(@ByRef INetworkDefinition network, @ByRef IBuilderConfig config, @ByPtrRef IHostMemory kernelText)
network - Network definition.config - Builder configuration.kernelText - A reference to a pointer to a IHostMemory object that will be set to the kernel CPP code textINetworkDefinition, IBuilderConfig, IHostMemory@NoException(value=true) public ICudaEngine buildEngineWithConfig(@ByRef INetworkDefinition network, @ByRef IBuilderConfig config)
network - Network definition.config - Builder configuration.INetworkDefinition, IBuilderConfig, ICudaEngine@Cast(value="bool") @NoException(value=true) public boolean isNetworkSupported(@Const @ByRef INetworkDefinition network, @Const @ByRef IBuilderConfig config)
network - The network definition to check for configuration compliance.config - The configuration of the builder to use when checking \p network.
Given an INetworkDefinition, \p network, and an IBuilderConfig, \p config, check if
the network falls within the constraints of the builder configuration based on the
EngineCapability, BuilderFlag, and DeviceType. If the network is within the constraints,
then the function returns true, and false if a violation occurs. This function reports
the conditions that are violated to the registered ErrorRecorder.true return value does not guarantee that engine building will succeed, as backends may reject it for
reasons not detectable with this fast validation. To definitively check whether a network can be built with a
given config, use \p buildEngineWithConfig or \p buildSerializedNetwork (depending on the engine capability).
\note This function will synchronize the CUDA stream returned by \p config.getProfileStream() before returning.@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 builder.@NoException(value=true) public int getMaxThreads()
setMaxThreads()@ByRef @NoException(value=true) public IPluginRegistry getPluginRegistry()
Copyright © 2026. All rights reserved.