pub struct TensorRtBackend {
pub inference_metrics: InferenceMetrics,
pub precision_policy: PrecisionPolicy,
pub batch_config: BatchConfig,
/* private fields */
}Expand description
Stub TensorRT/CUDA ORT inference backend.
Fields§
§inference_metrics: InferenceMetricsAtomic inference latency and frame count metrics.
precision_policy: PrecisionPolicyPrecision policy used when building the TensorRT EP session.
batch_config: BatchConfigBatch configuration.
Implementations§
Source§impl TensorRtBackend
impl TensorRtBackend
pub fn new( model_path: PathBuf, ctx: Arc<GpuContext>, device_id: i32, ring_size: usize, downstream_capacity: usize, ) -> Self
pub fn with_precision( _model_path: PathBuf, _ctx: Arc<GpuContext>, _device_id: i32, _ring_size: usize, _downstream_capacity: usize, precision_policy: PrecisionPolicy, batch_config: BatchConfig, ) -> Self
pub async fn ring_metrics(&self) -> Option<RingMetricsSnapshot>
pub fn selected_provider(&self) -> Option<&str>
Trait Implementations§
Source§impl UpscaleBackend for TensorRtBackend
impl UpscaleBackend for TensorRtBackend
Source§fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Warm up the backend: load the model, allocate buffers, build engine plans.
Source§fn process<'life0, 'async_trait>(
&'life0 self,
_input: GpuTexture,
) -> Pin<Box<dyn Future<Output = Result<GpuTexture>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn process<'life0, 'async_trait>(
&'life0 self,
_input: GpuTexture,
) -> Pin<Box<dyn Future<Output = Result<GpuTexture>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run a single upscale pass on the given GPU texture, returning the upscaled output.
Source§fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flush any pending work, synchronize streams, and release GPU resources.
Source§fn metadata(&self) -> Result<&ModelMetadata>
fn metadata(&self) -> Result<&ModelMetadata>
Return the model metadata extracted during
initialize.Auto Trait Implementations§
impl !Freeze for TensorRtBackend
impl RefUnwindSafe for TensorRtBackend
impl Send for TensorRtBackend
impl Sync for TensorRtBackend
impl Unpin for TensorRtBackend
impl UnsafeUnpin for TensorRtBackend
impl UnwindSafe for TensorRtBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more