Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
5f7b1849
Commit
5f7b1849
authored
Jan 02, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the cmake option for using SSE4 work with visual studio.
parent
d4cd8779
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
cmake
dlib/cmake
+7
-2
No files found.
dlib/cmake
View file @
5f7b1849
...
@@ -12,9 +12,9 @@ if (NOT TARGET dlib)
...
@@ -12,9 +12,9 @@ if (NOT TARGET dlib)
add_definitions("-Wreturn-type")
add_definitions("-Wreturn-type")
endif()
endif()
# Setup some options to allow a user to enable SSE and AVX instruction use.
option(USE_SSE4_INSTRUCTIONS "Compile your program with SSE4 instructions" OFF)
option(USE_SSE4_INSTRUCTIONS "Compile your program with SSE4 instructions" OFF)
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" OFF)
option(USE_SSE2_INSTRUCTIONS "Compile your program with SSE2 instructions" OFF)
if(USE_AVX_INSTRUCTIONS)
if(USE_AVX_INSTRUCTIONS)
...
@@ -30,7 +30,12 @@ if (NOT TARGET dlib)
...
@@ -30,7 +30,12 @@ if (NOT TARGET dlib)
if(USE_AVX_INSTRUCTIONS)
if(USE_AVX_INSTRUCTIONS)
add_definitions(/arch:AVX)
add_definitions(/arch:AVX)
elseif (USE_SSE4_INSTRUCTIONS)
elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(/arch:SSE2) # There isn't an /arch:SSE4 flag in visual studio.
# There isn't an /arch:SSE4 flag in visual studio. But we can tell
# dlib to use those instructions anyway with the DLIB_HAVE_SSE3 and
# DLIB_HAVE_SSE41 #defines.
add_definitions(/arch:SSE2)
add_definitions(-DDLIB_HAVE_SSE3)
add_definitions(-DDLIB_HAVE_SSE41)
elseif(USE_SSE2_INSTRUCTIONS)
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(/arch:SSE2)
add_definitions(/arch:SSE2)
endif()
endif()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment