Skip to content

Commit 13dcb33

Browse files
committed
Enabled AVX512 support with MSVC. Fixes #206
1 parent 6f1d59e commit 13dcb33

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,6 @@ IF (WIN32)
317317
INCLUDE(gnu)
318318
ELSE()
319319
set(EMBREE_SYCL_SUPPORT OFF)
320-
IF (EMBREE_ISA_AVX512)
321-
MESSAGE(FATAL_ERROR "Microsoft Visual C++ Compiler does not support AVX512. Please use Intel Compiler or Clang.")
322-
ENDIF()
323320
MESSAGE("-- MSVC detected")
324321
INCLUDE (msvc)
325322
ENDIF()
@@ -403,7 +400,7 @@ IF (EMBREE_MAX_ISA STREQUAL "NONE")
403400
OPTION(EMBREE_ISA_SSE42 "Enables SSE4.2 ISA." ON)
404401
OPTION(EMBREE_ISA_AVX "Enables AVX ISA." ${COMPILER_SUPPORTS_AVX})
405402
OPTION(EMBREE_ISA_AVX2 "Enables AVX2 ISA." ${COMPILER_SUPPORTS_AVX2})
406-
IF (WIN32 OR APPLE)
403+
IF (APPLE)
407404
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." OFF)
408405
ELSE()
409406
OPTION(EMBREE_ISA_AVX512 "Enables AVX512 ISA." ${COMPILER_SUPPORTS_AVX512})

common/cmake/msvc.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ SET(FLAGS_SSE2 "/D__SSE__ /D__SSE2__")
55
SET(FLAGS_SSE42 "${FLAGS_SSE2} /D__SSE3__ /D__SSSE3__ /D__SSE4_1__ /D__SSE4_2__")
66
SET(FLAGS_AVX "${FLAGS_SSE42} /arch:AVX")
77
SET(FLAGS_AVX2 "${FLAGS_SSE42} /arch:AVX2")
8+
SET(FLAGS_AVX512 "${FLAGS_AVX2} /arch:AVX512")
89

910
SET(COMMON_CXX_FLAGS "")
1011
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /EHsc") # catch C++ exceptions only and extern "C" functions never throw a C++ exception

0 commit comments

Comments
 (0)