Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
8af5a886
Commit
8af5a886
authored
Nov 21, 2017
by
Tristan Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes from review
parent
17ac2f3e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
40 deletions
+32
-40
CMakeLists.txt
CMakeLists.txt
+18
-0
CMakeLists.txt
src/ngraph/CMakeLists.txt
+6
-31
CMakeLists.txt
test/CMakeLists.txt
+8
-9
No files found.
CMakeLists.txt
View file @
8af5a886
...
...
@@ -92,6 +92,24 @@ if (NOT DEFINED NGRAPH_CPU_ENABLE)
SET
(
NGRAPH_CPU_ENABLE TRUE
)
endif
()
#-----------------------------------------------------------------------------------------------
# GPU support
#-----------------------------------------------------------------------------------------------
# Setup CUDA and cuDNN if NGRAPH_GPU_ENABLE=TRUE
if
(
NGRAPH_GPU_ENABLE
)
find_package
(
CUDA 8 REQUIRED
)
find_package
(
CUDNN 5 QUIET REQUIRED
)
include_directories
(
${
CUDA_INCLUDE_DIRS
}
${
CUDNN_INCLUDE_DIR
}
${
LLVM_INCLUDE_DIR
}
)
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
AND
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0 AND
CUDA_HOST_COMPILER STREQUAL CMAKE_C_COMPILER
)
message
(
FATAL_ERROR
"CUDA 8.0 is not compatible with GCC version >= 6.
\n
"
"Please select a correct compiler version
\n
"
)
endif
()
endif
()
#-----------------------------------------------------------------------------------------------
# External projects install directory
#-----------------------------------------------------------------------------------------------
...
...
src/ngraph/CMakeLists.txt
View file @
8af5a886
...
...
@@ -79,35 +79,6 @@ set (SRC
util.cpp
)
if
(
USE_CUDA
)
find_package
(
CUDA 8 REQUIRED
)
if
(
CUDA_FOUND
)
include_directories
(
SYSTEM
${
CUDA_INCLUDE_DIR
}
)
link_directories
(
${
CUDA_LIB_DIR
}
)
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
AND
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0 AND
CUDA_HOST_COMPILER STREQUAL CMAKE_C_COMPILER
)
message
(
FATAL_ERROR
"CUDA 8.0 is not compatible with GCC version >= 6.
\n
"
"Please select a correct compiler version
\n
"
)
endif
()
find_package
(
CUDNN 5 QUIET
)
if
(
NOT CUDNN_FOUND
)
message
(
WARNING
"If cuDNN is installed, try setting -DCUDNN_ROOT_DIR"
"Not compiling with CUDA. Suppress this warning with -DUSE_CUDA=OFF"
)
set
(
USE_CUDA OFF
)
else
()
include_directories
(
SYSTEM
${
CUDNN_INCLUDE_DIR
}
${
LLVM_INCLUDE_DIR
}
)
link_directories
(
${
CUDNN_LIB_DIR
}
${
LLVM_LIB_DIR
}
)
endif
()
else
()
message
(
WARNING
"Not compiling with CUDA. Suppress this warning with -DUSE_CUDA=OFF"
)
set
(
USE_CUDA OFF
)
endif
()
endif
()
# find_program (GRAPHVIZ dot)
# message (STATUS "graphviz '${GRAPHVIZ}'")
find_package
(
Graphviz
)
...
...
@@ -191,7 +162,7 @@ message(STATUS "LIBRARY_OUTPUT_DIRECTORY set to: ${COMMON_LIBRARY_OUTPUT_DIRECTO
target_include_directories
(
ngraph PUBLIC
"
${
NGRAPH_INCLUDE_PATH
}
"
)
if
((
NGRAPH_CPU_ENABLE OR
USE_CUDA
)
AND LLVM_LINK_LIBS
)
if
((
NGRAPH_CPU_ENABLE OR
NGRAPH_GPU_ENABLE
)
AND LLVM_LINK_LIBS
)
target_link_libraries
(
ngraph PRIVATE
${
LLVM_LINK_LIBS
}
)
endif
()
...
...
@@ -205,6 +176,10 @@ if(NGRAPH_CPU_ENABLE AND MKLDNN_LIB_DIR)
target_link_libraries
(
ngraph PRIVATE mkldnn
)
endif
()
if
(
NGRAPH_GPU_ENABLE AND CUDA_LIBRARIES
)
target_link_libraries
(
ngraph PRIVATE
${
CUDA_LIBRARIES
}
${
CUDNN_LIBRARIES
}
)
endif
()
#-----------------------------------------------------------------------------------------------
# Installation logic...
...
...
@@ -256,7 +231,7 @@ endif()
add_dependencies
(
ngraph eigen
)
if
((
NGRAPH_CPU_ENABLE OR
USE_CUDA
)
AND LLVM_INCLUDE_DIR
)
if
((
NGRAPH_CPU_ENABLE OR
NGRAPH_GPU_ENABLE
)
AND LLVM_INCLUDE_DIR
)
add_dependencies
(
ngraph ext_llvm
)
endif
()
...
...
test/CMakeLists.txt
View file @
8af5a886
...
...
@@ -64,12 +64,12 @@ if(NGRAPH_CPU_ENABLE AND LLVM_INCLUDE_DIR)
set
(
BACKEND_NAMES
${
BACKEND_NAMES
}
"CPU"
)
endif
()
if
(
USE_CUDA
)
find_package
(
CUDA QUIET
)
include_directories
(
SYSTEM
${
CUDA_INCLUDE_DIRS
}
${
CUDNN_INCLUDE_DIR
}
${
LLVM_INCLUDE_DIR
}
)
link_directories
(
${
LLVM_LIB_DIR
}
)
set
(
SRC main.cpp cudnn.cpp
)
set
(
BACKEND_NAMES
)
if
(
NGRAPH_GPU_ENABLE
)
set
(
SRC
main.cpp
cudnn.cpp
)
# Disabled for testing
# set(BACKEND_NAMES ${BACKEND_NAMES} "GPU"
)
endif
()
foreach
(
BACKEND_NAME
${
BACKEND_NAMES
}
)
...
...
@@ -93,9 +93,8 @@ if(LLVM_INCLUDE_DIR)
add_dependencies
(
unit-test ext_llvm
)
endif
()
if
(
CUDNN_INCLUDE_DIR
)
target_link_libraries
(
unit-test
${
LLVM_LINK_LIBS
}
)
target_link_libraries
(
unit-test cudnn
)
if
(
CUDA_INCLUDE_DIRS
)
target_link_libraries
(
unit-test
${
CUDA_LIBRARIES
}
${
CUDNN_LIBRARIES
}
)
endif
()
target_link_libraries
(
unit-test ngraph libgtest pthread
)
...
...
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