Skip to main content

TrtActor

Struct TrtActor 

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

TrtActor — owns nothing across messages besides the FFI runtime/builder handles, all engines/contexts ride the messages.

The actor itself is intentionally minimal: most of the heavy state lives in Arc<TrtEngine> values that the caller threads through. This mirrors DeviceActor’s design where per-context state lives in the ContextActor but engines live with the caller.

Implementations§

Source§

impl TrtActor

Source

pub fn new() -> Self

Source

pub fn ensure_runtime(&self) -> Result<(), TrtError>

Get-or-create the cached runtime. Without tensorrt-link the inner constructor returns NotLinked.

Source

pub fn execute( &self, engine: &Arc<TrtEngine>, bindings: &[(String, u64)], input_shapes: &[(String, Vec<i32>)], _stream: &Arc<CudaStream>, ) -> Result<(), TrtError>

Phase 4.5++ — synchronous helper that drives the TrtMsg::Execute semantics (creates an IExecutionContext, binds tensor addresses, calls enqueueV3).

Without tensorrt-link this returns TrtError::NotLinked without ever touching libnvinfer. With the feature on, the actor performs the full FFI sequence under the supplied Arc<CudaStream>. The function returns once the launch has been submitted — real GPU completion is observed downstream (the typical caller pairs this with an atomr-accel-cuda completion strategy on the same stream).

Source

pub fn build_from_onnx( &self, _onnx_bytes: &[u8], _config: &IBuilderConfig, ) -> Result<EnginePlan, TrtError>

Phase 4.5++ — synchronous helper that drives the TrtMsg::BuildFromOnnx semantics. Parses an ONNX model and returns a serialised plan blob ready for TrtRuntime::deserialize. Gated on tensorrt-onnx (transitively tensorrt-link).

Trait Implementations§

Source§

impl Default for TrtActor

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