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
impl TrtActor
pub fn new() -> Self
Sourcepub fn ensure_runtime(&self) -> Result<(), TrtError>
pub fn ensure_runtime(&self) -> Result<(), TrtError>
Get-or-create the cached runtime. Without tensorrt-link the
inner constructor returns NotLinked.
Sourcepub fn execute(
&self,
engine: &Arc<TrtEngine>,
bindings: &[(String, u64)],
input_shapes: &[(String, Vec<i32>)],
_stream: &Arc<CudaStream>,
) -> Result<(), TrtError>
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).
Sourcepub fn build_from_onnx(
&self,
_onnx_bytes: &[u8],
_config: &IBuilderConfig,
) -> Result<EnginePlan, TrtError>
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).