Skip to content

Commit

Permalink
Fix AVX2 support detection. (#4969)
Browse files Browse the repository at this point in the history
[SC-47213](https://app.shortcut.com/tiledb-inc/story/47213)

A typo in #4449 prevented AVX2 from being detected in GCC. This PR fixes
the typo and adds logging to allow validating whether AVX2 was detected.

Fixes #4967.

---
TYPE: BUILD
DESC: Fix AVX2 support detection.
  • Loading branch information
teo-tsirpanis authored May 13, 2024
1 parent 748b80b commit 9d8fcb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmake/Modules/CheckAVX2Support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function (CheckAVX2Support)
endif()

cmake_push_check_state()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${COMPILER_AVX2_FLAG}")
check_cxx_source_runs("
#include <immintrin.h>
int main() {
Expand All @@ -64,4 +64,9 @@ function (CheckAVX2Support)
COMPILER_SUPPORTS_AVX2
)
cmake_pop_check_state()
if (COMPILER_SUPPORTS_AVX2)
message(STATUS "AVX2 support detected.")
else()
message(STATUS "AVX2 support not detected.")
endif()
endfunction()

0 comments on commit 9d8fcb1

Please sign in to comment.