summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-05-19 18:02:51 (GMT)
committerBrad King <brad.king@kitware.com>2020-05-20 14:48:20 (GMT)
commit4c7cc264af285ec5c12989a8d18a5141a9c0dd68 (patch)
tree65a471b3638809eb233fecbba12b695552733eb8 /Tests/CudaOnly
parentb246dee7db2e7e6fcd2a00c5b2bd6db21045025f (diff)
downloadCMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.zip
CMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.tar.gz
CMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.tar.bz2
Tests: Restore NVCC-specific CUDA tests
In commit a653ca9504 (Tests: Update CUDA tests to work with Clang, 2020-03-27) some tests were conditioned using `CMAKE_CUDA_COMPILER_ID`. That is not defined when configuring CMake itself, so it accidentally turned off NVCC-specific CUDA tests altogether. Convert the conditions to check `CMake_TEST_CUDA` for `Clang` instead. That option is added explicitly to builds where we want the tests to run, so we can set it to a value indicating the CUDA compiler vendor. In commit a653ca9504 (Tests: Update CUDA tests to work with Clang, 2020-03-27) the NVCC-specific `CudaOnly.GPUDebugFlag` test was accidentally broken by removing a space when appending `-G` to the CUDA flags. This was covered by the test not running. Restore the space. Fixes: #20727
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r--Tests/CudaOnly/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt2
2 files changed, 2 insertions, 2 deletions
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index ee7374e..69190c7 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -8,7 +8,7 @@ ADD_TEST_MACRO(CudaOnly.Standard98 CudaOnlyStandard98)
ADD_TEST_MACRO(CudaOnly.Toolkit CudaOnlyToolkit)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
-if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang")
# Separable compilation is currently only supported on NVCC. Disable tests
# using it for other compilers.
ADD_TEST_MACRO(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
index 325723a..6675655 100644
--- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
+++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
@@ -7,7 +7,7 @@ set(CMAKE_CUDA_ARCHITECTURES 30)
# Goal for this example:
# Verify that enabling device debug works.
-string(APPEND CMAKE_CUDA_FLAGS "-G")
+string(APPEND CMAKE_CUDA_FLAGS " -G")
add_executable(CudaOnlyGPUDebugFlag main.cu)