pub struct CubeRuntime { /* private fields */ }Expand description
CubeCL runtime wrapper that holds a real compute client for one device.
Implementations§
Source§impl CubeRuntime
impl CubeRuntime
Sourcepub fn new(device: CubeDevice) -> FerrotorchResult<Self>
pub fn new(device: CubeDevice) -> FerrotorchResult<Self>
Create a runtime targeting the given device.
Returns Err(FerrotorchError::DeviceUnavailable) if the required
backend feature was not compiled in.
Sourcepub fn device(&self) -> &CubeDevice
pub fn device(&self) -> &CubeDevice
The device this runtime targets.
Sourcepub fn client(&self) -> &CubeClient
pub fn client(&self) -> &CubeClient
The underlying compute client (one variant per backend).
Sourcepub fn auto() -> Option<Self>
pub fn auto() -> Option<Self>
Auto-detect the best available backend, returning None if no GPU
backend feature is enabled.
Priority order: CUDA > ROCm > WGPU.
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Returns true if any GPU backend feature was compiled in.
Trait Implementations§
Source§impl Clone for CubeRuntime
impl Clone for CubeRuntime
Source§fn clone(&self) -> CubeRuntime
fn clone(&self) -> CubeRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CubeRuntime
impl RefUnwindSafe for CubeRuntime
impl Send for CubeRuntime
impl Sync for CubeRuntime
impl Unpin for CubeRuntime
impl UnsafeUnpin for CubeRuntime
impl UnwindSafe for CubeRuntime
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
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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