Browse Source

Tests: Use sm_35 in Cuda.ProperDeviceLibraries for CUDA <10.0

Using the cublas device libraries seems to require at least sm_35.
Set the architecture explicitly to sm_35 for old CUDA versions, which still
have the cublas device library.
Raul Tambre 5 years ago
parent
commit
1cd4a37c12
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt

+ 5 - 0
Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt

@@ -6,6 +6,11 @@ set(CMAKE_CUDA_STANDARD 11)
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads)
 
+if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.0.0)
+  # cublas_device requires at least sm_35.
+  set(CMAKE_CUDA_ARCHITECTURES 35)
+endif()
+
 add_executable(ProperDeviceLibraries main.cu)
 set_target_properties(ProperDeviceLibraries
                       PROPERTIES CUDA_SEPARABLE_COMPILATION ON)