pub struct MetalDevice { /* private fields */ }Expand description
The GPU, its command queue and the compiled kernels.
Implementations§
Source§impl MetalDevice
impl MetalDevice
Sourcepub fn new() -> Result<Self, GpuError>
pub fn new() -> Result<Self, GpuError>
The default GPU with the kernels compiled. Fails where there is no GPU (virtual machines, some CI runners).
Sourcepub fn max_buffer_length(&self) -> usize
pub fn max_buffer_length(&self) -> usize
Largest buffer the device can allocate, in bytes.
Sourcepub fn upload(
&self,
h: &SparseMatrix,
precision: Precision,
) -> Result<MetalOperator<'_>, GpuError>
pub fn upload( &self, h: &SparseMatrix, precision: Precision, ) -> Result<MetalOperator<'_>, GpuError>
Uploads a rescaled Hamiltonian H̃ (spectrum in (−1, 1)).
Source§impl MetalDevice
impl MetalDevice
Auto Trait Implementations§
impl !RefUnwindSafe for MetalDevice
impl !UnwindSafe for MetalDevice
impl Freeze for MetalDevice
impl Send for MetalDevice
impl Sync for MetalDevice
impl Unpin for MetalDevice
impl UnsafeUnpin for MetalDevice
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<T, U> Imply<T> for U
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>
Converts
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>
Converts
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