Skip to main content

Engine

Struct Engine 

Source
pub struct Engine<'rt> { /* private fields */ }
Expand description

Represents a deserialized TensorRT engine borrowed from its parent runtime.

Implementations§

Source§

impl Engine<'_>

Source

pub fn as_raw(&self) -> trtICudaEngine_t

Source

pub fn num_io_tensors(&self) -> Result<i32>

Source

pub fn io_tensor_name(&self, index: i32) -> Result<String>

Source

pub fn tensor_io_mode(&self, name: &str) -> Result<IoMode>

Source

pub fn tensor_data_type(&self, name: &str) -> Result<DataType>

Source

pub fn tensor_shape(&self, name: &str) -> Result<Dims>

Source

pub fn create_execution_context(&self) -> Result<ExecutionContext<'_>>

Source

pub fn create_execution_context_with_strategy( &self, strategy: AllocStrategy, ) -> Result<ExecutionContext<'_>>

Create an execution context with a user-chosen allocation strategy. Use AllocStrategy::UserManaged when you intend to supply a scratch-allocator yourself; AllocStrategy::Static preallocates the maximum workspace at context-creation time.

Source

pub fn name(&self) -> Result<String>

Engine name as set in the TensorRT builder.

Source

pub fn num_optimization_profiles(&self) -> Result<i32>

Number of optimization profiles that were baked into the engine.

Source

pub fn serialize(&self) -> Result<HostMemory>

Serialize this engine back into a byte blob you can round-trip to disk. The returned HostMemory owns TensorRT-allocated storage; use HostMemory::as_slice to copy.

Trait Implementations§

Source§

impl<'rt> Debug for Engine<'rt>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Engine<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'rt> Freeze for Engine<'rt>

§

impl<'rt> RefUnwindSafe for Engine<'rt>

§

impl<'rt> !Send for Engine<'rt>

§

impl<'rt> !Sync for Engine<'rt>

§

impl<'rt> Unpin for Engine<'rt>

§

impl<'rt> UnsafeUnpin for Engine<'rt>

§

impl<'rt> UnwindSafe for Engine<'rt>

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.