pub enum Device {
Cpu,
Cuda(usize),
}Expand description
実行先デバイス(docs/public-api-design.md §4.1 のシグネチャをそのまま
実装)。
Metal variant は cfg(target_os = "macos") 限定とし、feature フラグは
設けない(PoC-v2-5 実証構成。.claude/rules/coding-rust.md)。Cuda
variant は cudarc が無条件依存+動的ロード方式であるため、全 OS で
variant 自体は存在する(実行時に CUDA ドライバ不在なら
BackendError::CudaUnavailable を返す。実装は backend-cuda 側)。
Variants§
Cpu
CPU バックエンド(backend-cpu)。常に利用可能。
Cuda(usize)
CUDA バックエンド(backend-cuda)。usize は cudarc の
デバイス ordinal(CudaContext::new(ordinal) に対応)。
Trait Implementations§
impl Copy for Device
impl Eq for Device
impl StructuralPartialEq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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