Skip to content

Commit

Permalink
disabling AVX routines under Visual Studio
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Mar 1, 2024
1 parent 81c5e04 commit 12f838b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/isadetection.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
#include <stdlib.h>

// Binaries produced by Visual Studio with solely AVX2 routines
// can compile to AVX-512 thus causing crashes on non-AVX-512 systems.
// This appears to affect VS 17.8 and 17.9. We disable AVX-512 and AVX2
// on these systems. It seems that ClangCL is not affected.
#ifndef __clang__
#if _MSC_VER >= 1938
#define ROARING_DISABLE_AVX 1
#endif // _MSC_VER >= 1938
#endif // __clang__

// We need portability.h to be included first, see
// https://github.com/RoaringBitmap/CRoaring/issues/394
#include <roaring/portability.h>
Expand Down

0 comments on commit 12f838b

Please sign in to comment.