The cupid library returns whether the CPU avx flag is enabled or not. This only denotes whether the CPU supports AVX, but not wether an user-space program can use it.
For that to happen the OS must also support saving and restoring the SSE and AVX registers on a context-switch. A short explanation of how to detect this is given here.
I don't know if the current behavior is intended or unintended (it seems to be doing the naive thing only), but I just wanted to point it out because the run-time feature detection in the stdsimd crate answers the question "can the feature be used here?" which in some cases (avx, avx2, avx512) might lead to different answers than the cupid crate.
The
cupid
library returns whether the CPUavx
flag is enabled or not. This only denotes whether the CPU supports AVX, but not wether an user-space program can use it.For that to happen the OS must also support saving and restoring the SSE and AVX registers on a context-switch. A short explanation of how to detect this is given here.
I don't know if the current behavior is intended or unintended (it seems to be doing the naive thing only), but I just wanted to point it out because the run-time feature detection in the
stdsimd
crate answers the question "can the feature be used here?" which in some cases (avx, avx2, avx512) might lead to different answers than the cupid crate.