Skip to main content

IRuntimeConfig

Struct IRuntimeConfig 

Source
pub struct IRuntimeConfig { /* private fields */ }
Expand description

IRuntimeConfig

A class for runtime configuration. This class is used during execution context creation.

See IRuntime, IBuilderConfig

Implementations§

Source§

impl IRuntimeConfig

Source

pub fn setExecutionContextAllocationStrategy( self: Pin<&mut IRuntimeConfig>, strategy: ExecutionContextAllocationStrategy, )

Set the execution context allocation strategy. Default value is kSTATIC.

  • strategy The execution context allocation strategy.
Source

pub fn getExecutionContextAllocationStrategy( self: &IRuntimeConfig, ) -> ExecutionContextAllocationStrategy

Get the execution context allocation strategy.

The execution context allocation strategy.

Source

pub fn createRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache

Create an empty Runtime cache.

A fresh IRuntimeCache object.

Source

pub fn setRuntimeCache( self: Pin<&mut IRuntimeConfig>, cache: &IRuntimeCache, ) -> bool

Set Runtime cache to the runtime config. Enables Runtime caching.

  • cache The Runtime cache to set.
Source

pub fn getRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache

Get the Runtime cache from the runtime config.

The Runtime cache.

Source

pub fn setDynamicShapesKernelSpecializationStrategy( self: Pin<&mut IRuntimeConfig>, dynamicShapesKernelSpecializationStrategy: DynamicShapesKernelSpecializationStrategy, )

Set the dynamic shape kernel specialization strategy for this config.

  • dynamicShapesKernelSpecializationStrategy The dynamic shape specialization strategy.
Source

pub fn getDynamicShapesKernelSpecializationStrategy( self: &IRuntimeConfig, ) -> DynamicShapesKernelSpecializationStrategy

Return the dynamic shape specialization strategy of this config.

dynamicShapesKernelSpecializationStrategy The dynamic shape specialization strategy.

Source

pub fn setCudaGraphStrategy( self: Pin<&mut IRuntimeConfig>, strategy: CudaGraphStrategy, ) -> bool

Set the strategy used for CUDA graphs for JIT (Just-In-Time) inference. Default is kDISABLED.

Even if the strategy was set to kWHOLE_GRAPH_CAPTURE, RTX CUDA graphs may be disabled internally during runtime under following circumstances:

  • The given stream does not allow graph capture.
  • The allocation strategy is blocking.
  • Some layers in the engine use data-dependent dynamic shapes or on-device control flow.
  • The engine is streaming weights. If CUDA graph is not supported for above or any other reason, it will silently ignore the set strategy and run inference without CUDA graphs.

If the stream is being captured elsewhere, RTX CUDA graphs will be disabled.

  • strategy The CUDA graph strategy.

True if the strategy was within range and set successfully, false otherwise.

Source

pub fn getCudaGraphStrategy(self: &IRuntimeConfig) -> CudaGraphStrategy

Return the strategy used for CUDA graphs for JIT (Just-In-Time) inference.

The CUDA graph strategy.

Trait Implementations§

Source§

impl Drop for IRuntimeConfig

Source§

fn drop(self: &mut IRuntimeConfig)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl ExternType for IRuntimeConfig

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, R, u, n, t, i, m, e, C, o, n, f, i, g)

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

type Kind = Opaque

Source§

impl MakeCppStorage for IRuntimeConfig

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IRuntimeConfig

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 IRuntimeConfig)

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

impl SharedPtrTarget for IRuntimeConfig

Source§

impl UniquePtrTarget for IRuntimeConfig

Source§

impl WeakPtrTarget for IRuntimeConfig

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.