From a9bb2606c1c16a2077496ad5082a2ba2628d5194 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Jan 2024 14:25:35 -0500 Subject: Tests: Fix condition adding nvcc-only flags in CudaOnly.SeparateCompilation --- Tests/CudaOnly/SeparateCompilation/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index ca73b1a..f2eb406 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -20,7 +20,7 @@ set_target_properties(CUDASeparateLibA POSITION_INDEPENDENT_CODE ON) unset(CMAKE_CUDA_SEPARABLE_COMPILATION) -if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") +if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") # Test adding a flag that is not in our CUDA flag table for VS. if(NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 8) string(APPEND CMAKE_CUDA_FLAGS " --ftemplate-depth 50") -- cgit v0.12 From d40bca5a8c5e85b48f2af788a5161015ae1585c3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Jan 2024 14:13:25 -0500 Subject: Tests: Remove unused iostream from CUDA sources --- Tests/Cuda/Complex/main.cpp | 2 -- Tests/Cuda/ObjectLibrary/main.cpp | 3 --- Tests/Cuda/ProperLinkFlags/main.cxx | 3 --- Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp | 1 - Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp | 1 - Tests/CudaOnly/DontResolveDeviceSymbols/main.cu | 3 --- Tests/CudaOnly/EnableStandard/main.cu | 3 --- Tests/CudaOnly/ExportPTX/main.cu | 3 --- Tests/CudaOnly/SeparateCompilation/file4.cu | 3 --- Tests/CudaOnly/SeparateCompilation/file5.cu | 3 --- Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu | 3 --- Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu | 3 --- Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu | 3 --- Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu | 1 - Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu | 1 - 15 files changed, 36 deletions(-) diff --git a/Tests/Cuda/Complex/main.cpp b/Tests/Cuda/Complex/main.cpp index da09b44..032f910 100644 --- a/Tests/Cuda/Complex/main.cpp +++ b/Tests/Cuda/Complex/main.cpp @@ -1,5 +1,3 @@ -#include - #include "file1.h" #include "file2.h" diff --git a/Tests/Cuda/ObjectLibrary/main.cpp b/Tests/Cuda/ObjectLibrary/main.cpp index e28f088..cc727c6 100644 --- a/Tests/Cuda/ObjectLibrary/main.cpp +++ b/Tests/Cuda/ObjectLibrary/main.cpp @@ -1,6 +1,3 @@ - -#include - int cpp_sq_func(int); int cu1_sq_func(int); int cu2_sq_func(int); diff --git a/Tests/Cuda/ProperLinkFlags/main.cxx b/Tests/Cuda/ProperLinkFlags/main.cxx index 7c0ee9e..665f31c 100644 --- a/Tests/Cuda/ProperLinkFlags/main.cxx +++ b/Tests/Cuda/ProperLinkFlags/main.cxx @@ -1,6 +1,3 @@ - -#include - #include "file1.h" int main(int argc, char** argv) diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp index ac5341c..1e7350a 100644 --- a/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp +++ b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp @@ -8,7 +8,6 @@ #endif #include -#include #include #include diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp index ac5341c..1e7350a 100644 --- a/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp +++ b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp @@ -8,7 +8,6 @@ #endif #include -#include #include #include diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu index 84a7a19..d123e09 100644 --- a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu +++ b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu @@ -1,6 +1,3 @@ - -#include - int main(int argc, char** argv) { return 0; diff --git a/Tests/CudaOnly/EnableStandard/main.cu b/Tests/CudaOnly/EnableStandard/main.cu index 740c832..acbbee3 100644 --- a/Tests/CudaOnly/EnableStandard/main.cu +++ b/Tests/CudaOnly/EnableStandard/main.cu @@ -1,6 +1,3 @@ - -#include - #ifdef _WIN32 # define IMPORT __declspec(dllimport) #else diff --git a/Tests/CudaOnly/ExportPTX/main.cu b/Tests/CudaOnly/ExportPTX/main.cu index 132377c..d2a9b90 100644 --- a/Tests/CudaOnly/ExportPTX/main.cu +++ b/Tests/CudaOnly/ExportPTX/main.cu @@ -1,6 +1,3 @@ - -#include - /* Define GENERATED_HEADER macro to allow c++ files to include headers generated based on different configuration types. diff --git a/Tests/CudaOnly/SeparateCompilation/file4.cu b/Tests/CudaOnly/SeparateCompilation/file4.cu index cc24a46..f2ef8e7 100644 --- a/Tests/CudaOnly/SeparateCompilation/file4.cu +++ b/Tests/CudaOnly/SeparateCompilation/file4.cu @@ -1,6 +1,3 @@ - -#include - #include "file1.h" #include "file2.h" diff --git a/Tests/CudaOnly/SeparateCompilation/file5.cu b/Tests/CudaOnly/SeparateCompilation/file5.cu index 38cbeb2..9b2c92a 100644 --- a/Tests/CudaOnly/SeparateCompilation/file5.cu +++ b/Tests/CudaOnly/SeparateCompilation/file5.cu @@ -1,6 +1,3 @@ - -#include - #include "file1.h" #include "file2.h" diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu index 234586f..2e824ec 100644 --- a/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu +++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/bar.cu @@ -1,6 +1,3 @@ - -#include - #ifdef _WIN32 # define EXPORT __declspec(dllexport) #else diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu index 75c04af..88acaca 100644 --- a/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu +++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/foo.cu @@ -1,6 +1,3 @@ - -#include - #ifdef _WIN32 # define EXPORT __declspec(dllexport) #else diff --git a/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu b/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu index 78b10b1..367c488 100644 --- a/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu +++ b/Tests/CudaOnly/SeparateCompilationTargetObjects/main.cu @@ -1,6 +1,3 @@ -// main.cu -#include - #ifdef _WIN32 # define IMPORT __declspec(dllimport) #else diff --git a/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu b/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu index ac5341c..1e7350a 100644 --- a/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu +++ b/Tests/CudaOnly/SharedRuntimePlusToolkit/nppif.cu @@ -8,7 +8,6 @@ #endif #include -#include #include #include diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu b/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu index ac5341c..1e7350a 100644 --- a/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu +++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/nppif.cu @@ -8,7 +8,6 @@ #endif #include -#include #include #include -- cgit v0.12 From af85fa7ac1a37ba063b375893ad4ecdd66d260bf Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Jan 2024 14:07:52 -0500 Subject: Tests: Remove unused dllexport markup from CudaOnly.DeviceLTO The test does not use shared libraries. --- Tests/CudaOnly/DeviceLTO/file1.cu | 8 +------- Tests/CudaOnly/DeviceLTO/main.cu | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Tests/CudaOnly/DeviceLTO/file1.cu b/Tests/CudaOnly/DeviceLTO/file1.cu index 703927c..5ca000d 100644 --- a/Tests/CudaOnly/DeviceLTO/file1.cu +++ b/Tests/CudaOnly/DeviceLTO/file1.cu @@ -1,16 +1,10 @@ -#ifdef _WIN32 -# define EXPORT __declspec(dllexport) -#else -# define EXPORT -#endif - extern __device__ int file2_func(int); void __global__ kernel(int x) { file2_func(x); } -EXPORT int launch_kernel(int x) +int launch_kernel(int x) { kernel<<<1, 1>>>(x); return x; diff --git a/Tests/CudaOnly/DeviceLTO/main.cu b/Tests/CudaOnly/DeviceLTO/main.cu index 8ef4873..bb72471 100644 --- a/Tests/CudaOnly/DeviceLTO/main.cu +++ b/Tests/CudaOnly/DeviceLTO/main.cu @@ -2,13 +2,7 @@ #include "cuda.h" -#ifdef _WIN32 -# define IMPORT __declspec(dllimport) -#else -# define IMPORT -#endif - -IMPORT int launch_kernel(int x); +int launch_kernel(int x); int choose_cuda_device() { -- cgit v0.12 From 5eb26fb943b25b13cd8f98739da894593e778f28 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Jan 2024 14:23:42 -0500 Subject: Tests: Fix CudaOnly.Toolkit coverage of npp libs --- Tests/CudaOnly/Toolkit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt index b2694bf..df1c44c 100644 --- a/Tests/CudaOnly/Toolkit/CMakeLists.txt +++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt @@ -57,7 +57,7 @@ set(npp_libs nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps npp if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11) list(APPEND npp_libs nppicom) endif() -foreach (cuda_lib ) +foreach (cuda_lib IN LISTS npp_libs) if(NOT CUDA_${cuda_lib}_LIBRARY) message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found") elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]]) -- cgit v0.12 From 607d271b1f8f8b6551bb9b4f3ca2acc50b41503b Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 18 Jan 2024 14:22:39 -0500 Subject: Tests: Do not expect nvToolsExt in CUDA 12 toolkit --- Tests/Cuda/Toolkit/CMakeLists.txt | 6 +++++- Tests/CudaOnly/Toolkit/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt index 4255b82..08ba20a 100644 --- a/Tests/Cuda/Toolkit/CMakeLists.txt +++ b/Tests/Cuda/Toolkit/CMakeLists.txt @@ -70,7 +70,11 @@ foreach (cuda_lib IN LISTS npp_libs) endif() endforeach() -foreach (cuda_lib nvrtc nvToolsExt OpenCL) +set(nv_libs nvrtc OpenCL) +if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 12) + list(APPEND nv_libs nvToolsExt) +endif() +foreach (cuda_lib IN LISTS nv_libs) if(NOT TARGET CUDA::${cuda_lib}) message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found") endif() diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt index df1c44c..477c816 100644 --- a/Tests/CudaOnly/Toolkit/CMakeLists.txt +++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt @@ -68,7 +68,11 @@ foreach (cuda_lib IN LISTS npp_libs) endif() endforeach() -foreach (cuda_lib nvrtc nvToolsExt OpenCL) +set(nv_libs nvrtc OpenCL) +if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 12) + list(APPEND nv_libs nvToolsExt) +endif() +foreach (cuda_lib IN LISTS nv_libs) if(NOT CUDA_${cuda_lib}_LIBRARY) message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found") elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]]) -- cgit v0.12