[Cmake-commits] CMake branch, next, updated. v2.8.1-1449-g20b29b0
James Bigler
jamesbigler at gmail.com
Mon Jun 21 19:26:56 EDT 2010
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 20b29b070ef7a6fcc1842b2554edc9798bce522c (commit)
via bb6acb8667c98bfa4210da84678fdcb2df42a433 (commit)
from 4115fc40489a878d3125b3275b830861359b8ddf (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20b29b070ef7a6fcc1842b2554edc9798bce522c
commit 20b29b070ef7a6fcc1842b2554edc9798bce522c
Merge: 4115fc4 bb6acb8
Author: James Bigler <jamesbigler at gmail.com>
Date: Mon Jun 21 17:23:23 2010 -0600
Merge branch 'topics/CudaRTEmuLibraryForCUDA30' into next
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb6acb8667c98bfa4210da84678fdcb2df42a433
commit bb6acb8667c98bfa4210da84678fdcb2df42a433
Author: James Bigler <jamesbigler at gmail.com>
Date: Mon Jun 21 17:11:57 2010 -0600
Add support for the emulation version of the cudart library.
In version 3.0 of the CUDA toolkit when building code for emulation, you need to link
against a new version of the cuda run time library called cudartemu. This CL adds a check
for the new library and uses it when present and in emulation mode. Note that this
library is not present in previous or subsequent versions of the CUDA toolkit.
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 6539057..fc6a42d 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -418,6 +418,10 @@ if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_VERSION CACHE)
unset(CUDA_TOOLKIT_INCLUDE CACHE)
unset(CUDA_CUDART_LIBRARY CACHE)
+ if(CUDA_VERSION VERSION_EQUAL "3.0")
+ # This only existed in the 3.0 version of the CUDA toolkit
+ unset(CUDA_CUDARTEMU_LIBRARY CACHE)
+ endif()
unset(CUDA_CUDA_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE)
@@ -545,11 +549,28 @@ endmacro()
# CUDA_LIBRARIES
find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")
-set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+if(CUDA_VERSION VERSION_EQUAL "3.0")
+ # The cudartemu library only existed for the 3.0 version of CUDA.
+ find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library")
+ mark_as_advanced(
+ CUDA_CUDARTEMU_LIBRARY
+ )
+endif()
+# If we are using emulation mode and we found the cudartemu library then use
+# that one instead of cudart.
+if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+ set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
+else()
+ set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+endif()
if(APPLE)
# We need to add the path to cudart to the linker using rpath, since the
# library name for the cuda libraries is prepended with @rpath.
- get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+ if(CUDA_BUILD_EMULATION AND CUDA_CUDARTEMU_LIBRARY)
+ get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
+ else()
+ get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+ endif()
if(_cuda_path_to_cudart)
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
endif()
-----------------------------------------------------------------------
Summary of changes:
Modules/FindCUDA.cmake | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list