1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Execution-mode markers for SIMD operations.
//!
//! Two ZST markers define whether a [`crate::view::SimdView`] operates on all lanes (dense)
//! or a hardware-predicated subset (masked). The sealed `ExecutionMode` trait prevents
//! external implementations and enables the compiler to eliminate dead mode branches
//! via DCE during monomorphization.
//!
//! # Design
//! - `Unmasked` — default; maps to unconditional arithmetic. Zero overhead vs. not
//! parameterizing by mode at all.
//! - `Masked` — activates predicated methods on `SimdView`. Maps to AVX-512 mask registers
//! (`__mmask16`/`__mmask8`), AVX2 blend masks (`__m256`), SVE predicates, or scalar
//! `[bool; N]` arrays depending on the bound `SimdKernel` implementation.
/// Private module that seals `ExecutionMode`.
/// Marker trait for SIMD execution modes.
///
/// Sealed to prevent external implementations. Only `Unmasked` and `Masked` satisfy this.
/// Dense execution — all lanes are active. Default mode for [`crate::view::SimdView`].
///
/// Monomorphization eliminates all masking overhead entirely; the compiler sees no
/// conditional paths through the `ExecutionMode` bound.
;
/// Predicated execution — a hardware mask selects active lanes.
///
/// Enables the `dot_masked`, `sum_masked`, and `elementwise_add_masked` methods on
/// `SimdView`. Each method accepts an architecture-native `Arch::Mask` operand.
;