Disable AVX512 instructions for LLVM Flang before version 17 or with LLVM Flang on Windows.

This commit is contained in:
Markus Mützel 2023-08-05 16:43:25 +02:00
parent f047ca3111
commit 6a05bef025
1 changed files with 13 additions and 0 deletions

View File

@ -104,6 +104,19 @@ if(NOT NOFORTRAN)
endif()
endif()
if (NOT NOFORTRAN AND CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 17 OR WIN32)
# The *blas3 tests fail on hardware with AVX512 instruction when using
# LLVM Flang before version 17 or when using LLVM Flang on Windows.
# Tested with LLVM Flang 16 and LLVM Flang 17 on Windows (MSYS2/CLANG64).
# FIXME: Revisit with LLVM Flang 18.
if (NOT NO_AVX512)
message(STATUS "Disabling AVX512 instructions for LLVM Flang before version 17 or on Windows.")
endif()
set(NO_AVX512 1)
endif()
endif()
include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
include("${PROJECT_SOURCE_DIR}/cmake/system.cmake")