summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSimon Layton <slayton58@gmail.com>2016-12-09 09:02:26 -0500
committerSimon Layton <slayton58@gmail.com>2016-12-13 09:29:01 -0500
commit5e699ce6c2bfc71f37e62ac39946597ae8b76afc (patch)
tree5640c2d0d01bb1cd61dd79bd8637b8af414d6cd6 /cmake
parentb9599c7464dde326e997027850c757967e0fb838 (diff)
downloadpytorch-5e699ce6c2bfc71f37e62ac39946597ae8b76afc.tar.gz
pytorch-5e699ce6c2bfc71f37e62ac39946597ae8b76afc.tar.bz2
pytorch-5e699ce6c2bfc71f37e62ac39946597ae8b76afc.zip
CUDA fixes
Fix NCCL build move CUDA dep into Dependencies file
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Dependencies.cmake12
-rw-r--r--cmake/External/nccl.cmake10
2 files changed, 6 insertions, 16 deletions
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 6b63b603be..cdb9c12e91 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -55,15 +55,9 @@ endif()
# ---[ CUDA
include(cmake/Cuda.cmake)
-if(NOT HAVE_CUDA)
- if(CPU_ONLY)
- message(STATUS "-- CUDA is disabled. Building without it...")
- else()
- message(WARNING "-- CUDA is not detected by cmake. Building without it...")
- endif()
-
- # TODO: remove this not cross platform define in future. Use caffe_config.h instead.
- add_definitions(-DCPU_ONLY)
+if(HAVE_CUDA)
+ LIST(APPEND CUDA_NVCC_FLAGS -Xcompiler -std=c++11)
+ LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52)
endif()
# ---[ NCCL
diff --git a/cmake/External/nccl.cmake b/cmake/External/nccl.cmake
index 6da3d5f854..585b45372d 100644
--- a/cmake/External/nccl.cmake
+++ b/cmake/External/nccl.cmake
@@ -6,12 +6,8 @@ if (NOT __NCCL_INCLUDED)
if (NCCL_FOUND)
set(NCCL_EXTERNAL FALSE)
else()
- # fetch and build glog from github
-
# build directory
set(nccl_PREFIX ${CMAKE_SOURCE_DIR}/third_party/nccl)
- # install directory
- set(nccl_INSTALL ${CMAKE_BINARY_DIR}/external/nccl-install)
# we build glog statically, but want to link it into the caffe shared library
# this requires position-independent code
@@ -31,9 +27,9 @@ if (NOT __NCCL_INCLUDED)
)
set(NCCL_FOUND TRUE)
- set(NCCL_INCLUDE_DIRS ${nccl_INSTALL}/include)
- set(NCCL_LIBRARIES ${nccl_INSTALL}/lib/libnccl.a)
- set(NCCL_LIBRARY_DIRS ${nccl_INSTALL}/lib)
+ set(NCCL_INCLUDE_DIRS ${nccl_PREFIX}/build/include)
+ set(NCCL_LIBRARIES ${nccl_PREFIX}/build/lib/libnccl.so)
+ set(NCCL_LIBRARY_DIRS ${nccl_PREFIX}/build/lib)
set(NCCL_EXTERNAL TRUE)
list(APPEND external_project_dependencies nccl_external)