pub struct MpsGraphTensor {
pub buffer: *mut c_void,
pub shape: Shape,
pub dtype: DType,
pub device: MpsGraphDevice,
}Expand description
GPU-resident tensor backed by an MTLBuffer.
On Apple Silicon the buffer uses shared memory so both CPU and GPU can access the same physical pages — no PCIe copy.
Fields§
§buffer: *mut c_voidRetained MTLBuffer pointer.
shape: Shape§dtype: DType§device: MpsGraphDeviceImplementations§
Source§impl MpsGraphTensor
impl MpsGraphTensor
pub fn num_elements(&self) -> usize
Trait Implementations§
Source§impl Clone for MpsGraphTensor
impl Clone for MpsGraphTensor
Source§impl Debug for MpsGraphTensor
impl Debug for MpsGraphTensor
Source§impl Drop for MpsGraphTensor
impl Drop for MpsGraphTensor
Source§impl TensorMetadata for MpsGraphTensor
impl TensorMetadata for MpsGraphTensor
impl Send for MpsGraphTensor
impl Sync for MpsGraphTensor
Auto Trait Implementations§
impl Freeze for MpsGraphTensor
impl RefUnwindSafe for MpsGraphTensor
impl Unpin for MpsGraphTensor
impl UnsafeUnpin for MpsGraphTensor
impl UnwindSafe for MpsGraphTensor
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