Skip to content

Commit

Permalink
Fix AVX2+ detection on Mac (#895)
Browse files Browse the repository at this point in the history
MacOS is weird and its CPU flags are separated in two separate fields returned by the sysctl interface. To get around this, we need to test both of them, so here goes

Co-authored-by: Roman Grundkiewicz <rgrundkiewicz@gmail.com>
  • Loading branch information
XapaJIaMnu and snukky committed Dec 7, 2021
1 parent cd9afea commit e8a1a25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Integrate a shortlist converter (which can convert a text lexical shortlist to a binary shortlist) into marian-conv with --shortlist option

### Fixed
- Fix AVX2 and AVX512 detection on MacOS
- Add GCC11 support into FBGEMM
- Added pragma to ignore unused-private-field error on elementType_ on macOS
- Do not set guided alignments for case augmented data if vocab is not factored
Expand Down
3 changes: 1 addition & 2 deletions cmake/FindSSE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDIF (AVX512_TRUE)

ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE
CPUINFO)
EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO)

STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE)
Expand Down

0 comments on commit e8a1a25

Please sign in to comment.