summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt')
-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()