Check availability of AVX-512, AVX2 etc?

Is there a standard/simple way in Julia to tell whether the CPU running Julia supports features like AVX-512, AVX2 etc?

I want to have a helper function that returns the approapriate length for a SIMD Vector (Vec) to be constructed, which can vary depending on the CPU. If it’s too complicated or not reliable, I will just let the user set an environment variable.

Update: Just discovered simdbits() from CpuId.jl.

1 Like

There’s CpuId.jl, though it hasn’t been updated in a while.

2 Likes