luma_tensor/device/
mod.rs1pub mod cpu;
2#[cfg(feature = "cuda")]
3pub mod cuda;
4
5pub mod bool_ops;
6pub mod float_ops;
7pub mod int_ops;
8
9pub use bool_ops::BoolOps;
10pub use cpu::Cpu;
11pub use float_ops::FloatOps;
12pub use int_ops::IntOps;
13
14use crate::{Bool, Float, Int, dtype::Storage};
15
16pub trait Device: 'static + Clone + Send + Sync + Default + FloatOps<Self> + IntOps<Self> + BoolOps<Self> {
17 type FloatStorage: Storage<Self, Float>;
18 type IntStorage: Storage<Self, Int>;
19 type BoolStorage: Storage<Self, Bool>;
20
21 fn name(&self) -> String;
22
23 fn same_device(&self, _other: &Self) -> bool {
29 true
30 }
31}