pub struct DeviceIoBinding {
pub dtype: DataType,
/* private fields */
}Expand description
An externally owned persistent device allocation bound to a graph input and optionally aliased by a graph output.
Fields§
§dtype: DataTypeImplementations§
Source§impl DeviceIoBinding
impl DeviceIoBinding
pub fn input_name(&self) -> &str
pub fn output_name(&self) -> Option<&str>
pub fn physical_shape(&self) -> &[usize]
pub fn logical_shape(&self) -> &[usize]
Sourcepub fn has_dynamic_logical_input_shape(&self) -> bool
pub fn has_dynamic_logical_input_shape(&self) -> bool
Whether kernels see a logical prefix whose shape can differ from capacity.
Sourcepub fn exposes_logical_input_shape(&self) -> bool
pub fn exposes_logical_input_shape(&self) -> bool
Whether this input binding is configured to expose its logical prefix
(valid length) to kernels rather than the padded physical capacity. Unlike
Self::has_dynamic_logical_input_shape, this is a static property of
the binding (fixed at allocation from the consumer-scoped capacity policy)
and does not depend on the current logical shape. Callers that freeze a
growing input to physical capacity for CUDA-graph eligibility must consult
this: a binding that exposes its logical prefix cannot be frozen, because
at least one consumer requires the valid length rather than the padded
capacity (e.g. GLM-5.2’s indexer arithmetic branch).
pub fn set_logical_shape( &mut self, shape: Vec<usize>, ) -> Result<(), SessionError>
pub fn device_ptr(&self) -> *const c_void
pub fn transfer_stats(&self) -> DeviceBindingTransferStats
pub fn write_bytes( &mut self, byte_offset: usize, bytes: &[u8], ) -> Result<(), SessionError>
pub fn read_bytes(&mut self) -> Result<Vec<u8>, SessionError>
pub fn read_bytes_into(&mut self, bytes: &mut [u8]) -> Result<(), SessionError>
pub fn device_argmax_supported(&self) -> bool
pub fn device_argmax( &self, elements: usize, result: &mut DeviceIoBinding, ) -> Result<(), SessionError>
Trait Implementations§
Source§impl Debug for DeviceIoBinding
impl Debug for DeviceIoBinding
Source§impl Drop for DeviceIoBinding
impl Drop for DeviceIoBinding
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceIoBinding
impl !UnwindSafe for DeviceIoBinding
impl Freeze for DeviceIoBinding
impl Send for DeviceIoBinding
impl Sync for DeviceIoBinding
impl Unpin for DeviceIoBinding
impl UnsafeUnpin for DeviceIoBinding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more