Commit 5faf8ccc authored by Davis King's avatar Davis King

Automatically test for NEON instructions when building python extensions and…

Automatically test for NEON instructions when building python extensions and enable them if available.

Forgot about --yes USE_NEON_INSTRUCTIONS when removing --yes a moment
ago.  It's on by default now so now --yes really is unneeded.  The dlib
policy on this kind of thing going forward is to always have a cmake
script that tests if a feature like this is available and to enable it
automatically when building python extensions.
parent b892df82
...@@ -12,11 +12,15 @@ if (COMMAND pybind11_add_module) ...@@ -12,11 +12,15 @@ if (COMMAND pybind11_add_module)
# For python users, enable SSE4 and AVX if they have these instructions. # For python users, enable SSE4 and AVX if they have these instructions.
include(${CMAKE_CURRENT_LIST_DIR}/check_if_sse4_instructions_executable_on_host.cmake) include(${CMAKE_CURRENT_LIST_DIR}/check_if_sse4_instructions_executable_on_host.cmake)
if (SSE4_IS_AVAILABLE_ON_HOST) if (SSE4_IS_AVAILABLE_ON_HOST)
set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Use SSE4 instructions") set(USE_SSE4_INSTRUCTIONS ON CACHE BOOL "Compile your program with SSE4 instructions")
endif() endif()
include(${CMAKE_CURRENT_LIST_DIR}/check_if_avx_instructions_executable_on_host.cmake) include(${CMAKE_CURRENT_LIST_DIR}/check_if_avx_instructions_executable_on_host.cmake)
if (AVX_IS_AVAILABLE_ON_HOST) if (AVX_IS_AVAILABLE_ON_HOST)
set(USE_AVX_INSTRUCTIONS ON CACHE BOOL "Use AVX instructions") set(USE_AVX_INSTRUCTIONS ON CACHE BOOL "Compile your program with AVX instructions")
endif()
include(${CMAKE_CURRENT_LIST_DIR}/check_if_neon_available.cmake)
if (ARM_NEON_IS_AVAILABLE)
set(USE_NEON_INSTRUCTIONS ON CACHE BOOL "Compile your program with ARM-NEON instructions")
endif() endif()
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment