1use strum_macros::{Display, EnumIter, EnumString, IntoStaticStr};
2
3#[derive(Debug, Copy, Clone, Eq, PartialEq, IntoStaticStr, EnumString, EnumIter, Display)]
4#[strum(serialize_all = "snake_case")]
5pub enum Accelerator {
7 #[cfg(any(feature = "cuda", docsrs))]
8 #[cfg_attr(docsrs, doc(cfg(feature = "cuda")))]
9 Cuda,
13 #[cfg(any(feature = "rocm", docsrs))]
14 #[cfg_attr(docsrs, doc(cfg(feature = "rocm")))]
15 Rocm,
19 #[cfg(any(feature = "vulkan", docsrs))]
20 #[cfg_attr(docsrs, doc(cfg(feature = "vulkan")))]
21 Vulkan,
27 #[cfg(any(feature = "metal", docsrs))]
28 #[cfg_attr(docsrs, doc(cfg(feature = "metal")))]
29 Metal,
33 #[cfg(any(feature = "cpu", docsrs))]
34 #[cfg_attr(docsrs, doc(cfg(feature = "cpu")))]
35 Cpu,
37}
38
39pub fn get_default_accelerators() -> Vec<Accelerator> {
41 use strum::IntoEnumIterator;
42
43 let mut accelerator = Vec::new();
44 for enabled in Accelerator::iter() {
45 accelerator.push(enabled);
46 }
47
48 accelerator
49}