pub struct TrtEngine { /* private fields */ }Expand description
Owned, immutable TensorRT engine.
Built either from a serialised plan via [TrtRuntime::deserialize]
or from a fresh build via crate::builder::IBuilderConfig +
TrtActor::Build.
Implementations§
Source§impl TrtEngine
impl TrtEngine
Sourcepub unsafe fn from_raw(
raw: *mut ICudaEngine,
num_io: usize,
) -> Result<Self, TrtError>
pub unsafe fn from_raw( raw: *mut ICudaEngine, num_io: usize, ) -> Result<Self, TrtError>
Construct a wrapper from a raw pointer obtained from the FFI
shim. Returns Err if the pointer is null.
§Safety
Caller must ensure raw was returned by a TensorRT runtime /
builder shim and has not been destroyed.
pub fn raw(&self) -> *mut ICudaEngine
pub fn num_io_tensors(&self) -> usize
Sourcepub fn io_tensor_name(&self, _idx: usize) -> Option<String>
pub fn io_tensor_name(&self, _idx: usize) -> Option<String>
Phase 4.5++ — name of the I/O tensor at index idx. Returns
None if idx >= num_io_tensors() or if the upstream FFI
shim returns a null/invalid string.
Without tensorrt-link this always returns None — there’s no
linked libnvinfer to query.
Wrap the engine in an Arc<TrtEngine> so multiple
ExecutionContexts can share it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrtEngine
impl RefUnwindSafe for TrtEngine
impl Unpin for TrtEngine
impl UnsafeUnpin for TrtEngine
impl UnwindSafe for TrtEngine
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