1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub trait Device { type Container<T>; } pub struct Local; impl Device for Local { type Container<T> = T; } pub struct Cuda; impl Device for Cuda { type Container<T> = *const std::ffi::c_void; }