pub struct DeviceManager { /* private fields */ }Expand description
GPU device manager GPUデバイスマネージャー
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub fn available_devices(&self) -> Vec<DeviceType>
pub fn available_devices(&self) -> Vec<DeviceType>
Get available devices 利用可能なデバイスを取得
Sourcepub fn set_device(&mut self, device: DeviceType) -> RusTorchResult<()>
pub fn set_device(&mut self, device: DeviceType) -> RusTorchResult<()>
Set current device 現在のデバイスを設定
Sourcepub fn current_device(&self) -> DeviceType
pub fn current_device(&self) -> DeviceType
Get current device 現在のデバイスを取得
Sourcepub fn current_context(&self) -> &GpuContext
pub fn current_context(&self) -> &GpuContext
Get current context 現在のコンテキストを取得
Sourcepub fn is_cuda_available() -> bool
pub fn is_cuda_available() -> bool
Check if CUDA is available CUDAが利用可能かチェック
Sourcepub fn is_metal_available() -> bool
pub fn is_metal_available() -> bool
Check if Metal is available Metalが利用可能かチェック
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceManager
impl RefUnwindSafe for DeviceManager
impl Send for DeviceManager
impl Sync for DeviceManager
impl Unpin for DeviceManager
impl UnwindSafe for DeviceManager
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<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