Instruction set macros¶
Each of these macros corresponds to an instruction set supported by XSIMD. They can be used to filter arch-specific code.
-
XSIMD_WITH_SSE2¶
Set to 1 if SSE2 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_SSE3¶
Set to 1 if SSE3 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_SSSE3¶
Set to 1 if SSSE3 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_SSE4_1¶
Set to 1 if SSE4.1 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_SSE4_2¶
Set to 1 if SSE4.2 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX¶
Set to 1 if AVX is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX2¶
Set to 1 if AVX2 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_FMA3_SSE¶
Set to 1 if FMA3 for SSE is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_FMA3_AVX¶
Set to 1 if FMA3 for AVX is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_FMA4¶
Set to 1 if FMA4 is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX512F¶
Set to 1 if AVX512F is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX512CD¶
Set to 1 if AVX512CD is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX512DQ¶
Set to 1 if AVX512DQ is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_AVX512BW¶
Set to 1 if AVX512BW is available at compile-time, to 0 otherwise.
-
XSIMD_WITH_SVE¶
Set to 1 if SVE is available and bit width is pre-set at compile-time, to 0 otherwise.
Changing Default architecture¶
You can change the default instruction set used by xsimd (when none is provided
explicitely) by setting the XSIMD_DEFAULT_ARCH
macro to, say, xsimd::avx2
.
A common usage is to set it to xsimd::unsupported
as a way to detect
instantiation of batches with the default architecture.