FindCUDA: Add support for finding the cublas_device library

This commit is contained in:
James Sharpe 2016-05-25 11:28:39 +01:00 committed by Brad King
parent 6052e4b3bf
commit 81e73b7240
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,4 @@
FindCUDA-cublas_device
----------------------
* The :module:`FindCUDA` module learned to find the ``cublas_device`` library.

View File

@ -549,6 +549,7 @@ macro(cuda_unset_include_and_libraries)
endif() endif()
unset(CUDA_cudart_static_LIBRARY CACHE) unset(CUDA_cudart_static_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublas_device_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE)
unset(CUDA_cufft_LIBRARY CACHE) unset(CUDA_cufft_LIBRARY CACHE)
unset(CUDA_cufftemu_LIBRARY CACHE) unset(CUDA_cufftemu_LIBRARY CACHE)
@ -854,6 +855,7 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2")
endif() endif()
endif() endif()
if(CUDA_VERSION VERSION_GREATER "5.0") if(CUDA_VERSION VERSION_GREATER "5.0")
find_cuda_helper_libs(cublas_device)
# In CUDA 5.5 NPP was splitted onto 3 separate libraries. # In CUDA 5.5 NPP was splitted onto 3 separate libraries.
find_cuda_helper_libs(nppc) find_cuda_helper_libs(nppc)
find_cuda_helper_libs(nppi) find_cuda_helper_libs(nppi)
@ -872,7 +874,7 @@ if (CUDA_BUILD_EMULATION)
set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY}) set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublasemu_LIBRARY})
else() else()
set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY}) set(CUDA_CUFFT_LIBRARIES ${CUDA_cufft_LIBRARY})
set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY}) set(CUDA_CUBLAS_LIBRARIES ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY})
endif() endif()
######################## ########################
@ -1803,7 +1805,7 @@ macro(CUDA_ADD_CUBLAS_TO_TARGET target)
if (CUDA_BUILD_EMULATION) if (CUDA_BUILD_EMULATION)
target_link_libraries(${target} ${CUDA_cublasemu_LIBRARY}) target_link_libraries(${target} ${CUDA_cublasemu_LIBRARY})
else() else()
target_link_libraries(${target} ${CUDA_cublas_LIBRARY}) target_link_libraries(${target} ${CUDA_cublas_LIBRARY} ${CUDA_cublas_device_LIBRARY})
endif() endif()
endmacro() endmacro()