summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/GPUDebugFlag
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-03-27 19:31:52 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-05-15 15:12:39 (GMT)
commita653ca9504569eb45077ee598945b18a3c9e4ee8 (patch)
tree9e2753a976a8b43a0cc06587dcc62bb0f3008c84 /Tests/CudaOnly/GPUDebugFlag
parent5df21adf46be14061fe0e8ea53213d905e834600 (diff)
downloadCMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.zip
CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.gz
CMake-a653ca9504569eb45077ee598945b18a3c9e4ee8.tar.bz2
Tests: Update CUDA tests to work with Clang
Diffstat (limited to 'Tests/CudaOnly/GPUDebugFlag')
-rw-r--r--Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
index fbef15f..325723a 100644
--- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
+++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
@@ -2,18 +2,19 @@
cmake_minimum_required(VERSION 3.7)
project (GPUDebugFlag CUDA)
-#Goal for this example:
-#verify that -G enables gpu debug flags
-string(APPEND CMAKE_CUDA_FLAGS " -gencode=arch=compute_30,code=compute_30")
-string(APPEND CMAKE_CUDA_FLAGS " -G")
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
+
+# Goal for this example:
+# Verify that enabling device debug works.
+string(APPEND CMAKE_CUDA_FLAGS "-G")
add_executable(CudaOnlyGPUDebugFlag main.cu)
+#CUDA's __CUDACC_DEBUG__ define was added in NVCC 9.0
+#so if we are below 9.0.0 we will manually add the define so that the test
+#passes
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0.0)
- #CUDA's __CUDACC_DEBUG__ define was added in 9.0
- #so if we are below 9.0.0 we will manually add the define so that the test
- #passes
target_compile_definitions(CudaOnlyGPUDebugFlag PRIVATE "__CUDACC_DEBUG__")
endif()