From 4fe9f534f522505f2609bac019ffcb8c6826a7b7 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 20 Sep 2020 17:11:33 +0300 Subject: [PATCH] Tests: Don't unnecessarily set CUDA_ARCHITECTURES Architecture 30 was removed with CUDA 11, so most of the CUDA tests fail with it. Remove setting the architecture and bump the minimum version to 3.18, so CMP0104 takes effect and we can rely on the default architecture, which is guaranteed to be compilable. Use of __ldg() in ProperLinkFlags was removed as it only affects performance and is available only on sm_35 and above. Testing the functionality of CUDA_ARCHITECTURES is already covered by CudaOnly.Architecture and CudaOnly.CompileFlags. --- Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt | 3 +-- Tests/Cuda/Complex/CMakeLists.txt | 7 ++----- Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt | 5 ++--- Tests/Cuda/MixedStandardLevels1/CMakeLists.txt | 3 +-- Tests/Cuda/MixedStandardLevels2/CMakeLists.txt | 3 +-- Tests/Cuda/MixedStandardLevels3/CMakeLists.txt | 4 +--- Tests/Cuda/MixedStandardLevels4/CMakeLists.txt | 3 +-- Tests/Cuda/MixedStandardLevels5/CMakeLists.txt | 3 +-- Tests/Cuda/ObjectLibrary/CMakeLists.txt | 2 +- Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt | 3 +-- Tests/Cuda/ProperLinkFlags/CMakeLists.txt | 6 ++---- Tests/Cuda/ProperLinkFlags/file1.cu | 1 - Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt | 2 +- Tests/Cuda/WithC/CMakeLists.txt | 4 +--- Tests/CudaOnly/CircularLinkLine/CMakeLists.txt | 5 ++--- Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt | 5 ++--- Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt | 6 ++---- Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt | 4 +--- Tests/CudaOnly/RuntimeControls/CMakeLists.txt | 3 +-- Tests/CudaOnly/SeparateCompilation/CMakeLists.txt | 6 ++---- Tests/CudaOnly/Standard98/CMakeLists.txt | 4 +--- Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt | 2 +- Tests/CudaOnly/WithDefs/CMakeLists.txt | 7 ++----- 23 files changed, 30 insertions(+), 61 deletions(-) diff --git a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt index f4ad83a302..50338cfcd4 100644 --- a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt +++ b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(CXXStandardSetTwice CXX CUDA) set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(CXXStandardSetTwice main.cu) target_compile_features(CXXStandardSetTwice PUBLIC cxx_std_11) diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt index 265bd85c1b..63defdf72b 100644 --- a/Tests/Cuda/Complex/CMakeLists.txt +++ b/Tests/Cuda/Complex/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (Complex CXX CUDA) +cmake_minimum_required(VERSION 3.18) +project(Complex CXX CUDA) #Goal for this example: #build a cpp dynamic library base @@ -14,8 +13,6 @@ project (Complex CXX CUDA) #this tests that we can properly handle linking cuda and cpp together #and also building cpp targets that need cuda implicit libraries -#verify that we can pass explicit cuda arch flags -set(CMAKE_CUDA_ARCHITECTURES 30) set(CMAKE_CUDA_STANDARD 11) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD_REQUIRED TRUE) diff --git a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt index 7098a7df53..b01b9d7f0b 100644 --- a/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt +++ b/Tests/Cuda/ConsumeCompileFeatures/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (ConsumeCompileFeatures CXX CUDA) +cmake_minimum_required(VERSION 3.18) +project(ConsumeCompileFeatures CXX CUDA) #Goal for this example: #build a c++11 library that express a c++11 public compile feature diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt index e40ffa6daa..ac2b2f5123 100644 --- a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt @@ -1,9 +1,8 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels1 CXX CUDA) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels1 main.cu lib.cpp) diff --git a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt index 7af8081fa9..9ef734b5c3 100644 --- a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels2 CXX CUDA) set(CMAKE_CXX_STANDARD 17) #this can decay -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels2 main.cu lib.cpp) target_compile_features(MixedStandardLevels2 PUBLIC cuda_std_11) diff --git a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt index 2c420030aa..629d99cf83 100644 --- a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels3 CXX CUDA) -set(CMAKE_CUDA_ARCHITECTURES 30) - add_executable(MixedStandardLevels3 main.cu lib.cpp) target_compile_features(MixedStandardLevels3 PUBLIC cuda_std_03 cxx_std_14) diff --git a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt index 230230d0dc..8ce57ca219 100644 --- a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels4 CXX CUDA) set(CMAKE_CUDA_STANDARD 03) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels4 main.cu lib.cpp) target_compile_features(MixedStandardLevels4 PUBLIC cxx_std_14) diff --git a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt index 5f5ee0637e..a3c355761a 100644 --- a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt +++ b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(MixedStandardLevels5 CXX CUDA) set(CMAKE_CXX_STANDARD 98) -set(CMAKE_CUDA_ARCHITECTURES 30) add_executable(MixedStandardLevels5 main.cu lib.cpp) diff --git a/Tests/Cuda/ObjectLibrary/CMakeLists.txt b/Tests/Cuda/ObjectLibrary/CMakeLists.txt index 395bd3881f..d308514cba 100644 --- a/Tests/Cuda/ObjectLibrary/CMakeLists.txt +++ b/Tests/Cuda/ObjectLibrary/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (ObjectLibrary CUDA CXX) #Goal for this example: # diff --git a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt index fe28c3edc4..43068d9804 100644 --- a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt +++ b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.18) project(ProperDeviceLibraries CXX CUDA) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 35) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) diff --git a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt index d38da6d14a..862b03bf28 100644 --- a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt +++ b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (ProperLinkFlags CUDA CXX) +cmake_minimum_required(VERSION 3.18) +project(ProperLinkFlags CUDA CXX) #Goal for this example: #Verify that when we have CXX and CUDA enabled and we link an executable that @@ -19,7 +18,6 @@ set(CMAKE_CXX_FLAGS "-Wall") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 35) add_executable(ProperLinkFlags file1.cu main.cxx) set_target_properties( ProperLinkFlags diff --git a/Tests/Cuda/ProperLinkFlags/file1.cu b/Tests/Cuda/ProperLinkFlags/file1.cu index 9a105f04f2..1ce63bf98d 100644 --- a/Tests/Cuda/ProperLinkFlags/file1.cu +++ b/Tests/Cuda/ProperLinkFlags/file1.cu @@ -3,7 +3,6 @@ result_type __device__ file1_func(int x) { - __ldg(&x); result_type r; r.input = x; r.sum = x * x; diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt index 48df558565..61a3190bea 100644 --- a/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt +++ b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.18) project(SharedRuntimePlusToolkit CXX) #Goal for this example: diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt index 049cbce1f9..cc5fa0c2da 100644 --- a/Tests/Cuda/WithC/CMakeLists.txt +++ b/Tests/Cuda/WithC/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(WithC CUDA C) -set(CMAKE_CUDA_ARCHITECTURES 30) - add_executable(CudaWithC main.c cuda.cu) if(APPLE) diff --git a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt index e10a348732..caf9391d1e 100644 --- a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt +++ b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.7) -project (CircularLinkLine CUDA) +cmake_minimum_required(VERSION 3.18) +project(CircularLinkLine CUDA) #Goal for this example: # Verify that we de-duplicate the device link line @@ -7,7 +7,6 @@ project (CircularLinkLine CUDA) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) add_library(CUDACircularDeviceLinking1 STATIC file1.cu) add_library(CUDACircularDeviceLinking2 STATIC file2.cu) diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt index 126566035f..c8e8ebc946 100644 --- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.13) -project (DontResolveDeviceSymbols CUDA) +cmake_minimum_required(VERSION 3.18) +project(DontResolveDeviceSymbols CUDA) # Find nm and dumpbin if(CMAKE_NM) @@ -26,7 +26,6 @@ endif() # Verify that we can't use those device symbols from anything set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30 50) set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF) add_library(CUDANoDeviceResolve SHARED file1.cu) diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt index 6675655cf1..e9c0c1b9cd 100644 --- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt +++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt @@ -1,9 +1,7 @@ - -cmake_minimum_required(VERSION 3.7) -project (GPUDebugFlag CUDA) +cmake_minimum_required(VERSION 3.18) +project(GPUDebugFlag CUDA) set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) # Goal for this example: # Verify that enabling device debug works. diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt index bd94ec8133..a44b2f2a77 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (ResolveDeviceSymbols CUDA) # Find nm and dumpbin @@ -21,8 +21,6 @@ endif() # confirming that the first static library is on the device link line # 3. Verify that we can't use those device symbols from anything that links # to the static library -set(CMAKE_CUDA_ARCHITECTURES 30 50) - add_library(CUDAResolveDeviceDepsA STATIC file1.cu) add_library(CUDAResolveDeviceDepsB STATIC file2.cu) target_compile_features(CUDAResolveDeviceDepsA PUBLIC cuda_std_11) diff --git a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt index 0da57390b7..b3b2210dc8 100644 --- a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt +++ b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project (RuntimeControls CUDA) # Find nm and dumpbin @@ -16,7 +16,6 @@ else() endif() set(CMAKE_CUDA_STANDARD 11) -set(CMAKE_CUDA_ARCHITECTURES 30) set(CMAKE_CUDA_RUNTIME_LIBRARY static) if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC") diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 586be81ff2..864ecbfb5d 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -1,6 +1,5 @@ - -cmake_minimum_required(VERSION 3.7) -project (SeparateCompilation CUDA) +cmake_minimum_required(VERSION 3.18) +project(SeparateCompilation CUDA) #Goal for this example: #Build a static library that defines multiple methods and kernels that @@ -9,7 +8,6 @@ project (SeparateCompilation CUDA) #and executables. #We complicate the matter by also testing that multiple static libraries #all containing cuda separable compilation code links properly -set(CMAKE_CUDA_ARCHITECTURES 30 35 50 52) set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu) target_compile_features(CUDASeparateLibA PRIVATE cuda_std_11) diff --git a/Tests/CudaOnly/Standard98/CMakeLists.txt b/Tests/CudaOnly/Standard98/CMakeLists.txt index 3ba036095d..682335295c 100644 --- a/Tests/CudaOnly/Standard98/CMakeLists.txt +++ b/Tests/CudaOnly/Standard98/CMakeLists.txt @@ -1,8 +1,6 @@ -cmake_minimum_required(VERSION 3.7) +cmake_minimum_required(VERSION 3.18) project(CudaOnlyStandard98 CUDA) -set(CMAKE_CUDA_ARCHITECTURES 30) - # Support setting CUDA Standard to 98 which internally gets transformed to # CUDA03 set(CMAKE_CUDA_STANDARD 98) diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt index 708a352c67..534bab2c01 100644 --- a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt +++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.18) project(StaticRuntimePlusToolkit CUDA) #Goal for this example: diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index 0ed81d89de..02f043f362 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -1,9 +1,6 @@ +cmake_minimum_required(VERSION 3.18) +project(WithDefs CUDA) -cmake_minimum_required(VERSION 3.7) -project (WithDefs CUDA) - -#verify that we can pass explicit cuda arch flags -set(CMAKE_CUDA_ARCHITECTURES 30) set(release_compile_defs DEFREL) #Goal for this example: