Add build setting for target CPU architecture in C++ compile environment

This commit is contained in:
2023-09-03 17:52:03 +03:00
parent 20a92a994e
commit e8cb1686c3
6 changed files with 107 additions and 2 deletions

View File

@@ -221,6 +221,15 @@ API_ENUM() enum class ArchitectureType
#if defined(__SSE4_2__)
#define PLATFORM_SIMD_SSE4_2 1
#endif
#if defined(__AVX__)
#define PLATFORM_SIMD_AVX 1
#endif
#if defined(__AVX2__)
#define PLATFORM_SIMD_AVX2 1
#endif
#if defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512BW__) && defined(__AVX512DQ__) && defined(__AVX512VL__)
#define PLATFORM_SIMD_AVX512 1
#endif
#endif
#if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON)
#define PLATFORM_SIMD_NEON 1