[Cmake-commits] CMake branch, next, updated. v3.7.2-2338-g203112a
Brad King
brad.king at kitware.com
Wed Jan 25 10:32:30 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 203112a512053157b7931ba0d92573e1a1bf86ba (commit)
via c1f3086de70793ee5552986347291d814b796232 (commit)
from b022eb947f75b36ddaf3ec4aeffac56025e19ed0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=203112a512053157b7931ba0d92573e1a1bf86ba
commit 203112a512053157b7931ba0d92573e1a1bf86ba
Merge: b022eb9 c1f3086
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 25 10:32:29 2017 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 25 10:32:29 2017 -0500
Merge topic 'FindCUDA-select-flags-auto-msvc' into next
c1f3086d FindCUDA: Enable CUDA_SELECT_NVCC_ARCH_FLAGS Auto for MSVC
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1f3086de70793ee5552986347291d814b796232
commit c1f3086de70793ee5552986347291d814b796232
Author: Bjoern Thiel <bjoern.thiel at mpibpc.mpg.de>
AuthorDate: Wed Jan 25 09:45:18 2017 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 25 10:31:27 2017 -0500
FindCUDA: Enable CUDA_SELECT_NVCC_ARCH_FLAGS Auto for MSVC
Fixes: #16525
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 5ce71a9..19fc14f 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -44,9 +44,10 @@ endif ()
#
function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
if(NOT CUDA_GPU_DETECT_OUTPUT)
- set(cufile ${PROJECT_BINARY_DIR}/detect_cuda_archs.cu)
+ set(file ${PROJECT_BINARY_DIR}/detect_cuda_compute_capabilities.cpp)
- file(WRITE ${cufile} ""
+ file(WRITE ${file} ""
+ "#include <cuda_runtime.h>\n"
"#include <cstdio>\n"
"int main()\n"
"{\n"
@@ -62,14 +63,15 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
" return 0;\n"
"}\n")
- execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${cufile}"
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
- RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out
- ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+ try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
+ CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
+ LINK_LIBRARIES ${CUDA_LIBRARIES}
+ RUN_OUTPUT_VARIABLE compute_capabilities)
- if(nvcc_res EQUAL 0)
- string(REPLACE "2.1" "2.1(2.0)" nvcc_out "${nvcc_out}")
- set(CUDA_GPU_DETECT_OUTPUT ${nvcc_out} CACHE INTERNAL "Returned GPU architetures from detect_gpus tool" FORCE)
+ if(run_result EQUAL 0)
+ string(REPLACE "2.1" "2.1(2.0)" compute_capabilities "${compute_capabilities}")
+ set(CUDA_GPU_DETECT_OUTPUT ${compute_capabilities}
+ CACHE INTERNAL "Returned GPU architetures from detect_gpus tool" FORCE)
endif()
endif()
-----------------------------------------------------------------------
Summary of changes:
Modules/FindCUDA/select_compute_arch.cmake | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list