add isa check

This commit is contained in:
Nitload
2026-01-04 07:56:37 +08:00
parent 53085d35d2
commit e1d2a8707d
13 changed files with 123 additions and 533 deletions
+35 -1
View File
@@ -1,4 +1,4 @@
#ifndef SSC_INTRIN
#ifndef SSC_INTRIN
#define SSC_INTRIN
#define SSC_INTRIN_HEAD
@@ -328,4 +328,38 @@ typedef enum most_advanced_instruction {
#endif
} most_advanced_instruction;
#include "sn_target.h"
#if SN_IS_ARCH(SN_ARCH_X86_64)
typedef enum intrinsic_level {
// No SIMD support, will cause error if used in matrix operations
SIMD0 = 0,
// SSE4.2 support
SIMD1 = 1,
// AVX2 support
SIMD2 = 2,
// AVX2 and AVX2-FMA support
SIMD3 = 3,
// AVX2-16C support based on SIMD3
SIMD4 = 4,
// AVX-512-dual support
SIMD5 = 5,
// AVX-512-native support
SIMD6 = 6,
// AVX-512 with 8/16-wide support
SIMD7 = 7,
// AMX support
SIMD8 = 8,
// AVX-10 support
SIMD9 = 9,
// future use
SIMD_MAX = 10
} intrinsic_level;
#else
typedef enum intrinsic_level {
} intrinsic_level;
#endif
#endif