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
impl IRuntimeConfig
Sourcepub fn setExecutionContextAllocationStrategy(
self: Pin<&mut IRuntimeConfig>,
strategy: ExecutionContextAllocationStrategy,
)
pub fn setExecutionContextAllocationStrategy( self: Pin<&mut IRuntimeConfig>, strategy: ExecutionContextAllocationStrategy, )
Set the execution context allocation strategy. Default value is kSTATIC.
strategyThe execution context allocation strategy.
Sourcepub fn getExecutionContextAllocationStrategy(
self: &IRuntimeConfig,
) -> ExecutionContextAllocationStrategy
pub fn getExecutionContextAllocationStrategy( self: &IRuntimeConfig, ) -> ExecutionContextAllocationStrategy
Get the execution context allocation strategy.
The execution context allocation strategy.
Sourcepub fn createRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache
pub fn createRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache
Create an empty Runtime cache.
A fresh IRuntimeCache object.
Sourcepub fn setRuntimeCache(
self: Pin<&mut IRuntimeConfig>,
cache: &IRuntimeCache,
) -> bool
pub fn setRuntimeCache( self: Pin<&mut IRuntimeConfig>, cache: &IRuntimeCache, ) -> bool
Set Runtime cache to the runtime config. Enables Runtime caching.
cacheThe Runtime cache to set.
Sourcepub fn getRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache
pub fn getRuntimeCache(self: &IRuntimeConfig) -> *mut IRuntimeCache
Get the Runtime cache from the runtime config.
The Runtime cache.
Sourcepub fn setDynamicShapesKernelSpecializationStrategy(
self: Pin<&mut IRuntimeConfig>,
dynamicShapesKernelSpecializationStrategy: DynamicShapesKernelSpecializationStrategy,
)
pub fn setDynamicShapesKernelSpecializationStrategy( self: Pin<&mut IRuntimeConfig>, dynamicShapesKernelSpecializationStrategy: DynamicShapesKernelSpecializationStrategy, )
Set the dynamic shape kernel specialization strategy for this config.
dynamicShapesKernelSpecializationStrategyThe dynamic shape specialization strategy.
Sourcepub fn getDynamicShapesKernelSpecializationStrategy(
self: &IRuntimeConfig,
) -> DynamicShapesKernelSpecializationStrategy
pub fn getDynamicShapesKernelSpecializationStrategy( self: &IRuntimeConfig, ) -> DynamicShapesKernelSpecializationStrategy
Return the dynamic shape specialization strategy of this config.
dynamicShapesKernelSpecializationStrategy The dynamic shape specialization strategy.
Sourcepub fn setCudaGraphStrategy(
self: Pin<&mut IRuntimeConfig>,
strategy: CudaGraphStrategy,
) -> bool
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.
strategyThe CUDA graph strategy.
True if the strategy was within range and set successfully, false otherwise.
Sourcepub fn getCudaGraphStrategy(self: &IRuntimeConfig) -> CudaGraphStrategy
pub fn getCudaGraphStrategy(self: &IRuntimeConfig) -> CudaGraphStrategy
Return the strategy used for CUDA graphs for JIT (Just-In-Time) inference.
The CUDA graph strategy.