Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cunn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-05-27 20:32:19 +0300
committerSoumith Chintala <soumith@gmail.com>2016-05-27 20:32:19 +0300
commit1342a08459e2863a947223538ed268af50626dba (patch)
tree16850f4e493e99b77de31290abcedb21c89383c6
parent00209fcdc3712bcad53a2c916c1812bff7756fe6 (diff)
parentc8730c6df9e1d8462659ed4bd20eeddb5d015e0a (diff)
Merge pull request #281 from borisfom/master
Poring to new CMake
-rw-r--r--CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 266241c..fc39fbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,18 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
CMAKE_POLICY(VERSION 2.8)
-SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
-
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(CUDA 6.5 REQUIRED)
# Detect CUDA architecture and get best NVCC flags
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindCudaArch.cmake)
-SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA)
+IF(DEFINED CUDA_HAS_FP16)
+ # New CMake macro, comes with FindCUDA
+ CUDA_SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA $ENV{TORCH_CUDA_ARCH_LIST})
+ELSE()
+ # Old way of getting the flags, with extra include file
+ INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindCudaArch.cmake)
+ SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA)
+ENDIF()
LIST(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA})
INCLUDE_DIRECTORIES("${Torch_INSTALL_INCLUDE}/THC")