vector_ta/utilities/
enums.rs1#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2pub enum Kernel {
3 Auto,
4 Scalar,
5 Avx2,
6 Avx512,
7 ScalarBatch,
8 Avx2Batch,
9 Avx512Batch,
10}
11
12impl Default for Kernel {
13 fn default() -> Self {
14 Kernel::Auto
15 }
16}
17
18impl Kernel {
19 #[inline(always)]
20 pub const fn is_batch(self) -> bool {
21 matches!(
22 self,
23 Kernel::ScalarBatch | Kernel::Avx2Batch | Kernel::Avx512Batch
24 )
25 }
26
27 #[inline(always)]
28 pub const fn to_non_batch(self) -> Kernel {
29 match self {
30 Kernel::ScalarBatch => Kernel::Scalar,
31 Kernel::Avx2Batch => Kernel::Avx2,
32 Kernel::Avx512Batch => Kernel::Avx512,
33 other => other,
34 }
35 }
36}