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
67710d11
Commit
67710d11
authored
Mar 08, 2016
by
Davis King
Browse files
merged
parents
ad6a56e5
92ca28e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
dlib/CMakeLists.txt
dlib/CMakeLists.txt
+11
-2
dlib/dnn/test_for_cudnn/CMakeLists.txt
dlib/dnn/test_for_cudnn/CMakeLists.txt
+2
-2
dlib/dnn/test_for_cudnn/find_cudnn.txt
dlib/dnn/test_for_cudnn/find_cudnn.txt
+2
-2
No files found.
dlib/CMakeLists.txt
View file @
67710d11
...
...
@@ -462,13 +462,21 @@ if (NOT TARGET dlib)
# make sure cuda is really working by doing a test compile
message
(
STATUS
"Building a CUDA test project to see if your compiler is compatible with CUDA..."
)
try_compile
(
cuda_test_compile_worked
${
PROJECT_BINARY_DIR
}
/cuda_test_build
${
PROJECT_SOURCE_DIR
}
/dnn/test_for_cuda cuda_test
)
${
PROJECT_SOURCE_DIR
}
/dnn/test_for_cuda cuda_test
CMAKE_FLAGS
"-DCMAKE_PREFIX_PATH=
${
CMAKE_PREFIX_PATH
}
"
"-DCMAKE_INCLUDE_PATH=
${
CMAKE_INCLUDE_PATH
}
"
"-DCMAKE_LIBRARY_PATH=
${
CMAKE_LIBRARY_PATH
}
"
)
if
(
NOT cuda_test_compile_worked
)
message
(
STATUS
"*** CUDA was found but your compiler failed to compile a simple CUDA program so dlib isn't going to use CUDA. ***"
)
else
()
message
(
STATUS
"Checking if you have the right version of cuDNN installed."
)
try_compile
(
cudnn_test_compile_worked
${
PROJECT_BINARY_DIR
}
/cudnn_test_build
${
PROJECT_SOURCE_DIR
}
/dnn/test_for_cudnn cudnn_test
)
${
PROJECT_SOURCE_DIR
}
/dnn/test_for_cudnn cudnn_test
CMAKE_FLAGS
"-DCMAKE_PREFIX_PATH=
${
CMAKE_PREFIX_PATH
}
"
"-DCMAKE_INCLUDE_PATH=
${
CMAKE_INCLUDE_PATH
}
"
"-DCMAKE_LIBRARY_PATH=
${
CMAKE_LIBRARY_PATH
}
"
)
if
(
cudnn_test_compile_worked
)
message
(
STATUS
"Found cuDNN: "
${
cudnn
}
)
else
()
...
...
@@ -498,6 +506,7 @@ if (NOT TARGET dlib)
toggle_preprocessor_switch
(
DLIB_USE_CUDA
)
if
(
NOT cudnn OR NOT cudnn_include OR NOT cudnn_test_compile_worked
)
message
(
STATUS
"*** cuDNN V4.0 OR GREATER NOT FOUND. DLIB WILL NOT USE CUDA. ***"
)
message
(
STATUS
"*** If you have cuDNN then set CMAKE_PREFIX_PATH to include cuDNN's folder."
)
endif
()
if
(
NOT COMPILER_CAN_DO_CPP_11
)
message
(
STATUS
"*** Dlib CUDA support requires C++11 but your compiler doesn't support it. ***"
)
...
...
dlib/dnn/test_for_cudnn/CMakeLists.txt
View file @
67710d11
...
...
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.4)
project
(
cudnn_test
)
include
(
../../use_cpp_11.cmake
)
include_directories
(
${
cudnn_include
}
)
find_package
(
CUDA 7.0 REQUIRED
)
set
(
CUDA_HOST_COMPILATION_CPP ON
)
list
(
APPEND CUDA_NVCC_FLAGS
"-arch=sm_30;-std=c++11;-D__STRICT_ANSI__"
)
...
...
@@ -12,4 +10,6 @@ add_definitions(-DDLIB_USE_CUDA)
include
(
find_cudnn.txt
)
include_directories
(
${
cudnn_include
}
)
cuda_add_library
(
cudnn_test STATIC ../cudnn_dlibapi.cpp
${
cudnn
}
)
dlib/dnn/test_for_cudnn/find_cudnn.txt
View file @
67710d11
...
...
@@ -3,12 +3,12 @@ message(STATUS "Looking for cuDNN install...")
# Look for cudnn, we will look in the same place as other CUDA
# libraries and also a few other places as well.
find_path(cudnn_include cudnn.h
HINTS ${CUDA_INCLUDE_DIRS}
HINTS ${CUDA_INCLUDE_DIRS}
$ENV{CUDNN_INCLUDE_DIR}
PATHS /usr/local/include
)
get_filename_component(cudnn_hint_path ${CUDA_CUBLAS_LIBRARIES} PATH)
find_library(cudnn cudnn
HINTS ${cudnn_hint_path}
HINTS ${cudnn_hint_path}
$ENV{CUDNN_LIBRARY_DIR}
PATHS /usr/local/lib64
/usr/local/cuda/lib64
/usr/local/cuda/lib
...
...
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