pub struct ExecutionContext<'e> { /* private fields */ }Implementations§
Source§impl ExecutionContext<'_>
impl ExecutionContext<'_>
pub fn as_raw(&self) -> trtIExecutionContext_t
pub fn set_input_shape(&self, name: &str, dims: Dims) -> Result<()>
Sourcepub unsafe fn set_tensor_address(
&self,
name: &str,
addr: *mut c_void,
) -> Result<()>
pub unsafe fn set_tensor_address( &self, name: &str, addr: *mut c_void, ) -> Result<()>
Bind a device pointer to a named input/output tensor on this
execution context. The pointer is forwarded to TensorRT’s
setTensorAddress, which uses it during enqueueV3 execution.
§Safety
addr must point to device memory that:
- is large enough for the tensor’s bound shape and data type, and
- remains valid (not freed, not unmapped) for the duration of any
enqueueV3call that runs after this binding and before the stream completes.
pub fn tensor_shape(&self, name: &str) -> Result<Dims>
Sourcepub fn tensor_address(&self, name: &str) -> Result<*mut c_void>
pub fn tensor_address(&self, name: &str) -> Result<*mut c_void>
Read the current bound device address for a tensor (null if unset).
Sourcepub unsafe fn enqueue_v3(&self, stream: cudaStream_t) -> Result<()>
pub unsafe fn enqueue_v3(&self, stream: cudaStream_t) -> Result<()>
Enqueue the inference on the given CUDA stream. Returns Ok if TRT reports success; the stream is still responsible for ordering, and the caller must ensure all tensor addresses have been set.
§Safety
stream must be a valid cudaStream_t that outlives the enqueue.
Trait Implementations§
Source§impl<'e> Debug for ExecutionContext<'e>
impl<'e> Debug for ExecutionContext<'e>
Source§impl Drop for ExecutionContext<'_>
impl Drop for ExecutionContext<'_>
Auto Trait Implementations§
impl<'e> Freeze for ExecutionContext<'e>
impl<'e> RefUnwindSafe for ExecutionContext<'e>
impl<'e> !Send for ExecutionContext<'e>
impl<'e> !Sync for ExecutionContext<'e>
impl<'e> Unpin for ExecutionContext<'e>
impl<'e> UnsafeUnpin for ExecutionContext<'e>
impl<'e> UnwindSafe for ExecutionContext<'e>
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