TensorRT 10.5.0
|
Builds an engine from a network definition. More...
#include <NvInfer.h>
Public Member Functions | |
virtual | ~IBuilder () noexcept=default |
TRT_DEPRECATED bool | platformHasFastFp16 () const noexcept |
Determine whether the platform has fast native fp16. More... | |
TRT_DEPRECATED bool | platformHasFastInt8 () const noexcept |
Determine whether the platform has fast native int8. More... | |
int32_t | getMaxDLABatchSize () const noexcept |
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combined(dimensions other than CHW) with the requested batch size should not exceed the value returned by this function. More... | |
int32_t | getNbDLACores () const noexcept |
Return the number of DLA engines available to this builder. More... | |
void | setGpuAllocator (IGpuAllocator *allocator) noexcept |
Set the GPU allocator. More... | |
nvinfer1::IBuilderConfig * | createBuilderConfig () noexcept |
Create a builder configuration object. More... | |
nvinfer1::INetworkDefinition * | createNetworkV2 (NetworkDefinitionCreationFlags flags) noexcept |
Create a network definition object. More... | |
nvinfer1::IOptimizationProfile * | createOptimizationProfile () noexcept |
Create a new optimization profile. 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... | |
void | reset () noexcept |
Resets the builder state to default values. More... | |
TRT_DEPRECATED bool | platformHasTf32 () const noexcept |
Determine whether the platform has TF32 support. More... | |
nvinfer1::IHostMemory * | buildSerializedNetwork (INetworkDefinition &network, IBuilderConfig &config) noexcept |
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig. More... | |
bool | isNetworkSupported (INetworkDefinition const &network, IBuilderConfig const &config) const noexcept |
Checks that a network is within the scope of the IBuilderConfig settings. More... | |
ILogger * | getLogger () const noexcept |
get the logger with which the builder 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 builder. More... | |
IPluginRegistry & | getPluginRegistry () noexcept |
get the local plugin registry that can be used by the builder. More... | |
Protected Attributes | |
apiv::VBuilder * | 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 |
Builds an engine from a network definition.
|
virtualdefaultnoexcept |
|
inlinenoexcept |
Builds and serializes a network for the given INetworkDefinition and IBuilderConfig.
This function allows building and serialization of a network without creating an engine.
network | Network definition. |
config | Builder configuration. |
config.getProfileStream()
before returning.
|
inlinenoexcept |
Create a builder configuration object.
|
inlinenoexcept |
Create a network definition object.
Creates a network definition object with immutable properties specified using the flags parameter.
createNetworkV2 supports creating network with properties from NetworkDefinitionCreationFlags.
CreateNetworkV2 supports dynamic shapes and explicit batch dimensions by default.
createNetworkV2 with NetworkDefinitionCreationFlag::kSTRONGLY_TYPED flag supports creating a strongly typed plan where tensor data types are inferred from network input types and operator type specification.
flags | Bitset of NetworkDefinitionCreationFlags specifying network properties combined with bitwise OR. e.g., 1U << NetworkDefinitionCreationFlag::kSTRONGLY_TYPED |
|
inlinenoexcept |
Create a new optimization profile.
If the network has any dynamic input tensors, the appropriate calls to setDimensions() must be made. Likewise, if there are any shape input tensors, the appropriate calls to setShapeValues() are required. The builder retains ownership of the created optimization profile and returns a raw pointer, i.e. the users must not attempt to delete the returned pointer.
|
inlinenoexcept |
get the ErrorRecorder assigned to this interface.
Retrieves the assigned error recorder object for the given class. A nullptr will be returned if setErrorRecorder has not been called.
|
inlinenoexcept |
get the logger with which the builder was created
|
inlinenoexcept |
Get the maximum batch size DLA can support. For any tensor the total volume of index dimensions combined(dimensions other than CHW) with the requested batch size should not exceed the value returned by this function.
|
inlinenoexcept |
get the maximum number of threads that can be used by the builder.
Retrieves the maximum number of threads that can be used by the builder.
|
inlinenoexcept |
Return the number of DLA engines available to this builder.
|
inlinenoexcept |
get the local plugin registry that can be used by the builder.
|
inlinenoexcept |
Checks that a network is within the scope of the IBuilderConfig settings.
network | The network definition to check for configuration compliance. |
config | The configuration of the builder to use when checking network . |
Given an INetworkDefinition, network
, and an IBuilderConfig, 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.
config.getProfileStream()
before returning.
|
inlinenoexcept |
Determine whether the platform has fast native fp16.
|
inlinenoexcept |
Determine whether the platform has fast native int8.
|
inlinenoexcept |
Determine whether the platform has TF32 support.
|
inlinenoexcept |
Resets the builder state to default values.
|
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 builder. All GPU memory acquired will use this allocator. If NULL is passed, the default allocator will be used. |
Default: uses cudaMalloc/cudaFree.
|
inlinenoexcept |
Set the maximum number of threads.
maxThreads | The maximum number of threads that can be used by the builder. |
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.
|
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