Skip to main content

nam_rs/math/common/dispatch/
instruction_set.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 Fábio Henrique de Lima Silva (fhl.bsb@gmail.com) All rights reserved.
3
4/// Enumerates the supported instruction sets.
5///
6/// Note: There is no scalar `Fallback` variant in this enum. The project targets
7/// x86-64-v3 (AVX2+FMA) as mandatory. If AVX2 is not detected,
8/// `detect_best_simd()` panics at boot (fail-fast).
9#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd)]
10pub enum InstructionSet {
11    /// AVX2 + FMA (x86-64-v3).
12    Avx2,
13    /// AVX-512 Foundation (Skylake-X+, Zen 4+).
14    Avx512,
15    /// AVX-512 VNNI + BF16.
16    Avx512VnniBf16,
17}