From d1f4d8f416f798c137132e9d1d9a94f1f5104a51 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 3 Aug 2021 11:41:30 +1000 Subject: [PATCH 1/2] Enable CUDA device code warnings as errors --- cpp/cmake/modules/ConfigureCUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/modules/ConfigureCUDA.cmake b/cpp/cmake/modules/ConfigureCUDA.cmake index 29203e86be..6e8c7ce68e 100644 --- a/cpp/cmake/modules/ConfigureCUDA.cmake +++ b/cpp/cmake/modules/ConfigureCUDA.cmake @@ -26,7 +26,7 @@ endif() list(APPEND RAFT_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) # set warnings as errors -list(APPEND RAFT_CUDA_FLAGS -Werror=cross-execution-space-call) +list(APPEND RAFT_CUDA_FLAGS -Werror=all-warnings) list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) # Option to enable line info in CUDA device compilation to allow introspection when profiling / memchecking From 77e7dfdabddbd1e536a43c1b9c09350443faaa90 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Wed, 4 Aug 2021 10:15:55 +1000 Subject: [PATCH 2/2] NVCC Warnings as errors only for 11.2+ --- cpp/cmake/modules/ConfigureCUDA.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/cmake/modules/ConfigureCUDA.cmake b/cpp/cmake/modules/ConfigureCUDA.cmake index 6e8c7ce68e..3786910be0 100644 --- a/cpp/cmake/modules/ConfigureCUDA.cmake +++ b/cpp/cmake/modules/ConfigureCUDA.cmake @@ -26,7 +26,9 @@ endif() list(APPEND RAFT_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) # set warnings as errors -list(APPEND RAFT_CUDA_FLAGS -Werror=all-warnings) +if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) + list(APPEND RAFT_CUDA_FLAGS -Werror=all-warnings) +endif() list(APPEND RAFT_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) # Option to enable line info in CUDA device compilation to allow introspection when profiling / memchecking