@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()
Default native constructor.
|
IBuilder(long size)
Native array allocator.
|
IBuilder(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
ICudaEngine |
buildEngineWithConfig(INetworkDefinition network,
IBuilderConfig config)
Deprecated.
Deprecated in TensorRT 8.0. Superseded by IBuilder::buildSerializedNetwork().
|
IHostMemory |
buildSerializedNetwork(INetworkDefinition network,
IBuilderConfig config)
\brief Builds and serializes a network 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.
|
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. |
IErrorRecorder |
getErrorRecorder()
\brief get the ErrorRecorder assigned to this interface.
|
ILogger |
getLogger()
\brief get the logger with which the builder was created
|
int |
getMaxBatchSize()
Deprecated.
Deprecated in TensorRT 8.4.
|
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.
|
IBuilder |
getPointer(long i) |
boolean |
isNetworkSupported(INetworkDefinition network,
IBuilderConfig config)
\brief Checks that a network is within the scope of the IBuilderConfig settings.
|
boolean |
platformHasFastFp16()
\brief Determine whether the platform has fast native fp16.
|
boolean |
platformHasFastInt8()
\brief Determine whether the platform has fast native int8.
|
boolean |
platformHasTf32()
\brief Determine whether the platform has TF32 support.
|
IBuilder |
position(long position) |
void |
reset()
\brief Resets the builder state to default values.
|
void |
setErrorRecorder(IErrorRecorder recorder) |
void |
setGpuAllocator(IGpuAllocator allocator)
\brief Set the GPU allocator.
|
void |
setMaxBatchSize(int batchSize)
Deprecated.
Deprecated in TensorRT 8.4.
|
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, 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 IBuilder()
public IBuilder(long size)
Pointer.position(long)
.public IBuilder(Pointer p)
Pointer(Pointer)
.public IBuilder getPointer(long i)
getPointer
in class Pointer
@Deprecated @NoException(value=true) public void setMaxBatchSize(int batchSize)
batchSize
- The maximum batch size which can be used at execution time, and also the batch size for which
the engine will be optimized.getMaxBatchSize()
@Deprecated @NoException(value=true) public int getMaxBatchSize()
setMaxBatchSize()
,
getMaxDLABatchSize()
@Cast(value="bool") @NoException(value=true) public boolean platformHasFastFp16()
@Cast(value="bool") @NoException(value=true) public boolean platformHasFastInt8()
@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 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: uses cudaMalloc/cudaFree.
\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
@Deprecated @NoException(value=true) public ICudaEngine buildEngineWithConfig(@ByRef INetworkDefinition network, @ByRef IBuilderConfig config)
@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::kEXPLICIT_BATCHINetworkDefinition, NetworkDefinitionCreationFlags
@NoException(value=true) public IOptimizationProfile createOptimizationProfile()
IOptimizationProfile
@NoException(value=true) public void setErrorRecorder(IErrorRecorder recorder)
/**
@NoException(value=true) public IErrorRecorder getErrorRecorder()
setErrorRecorder()
@NoException(value=true) public void reset()
@Cast(value="bool") @NoException(value=true) public boolean platformHasTf32()
@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 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.@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 © 2024. All rights reserved.