Skip to content

Commit

Permalink
Merge pull request pytorch#259 from Moodstocks/cuda_arch_detect
Browse files Browse the repository at this point in the history
Add automatic CUDA architecture detection
  • Loading branch information
soumith committed Oct 12, 2015
2 parents 0495d40 + 24f950d commit b9c1d6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ IF(APPLE)
# CUDA 7 supports clang and libc++ so no need to change anything
ENDIF(APPLE)

LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20")
# Detect CUDA architecture and get best NVCC flags
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/FindCudaArch.cmake)
SELECT_NVCC_ARCH_FLAGS(NVCC_FLAGS_EXTRA)
LIST(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA})

INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("${CUDA_SDK_ROOT_DIR}/common/inc")
Expand Down

0 comments on commit b9c1d6f

Please sign in to comment.