Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6d281c31
Commit
6d281c31
authored
Sep 29, 2015
by
Davis King
Browse files
merged
parents
de365031
99a91ce6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
dlib/cmake
dlib/cmake
+6
-0
setup.py
setup.py
+5
-1
tools/python/CMakeLists.txt
tools/python/CMakeLists.txt
+1
-0
No files found.
dlib/cmake
View file @
6d281c31
...
@@ -32,10 +32,13 @@ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
...
@@ -32,10 +32,13 @@ if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
option(USE_AVX_INSTRUCTIONS "Compile your program with AVX instructions" OFF)
if(USE_AVX_INSTRUCTIONS)
if(USE_AVX_INSTRUCTIONS)
add_definitions(-mavx)
add_definitions(-mavx)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS)
elseif (USE_SSE4_INSTRUCTIONS)
add_definitions(-msse4)
add_definitions(-msse4)
message(STATUS "Enabling SSE4 instructions")
elseif(USE_SSE2_INSTRUCTIONS)
elseif(USE_SSE2_INSTRUCTIONS)
add_definitions(-msse2)
add_definitions(-msse2)
message(STATUS "Enabling SSE2 instructions")
endif()
endif()
elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visual Studio
# Use SSE2 by default when using Visual Studio.
# Use SSE2 by default when using Visual Studio.
...
@@ -52,12 +55,14 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
...
@@ -52,12 +55,14 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
check_type_size( "void*" SIZE_OF_VOID_PTR)
check_type_size( "void*" SIZE_OF_VOID_PTR)
if(USE_AVX_INSTRUCTIONS)
if(USE_AVX_INSTRUCTIONS)
add_definitions(/arch:AVX)
add_definitions(/arch:AVX)
message(STATUS "Enabling AVX instructions")
elseif (USE_SSE4_INSTRUCTIONS)
elseif (USE_SSE4_INSTRUCTIONS)
# Visual studio doesn't have an /arch:SSE2 flag when building in 64 bit modes.
# Visual studio doesn't have an /arch:SSE2 flag when building in 64 bit modes.
# So only give it when we are doing a 32 bit build.
# So only give it when we are doing a 32 bit build.
if (SIZE_OF_VOID_PTR EQUAL 4)
if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2)
add_definitions(/arch:SSE2)
endif()
endif()
message(STATUS "Enabling SSE4 instructions")
add_definitions(-DDLIB_HAVE_SSE2)
add_definitions(-DDLIB_HAVE_SSE2)
add_definitions(-DDLIB_HAVE_SSE3)
add_definitions(-DDLIB_HAVE_SSE3)
add_definitions(-DDLIB_HAVE_SSE41)
add_definitions(-DDLIB_HAVE_SSE41)
...
@@ -67,6 +72,7 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
...
@@ -67,6 +72,7 @@ elseif (MSVC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # else if using Visu
if (SIZE_OF_VOID_PTR EQUAL 4)
if (SIZE_OF_VOID_PTR EQUAL 4)
add_definitions(/arch:SSE2)
add_definitions(/arch:SSE2)
endif()
endif()
message(STATUS "Enabling SSE2 instructions")
add_definitions(-DDLIB_HAVE_SSE2)
add_definitions(-DDLIB_HAVE_SSE2)
endif()
endif()
endif()
endif()
...
...
setup.py
View file @
6d281c31
...
@@ -256,7 +256,6 @@ _ON_POSIX = 'posix' in sys.builtin_module_names
...
@@ -256,7 +256,6 @@ _ON_POSIX = 'posix' in sys.builtin_module_names
def
enqueue_output
(
out
,
queue
):
def
enqueue_output
(
out
,
queue
):
for
line
in
iter
(
out
.
readline
,
b
''
):
for
line
in
iter
(
out
.
readline
,
b
''
):
queue
.
put
(
line
)
queue
.
put
(
line
)
out
.
close
()
def
_log_buf
(
buf
):
def
_log_buf
(
buf
):
...
@@ -298,6 +297,11 @@ def run_process(cmds, timeout=None):
...
@@ -298,6 +297,11 @@ def run_process(cmds, timeout=None):
elapsed
=
time
.
time
()
-
_time
elapsed
=
time
.
time
()
-
_time
if
timeout
and
elapsed
>
timeout
:
if
timeout
and
elapsed
>
timeout
:
break
break
# Make sure we print all the output from the process.
if
p
.
stdout
:
for
line
in
p
.
stdout
:
_log_buf
(
line
)
p
.
wait
()
except
(
KeyboardInterrupt
,
SystemExit
)
as
e
:
except
(
KeyboardInterrupt
,
SystemExit
)
as
e
:
# if user interrupted
# if user interrupted
pass
pass
...
...
tools/python/CMakeLists.txt
View file @
6d281c31
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8.4
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8.4
)
set
(
USE_SSE4_INSTRUCTIONS ON CACHE BOOL
"Use SSE4 instructions"
)
include
(
../../dlib/add_python_module
)
include
(
../../dlib/add_python_module
)
# Tell cmake to compile all these cpp files into a dlib python module.
# Tell cmake to compile all these cpp files into a dlib python module.
...
...
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