Skip to main content

IBuilderConfig

Struct IBuilderConfig 

Source
pub struct IBuilderConfig {
    pub precision: Precision,
    pub device_type: DeviceType,
    pub structured_sparsity: bool,
    pub tactic_sources: TacticSources,
    pub timing_cache: Option<Vec<u8>>,
    pub refit: RefitPolicy,
    pub workspace_bytes: usize,
    pub dla_sram_bytes: usize,
    pub extra_flags: BuilderFlags,
}
Expand description

Pure-Rust mirror of nvinfer1::IBuilderConfig. Holds the requested knobs in a side table; the FFI shim under tensorrt-link replays them against the C++ object inside BuilderActor::build.

Fields§

§precision: Precision§device_type: DeviceType§structured_sparsity: bool

Enable structured 2:4 sparsity (Ampere+).

§tactic_sources: TacticSources

Tactic-source allow-list (default: all on).

§timing_cache: Option<Vec<u8>>

Persist the per-build timing cache. None = no cache.

§refit: RefitPolicy

Engine refit policy.

§workspace_bytes: usize

Workspace memory pool budget (bytes).

§dla_sram_bytes: usize

DLA SRAM pool budget (bytes), only honoured when device_type == Dla(_).

§extra_flags: BuilderFlags

Extra builder flags merged in on top of precision.flags() — allows callers to toggle e.g. DEBUG_KERNELS without losing the high-level precision policy.

Implementations§

Source§

impl IBuilderConfig

Source

pub fn new() -> Self

Source

pub fn with_precision(self, p: Precision) -> Self

Source

pub fn with_device(self, dt: DeviceType) -> Self

Source

pub fn with_sparsity(self, on: bool) -> Self

Source

pub fn with_tactic_sources(self, ts: TacticSources) -> Self

Source

pub fn with_timing_cache(self, cache: Vec<u8>) -> Self

Source

pub fn with_refit(self, refit: RefitPolicy) -> Self

Source

pub fn with_workspace_bytes(self, bytes: usize) -> Self

Source

pub fn with_extra_flags(self, flags: BuilderFlags) -> Self

Source

pub fn effective_flags(&self) -> BuilderFlags

Compute the final BuilderFlags bitmask the FFI shim would pass to IBuilderConfig::setFlag(). Combines the precision policy with refit + sparsity + caller-supplied extras.

Trait Implementations§

Source§

impl Clone for IBuilderConfig

Source§

fn clone(&self) -> IBuilderConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IBuilderConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IBuilderConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.