chidiwilliams commited on
Commit
5eb3549
·
unverified ·
1 Parent(s): 6f3392b

Add WHISPER_NO_AVX and WHISPER_NO_AVX2 to CMakeLists (#136)

Browse files

* Check for AVX and AVX2 on Darwin

* Add AVX options to CMakeLists

Files changed (1) hide show
  1. CMakeLists.txt +9 -1
CMakeLists.txt CHANGED
@@ -48,6 +48,8 @@ option(WHISPER_SUPPORT_SDL2 "whisper: support for libSDL2" OFF)
48
 
49
  if (APPLE)
50
  option(WHISPER_NO_ACCELERATE "whisper: disable Accelerate framework" OFF)
 
 
51
  else()
52
  option(WHISPER_SUPPORT_OPENBLAS "whisper: support for OpenBLAS" OFF)
53
  endif()
@@ -151,7 +153,13 @@ else()
151
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -msimd128")
152
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
153
  else()
154
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx -mavx2 -mfma -mf16c")
 
 
 
 
 
 
155
  endif()
156
  endif()
157
  endif()
 
48
 
49
  if (APPLE)
50
  option(WHISPER_NO_ACCELERATE "whisper: disable Accelerate framework" OFF)
51
+ option(WHISPER_NO_AVX "whisper: disable AVX" OFF)
52
+ option(WHISPER_NO_AVX2 "whisper: disable AVX2" OFF)
53
  else()
54
  option(WHISPER_SUPPORT_OPENBLAS "whisper: support for OpenBLAS" OFF)
55
  endif()
 
153
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -msimd128")
154
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
155
  else()
156
+ if(NOT WHISPER_NO_AVX)
157
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx")
158
+ endif()
159
+ if(NOT WHISPER_NO_AVX2)
160
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2")
161
+ endif()
162
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma -mf16c")
163
  endif()
164
  endif()
165
  endif()