Skip to main content

IBuilder

Struct IBuilder 

Source
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

Source

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. !

Source

pub fn getNbDLACores(self: &IBuilder) -> i32

! ! \brief Return the number of DLA engines available to this builder. !

Source

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 !

Source

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 !

Source

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 !

Source

pub fn reset(self: Pin<&mut IBuilder>)

! ! \brief Resets the builder state to default values. !

Source

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 !

Source

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. !

Source

pub fn getLogger(self: &IBuilder) -> *mut ILogger

! ! \brief get the logger with which the builder was created ! ! \return the logger !

Source

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. !

Source

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() !

Source

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. !

Trait Implementations§

Source§

impl Drop for IBuilder

Source§

fn drop(self: &mut IBuilder)

Executes the destructor for this type. Read more
Source§

impl ExternType for IBuilder

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, B, u, i, l, d, e, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for IBuilder

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IBuilder

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut IBuilder)

Frees a C++ allocation which has not yet had a constructor called. Read more
Source§

impl SharedPtrTarget for IBuilder

Source§

impl UniquePtrTarget for IBuilder

Source§

impl WeakPtrTarget for IBuilder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.