pub struct IBuilder { /* private fields */ }Expand description
! ! \class IBuilder ! ! \brief Builds an engine from a network definition. ! ! \warning Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI. !
Implementations§
Source§impl IBuilder
impl IBuilder
Sourcepub fn getMaxDLABatchSize(self: &IBuilder) -> i32
pub fn getMaxDLABatchSize(self: &IBuilder) -> i32
! ! \brief 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. ! ! \warning getMaxDLABatchSize does not work with dynamic shapes. !
Sourcepub fn getNbDLACores(self: &IBuilder) -> i32
pub fn getNbDLACores(self: &IBuilder) -> i32
! ! \brief Return the number of DLA engines available to this builder. !
Sourcepub fn createBuilderConfig(self: Pin<&mut IBuilder>) -> *mut IBuilderConfig
pub fn createBuilderConfig(self: Pin<&mut IBuilder>) -> *mut IBuilderConfig
! ! \brief Create a builder configuration object. ! ! The caller owns the new IBuilderConfig, which must be destroyed with operator delete ! before this IBuilder is destroyed. Destroying this IBuilder before destroying the ! IBuilderConfig causes undefined behavior. ! ! \see IBuilderConfig !
Sourcepub fn createNetworkV2(
self: Pin<&mut IBuilder>,
flags: u32,
) -> *mut INetworkDefinition
pub fn createNetworkV2( self: Pin<&mut IBuilder>, flags: u32, ) -> *mut INetworkDefinition
! ! \brief 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. ! ! The caller owns the new INetworkDefinition, which must be destroyed with operator delete ! before this IBuilder is destroyed. Destroying this IBuilder before destroying the ! INetworkDefinition causes undefined behavior. ! ! \param flags Bitset of NetworkDefinitionCreationFlags specifying network properties combined with bitwise OR, ! e.g., 1U << NetworkDefinitionCreationFlag::kSTRONGLY_TYPED. ! ! \see INetworkDefinition, NetworkDefinitionCreationFlags !
Sourcepub fn createOptimizationProfile(
self: Pin<&mut IBuilder>,
) -> *mut IOptimizationProfile
pub fn createOptimizationProfile( self: Pin<&mut IBuilder>, ) -> *mut IOptimizationProfile
! ! \brief 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. ! ! \see IOptimizationProfile !
Sourcepub fn reset(self: Pin<&mut IBuilder>)
pub fn reset(self: Pin<&mut IBuilder>)
! ! \brief Resets the builder state to default values. !
Sourcepub fn buildSerializedNetwork(
self: Pin<&mut IBuilder>,
network: Pin<&mut INetworkDefinition>,
config: Pin<&mut IBuilderConfig>,
) -> *mut IHostMemory
pub fn buildSerializedNetwork( self: Pin<&mut IBuilder>, network: Pin<&mut INetworkDefinition>, config: Pin<&mut IBuilderConfig>, ) -> *mut IHostMemory
! ! \brief Builds and serializes a network for the given INetworkDefinition and IBuilderConfig. ! ! This function allows building and serialization of a network without creating an engine. ! ! \param network Network definition. ! \param config Builder configuration. ! ! \return A pointer to a IHostMemory object that contains a serialized network. ! ! \note This function will synchronize the CUDA stream returned by \p config.getProfileStream() before returning. ! ! \see INetworkDefinition, IBuilderConfig, IHostMemory !
Sourcepub fn isNetworkSupported(
self: &IBuilder,
network: &INetworkDefinition,
config: &IBuilderConfig,
) -> bool
pub fn isNetworkSupported( self: &IBuilder, network: &INetworkDefinition, config: &IBuilderConfig, ) -> bool
! ! \brief Checks that a network is within the scope of the IBuilderConfig settings. ! ! \param network The network definition to check for configuration compliance. ! \param 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. ! ! \return True if network is within the scope of the restrictions specified by the builder config, ! false otherwise. ! ! \note This function will synchronize the CUDA stream returned by \p config.getProfileStream() before returning. !
Sourcepub fn getLogger(self: &IBuilder) -> *mut ILogger
pub fn getLogger(self: &IBuilder) -> *mut ILogger
! ! \brief get the logger with which the builder was created ! ! \return the logger !
Sourcepub fn setMaxThreads(self: Pin<&mut IBuilder>, maxThreads: i32) -> bool
pub fn setMaxThreads(self: Pin<&mut IBuilder>, maxThreads: i32) -> bool
! ! \brief Set the maximum number of threads. ! ! \param maxThreads The maximum number of threads that can be used by the builder. ! ! \return True if successful, false otherwise. ! ! 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. !
Sourcepub fn getMaxThreads(self: &IBuilder) -> i32
pub fn getMaxThreads(self: &IBuilder) -> i32
! ! \brief 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. ! ! \return The maximum number of threads that can be used by the builder. ! ! \see setMaxThreads() !
Sourcepub fn getPluginRegistry<'a>(
self: Pin<&'a mut IBuilder>,
) -> Pin<&'a mut IPluginRegistry>
pub fn getPluginRegistry<'a>( self: Pin<&'a mut IBuilder>, ) -> Pin<&'a mut IPluginRegistry>
! ! \brief get the local plugin registry that can be used by the builder. ! ! \return The local plugin registry that can be used by the builder. !